Skip to content

Commit e39bc81

Browse files
[FIX] mail: do not reset activity type with wrong model
Just warn models are invalid, but do not reset for stable. Data is not enforced hence no real issue with wrong models. Followup of odoo#156731 closes odoo#218549 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
1 parent 3e55774 commit e39bc81

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addons/mail/models/mail_activity_mixin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,9 @@ def activity_schedule(self, act_type_xmlid='', date_deadline=None, summary='', n
382382
'Invalid activity type model %s used on %s (tried with xml id %s)',
383383
activity_type.res_model, self._name, act_type_xmlid or '',
384384
)
385-
activity_type = self._default_activity_type()
385+
# TODO master: reset invalid model to default type, keep it for stable as not harmful
386+
if not activity_type:
387+
activity_type = self._default_activity_type()
386388

387389
model_id = self.env['ir.model']._get(self._name).id
388390
create_vals_list = []

0 commit comments

Comments
 (0)