Browse Source

[FIX]flake8 fixes

pull/239/head
Sandip Mangukiya 6 years ago
parent
commit
3fc4a1be86
  1. 7
      agreement/models/agreement.py
  2. 7
      agreement/models/agreement_appendix.py
  3. 7
      agreement/models/agreement_clause.py
  4. 7
      agreement/models/agreement_recital.py
  5. 7
      agreement/models/agreement_section.py

7
agreement/models/agreement.py

@ -40,7 +40,8 @@ class Agreement(models.Model):
track_visibility='onchange', track_visibility='onchange',
help="Description of the agreement" help="Description of the agreement"
) )
dynamic_description = fields.Text(compute="_compute_dynamic_description",
dynamic_description = fields.Text(
compute="_compute_dynamic_description",
string="Dynamic Description", string="Dynamic Description",
help='compute dynamic description') help='compute dynamic description')
start_date = fields.Date( start_date = fields.Date(
@ -332,8 +333,8 @@ class Agreement(models.Model):
MailTemplates = self.env['mail.template'] MailTemplates = self.env['mail.template']
for agreement in self: for agreement in self:
lang = agreement.partner_id.lang or 'en_US' 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.description, 'agreement', agreement.id)
agreement.dynamic_description = description agreement.dynamic_description = description

7
agreement/models/agreement_appendix.py

@ -15,7 +15,8 @@ class AgreementAppendix(models.Model):
"The name is not.") "The name is not.")
sequence = fields.Integer(string="Sequence", default=10) sequence = fields.Integer(string="Sequence", default=10)
content = fields.Html(string="Content") content = fields.Html(string="Content")
dynamic_content = fields.Html(compute="_compute_dynamic_content",
dynamic_content = fields.Html(
compute="_compute_dynamic_content",
string="Dynamic Content", string="Dynamic Content",
help='compute dynamic Content') help='compute dynamic Content')
agreement_id = fields.Many2one('agreement', string="Agreement", agreement_id = fields.Many2one('agreement', string="Agreement",
@ -33,7 +34,7 @@ class AgreementAppendix(models.Model):
for appendix in self: for appendix in self:
lang = appendix.agreement_id and \ lang = appendix.agreement_id and \
appendix.agreement_id.partner_id.lang or 'en_US' 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.content, 'agreement.appendix', appendix.id)
appendix.dynamic_content = content appendix.dynamic_content = content

7
agreement/models/agreement_clause.py

@ -25,7 +25,8 @@ class AgreementClause(models.Model):
ondelete="cascade" ondelete="cascade"
) )
content = fields.Html(string="Clause Content") 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", string="Dynamic Content",
help='compute dynamic Content') help='compute dynamic Content')
active = fields.Boolean( active = fields.Boolean(
@ -42,7 +43,7 @@ class AgreementClause(models.Model):
for clause in self: for clause in self:
lang = clause.agreement_id and \ lang = clause.agreement_id and \
clause.agreement_id.partner_id.lang or 'en_US' 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.content, 'agreement.clause', clause.id)
clause.dynamic_content = content clause.dynamic_content = content

7
agreement/models/agreement_recital.py

@ -15,7 +15,8 @@ class AgreementRecital(models.Model):
"The name is not.") "The name is not.")
sequence = fields.Integer(string="Sequence", default=10) sequence = fields.Integer(string="Sequence", default=10)
content = fields.Html(string="Content") content = fields.Html(string="Content")
dynamic_content = fields.Html(compute="_compute_dynamic_content",
dynamic_content = fields.Html(
compute="_compute_dynamic_content",
string="Dynamic Content", string="Dynamic Content",
help='compute dynamic Content') help='compute dynamic Content')
agreement_id = fields.Many2one('agreement', string="Agreement", agreement_id = fields.Many2one('agreement', string="Agreement",
@ -33,7 +34,7 @@ class AgreementRecital(models.Model):
for recital in self: for recital in self:
lang = recital.agreement_id and \ lang = recital.agreement_id and \
recital.agreement_id.partner_id.lang or 'en_US' 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.content, 'agreement.recital', recital.id)
recital.dynamic_content = content recital.dynamic_content = content

7
agreement/models/agreement_section.py

@ -25,7 +25,8 @@ class AgreementSection(models.Model):
string="Clauses" string="Clauses"
) )
content = fields.Html(string="Section Content") 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", string="Dynamic Content",
help='compute dynamic Content') help='compute dynamic Content')
active = fields.Boolean( active = fields.Boolean(
@ -42,7 +43,7 @@ class AgreementSection(models.Model):
for section in self: for section in self:
lang = section.agreement_id and \ lang = section.agreement_id and \
section.agreement_id.partner_id.lang or 'en_US' 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.content, 'agreement.section', section.id)
section.dynamic_content = content section.dynamic_content = content
Loading…
Cancel
Save