[IMP]mail_activity_plan:use mail.activity.type default_description as activity.template default note

This commit is contained in:
2023-10-16 17:58:06 +02:00
parent 7b17be925c
commit ba60a0be89
3 changed files with 26 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ class MailActivityTemplate(models.Model):
sequence = fields.Integer('Sequence', default=1, help="Used to order activities.")
summary = fields.Char('Summary', compute="_compute_default_summary", store=True, readonly=False)
user_id = fields.Many2one('res.users', string='Assigned to')
note = fields.Html('Note')
note = fields.Html('Note', compute="_compute_default_note", store=True, readonly=False)
@api.depends('mail_activity_type_id')
def _compute_default_summary(self):
@@ -30,6 +30,12 @@ class MailActivityTemplate(models.Model):
if not mail_activity_template.summary and mail_activity_template.mail_activity_type_id and mail_activity_template.mail_activity_type_id.summary:
mail_activity_template.summary = mail_activity_template.mail_activity_type_id.summary
@api.depends('mail_activity_type_id')
def _compute_default_note(self):
for mail_activity_template in self:
if not mail_activity_template.note and mail_activity_template.mail_activity_type_id and mail_activity_template.mail_activity_type_id.default_description:
mail_activity_template.note = mail_activity_template.mail_activity_type_id.default_description
class MailActivityPlan(models.Model):
'''
Create a plan