diff --git a/agreement/models/agreement.py b/agreement/models/agreement.py index ed4bced2..ff8c6731 100644 --- a/agreement/models/agreement.py +++ b/agreement/models/agreement.py @@ -40,7 +40,8 @@ class Agreement(models.Model): track_visibility='onchange', help="Description of the agreement" ) - dynamic_description = fields.Text(compute="_compute_dynamic_description", + dynamic_description = fields.Text( + compute="_compute_dynamic_description", string="Dynamic Description", help='compute dynamic description') start_date = fields.Date( @@ -332,8 +333,8 @@ class Agreement(models.Model): MailTemplates = self.env['mail.template'] for agreement in self: lang = agreement.partner_id.lang or 'en_US' - description = \ - MailTemplates.with_context(lang=lang).render_template( + description = MailTemplates.with_context( + lang=lang).render_template( agreement.description, 'agreement', agreement.id) agreement.dynamic_description = description diff --git a/agreement/models/agreement_appendix.py b/agreement/models/agreement_appendix.py index 4824a2e9..514b6d41 100644 --- a/agreement/models/agreement_appendix.py +++ b/agreement/models/agreement_appendix.py @@ -15,7 +15,8 @@ class AgreementAppendix(models.Model): "The name is not.") sequence = fields.Integer(string="Sequence", default=10) content = fields.Html(string="Content") - dynamic_content = fields.Html(compute="_compute_dynamic_content", + dynamic_content = fields.Html( + compute="_compute_dynamic_content", string="Dynamic Content", help='compute dynamic Content') agreement_id = fields.Many2one('agreement', string="Agreement", @@ -33,7 +34,7 @@ class AgreementAppendix(models.Model): for appendix in self: lang = appendix.agreement_id and \ appendix.agreement_id.partner_id.lang or 'en_US' - content = \ - MailTemplates.with_context(lang=lang).render_template( + content = MailTemplates.with_context( + lang=lang).render_template( appendix.content, 'agreement.appendix', appendix.id) appendix.dynamic_content = content diff --git a/agreement/models/agreement_clause.py b/agreement/models/agreement_clause.py index d5c7ea47..a0551d3e 100644 --- a/agreement/models/agreement_clause.py +++ b/agreement/models/agreement_clause.py @@ -25,7 +25,8 @@ class AgreementClause(models.Model): ondelete="cascade" ) content = fields.Html(string="Clause Content") - dynamic_content = fields.Html(compute="_compute_dynamic_content", + dynamic_content = fields.Html( + compute="_compute_dynamic_content", string="Dynamic Content", help='compute dynamic Content') active = fields.Boolean( @@ -42,7 +43,7 @@ class AgreementClause(models.Model): for clause in self: lang = clause.agreement_id and \ clause.agreement_id.partner_id.lang or 'en_US' - content = \ - MailTemplates.with_context(lang=lang).render_template( + content = MailTemplates.with_context( + lang=lang).render_template( clause.content, 'agreement.clause', clause.id) clause.dynamic_content = content diff --git a/agreement/models/agreement_recital.py b/agreement/models/agreement_recital.py index 1a7bad60..482ab190 100644 --- a/agreement/models/agreement_recital.py +++ b/agreement/models/agreement_recital.py @@ -15,7 +15,8 @@ class AgreementRecital(models.Model): "The name is not.") sequence = fields.Integer(string="Sequence", default=10) content = fields.Html(string="Content") - dynamic_content = fields.Html(compute="_compute_dynamic_content", + dynamic_content = fields.Html( + compute="_compute_dynamic_content", string="Dynamic Content", help='compute dynamic Content') agreement_id = fields.Many2one('agreement', string="Agreement", @@ -33,7 +34,7 @@ class AgreementRecital(models.Model): for recital in self: lang = recital.agreement_id and \ recital.agreement_id.partner_id.lang or 'en_US' - content = \ - MailTemplates.with_context(lang=lang).render_template( + content = MailTemplates.with_context( + lang=lang).render_template( recital.content, 'agreement.recital', recital.id) recital.dynamic_content = content diff --git a/agreement/models/agreement_section.py b/agreement/models/agreement_section.py index fcf2feee..7fbee027 100644 --- a/agreement/models/agreement_section.py +++ b/agreement/models/agreement_section.py @@ -25,7 +25,8 @@ class AgreementSection(models.Model): string="Clauses" ) content = fields.Html(string="Section Content") - dynamic_content = fields.Html(compute="_compute_dynamic_content", + dynamic_content = fields.Html( + compute="_compute_dynamic_content", string="Dynamic Content", help='compute dynamic Content') active = fields.Boolean( @@ -42,7 +43,7 @@ class AgreementSection(models.Model): for section in self: lang = section.agreement_id and \ section.agreement_id.partner_id.lang or 'en_US' - content = \ - MailTemplates.with_context(lang=lang).render_template( + content = MailTemplates.with_context( + lang=lang).render_template( section.content, 'agreement.section', section.id) section.dynamic_content = content