Skip to content

Commit

Permalink
[IMP] cooperator: Set cooperator_share_update_mail_template on company
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
  • Loading branch information
carmenbianca committed Jun 7, 2023
1 parent 6c6a35f commit 02ad6ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cooperator/models/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ def _compute_base_logo(self):
send_share_transfer_email = fields.Boolean(
string="Send Share Transfer Email", default=True
)
cooperator_share_update_mail_template = fields.Many2one(
comodel_name="mail.template",
string="Share transfer email template",
domain="[('model', '=', 'res.partner')]",
)
send_share_update_email = fields.Boolean(
string="Send Share Update Email", default=True
)
Expand Down Expand Up @@ -200,6 +205,7 @@ def _get_cooperator_mail_template_fields(self):
"cooperator_share_transfer_mail_template": (
"cooperator.email_template_share_transfer"
),
"cooperator_share_update_mail_template": "cooperator.email_template_share_update",
}

def _get_default_cooperator_mail_template(self, xmlid, copy=True):
Expand Down
2 changes: 1 addition & 1 deletion cooperator/models/operation_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def _get_share_transfer_mail_template(self):
return self.company_id.cooperator_share_transfer_mail_template

def _get_share_update_mail_template(self):
return self.env.ref("cooperator.email_template_share_update", False)
return self.company_id.cooperator_share_update_mail_template

def _send_share_transfer_mail(
self, sub_register_line
Expand Down
1 change: 1 addition & 0 deletions cooperator/views/res_company_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<!-- TODO: Should there be a send toggle for this one? -->
<field name="cooperator_waiting_list_mail_template" />
<field name="cooperator_share_transfer_mail_template" />
<field name="cooperator_share_update_mail_template" />
</group>
</group>
</field>
Expand Down

0 comments on commit 02ad6ec

Please sign in to comment.