Daily updates from Odoo
Friday, October 18, 2019
2 changes
Resolved issues and error corrections
This update removes an obsolete internal graph utility that was no longer needed. It simplifies the core codebase and reduces maintenance overhead without changing day-to-day user workflows.
Odoo now better protects default activity types from being deleted when other processes still depend on them. If an activity type reference is missing, the system can fall back to a standard activity type, reducing errors and keeping reminders and automated actions running smoothly.
Original PR description
If a user deletes one of the default activity types of odoo, a bunch of ref to the xmlid of the activity type may cause errors. To allow more flexibility, this a fallback mechanism is implemented in…
If a user deletes one of the default activity types of odoo, a bunch of ref to the xmlid of the activity type may cause errors.
To allow more flexibility, this a fallback mechanism is implemented in _**mail.activity.mixin**_ s.t. when calling activity_schedule(xmlid, ...), if the given xmlid is not found, _default_activity_type()_ specifies the default activity (and can be overridden in classes using the activity mixin).
```python
def _default_activity_type(self):
"""Define a default fallback activity type when xml id not found
only used in in activity_schedule() for now.
"""
try:
return self.env.ref('mail.mail_activity_data_todo')
except Exception:
return False
```
* Prevent deletion of activity type (hr.plan and ir.actions.server)
* Fallback on default activity type if xmlid ref not found in activity_schedule
* Correct calls to activity_schedule and replace some create calls by activity_schedule
Task ID : 1961156
[Enterprise PR](https://github.com/odoo/enterprise/pull/4032)
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr