-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] mail_no_reply: mail compose onchange and view
- Loading branch information
Showing
6 changed files
with
34 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from . import res_company | ||
from . import mail_template | ||
from . import mail_compose_message | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from odoo import api, fields, models | ||
|
||
|
||
class MailComposeMessage(models.TransientModel): | ||
_inherit = "mail.compose.message" | ||
|
||
active_no_reply = fields.Boolean(string="Use no-reply email") | ||
|
||
@api.onchange("active_no_reply") | ||
def _onchange_active_no_reply(self): | ||
template_id = self.env.context.get("default_template_id") | ||
if template_id: | ||
mail_template = self.env["mail.template"].browse(template_id) | ||
if mail_template: | ||
mail_template.active_no_reply = self.active_no_reply |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<odoo> | ||
<record id="mail_no_reply" model="ir.ui.view"> | ||
<field name="name">mail template form mail no reply</field> | ||
<field name="model">mail.template</field> | ||
<field name="inherit_id" ref="mail.email_template_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='email_from']" position="after"> | ||
<field name="active_no_reply" widget="boolean_toggle" /> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |