-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by Yajo
- Loading branch information
Showing
9 changed files
with
213 additions
and
27 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
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 |
---|---|---|
@@ -1,11 +1,51 @@ | ||
from odoo import fields, models | ||
from odoo import api, fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
show_internal_users_cc = fields.Boolean( | ||
string="Show Internal Users CC", | ||
related="company_id.show_internal_users_cc", | ||
readonly=False, | ||
) | ||
show_followers_message_sent_to = fields.Html( | ||
related="company_id.show_followers_message_sent_to", | ||
readonly=False, | ||
) | ||
show_followers_partner_format = fields.Char( | ||
related="company_id.show_followers_partner_format", | ||
readonly=False, | ||
help="Supported parameters:\n" | ||
"%(partner_name)s = Partner Name\n" | ||
"%(partner_email)s = Partner Email\n" | ||
"%(partner_email_domain)s = Partner Email Domain", | ||
) | ||
show_followers_message_response_warning = fields.Html( | ||
related="company_id.show_followers_message_response_warning", | ||
readonly=False, | ||
) | ||
show_followers_message_preview = fields.Html( | ||
string="Message preview", | ||
readonly=True, | ||
store=False, | ||
) | ||
|
||
@api.onchange( | ||
"show_followers_message_sent_to", | ||
"show_followers_partner_format", | ||
"show_followers_message_response_warning", | ||
) | ||
def onchange_show_followers_message_preview(self): | ||
self.show_followers_message_preview = ( | ||
self.env["mail.mail"] | ||
.with_context( | ||
# Use current data before | ||
partner_format=self.show_followers_partner_format or "", | ||
msg_sent_to=self.show_followers_message_sent_to or "", | ||
msg_warn=self.show_followers_message_response_warning or "", | ||
) | ||
._build_cc_text( | ||
# Sample partners | ||
self.env["res.partner"].search([("email", "!=", False)], limit=3), | ||
) | ||
) |
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,4 +1,7 @@ | ||
To configure this module, you need to: | ||
|
||
#. Go General settings/Discuss/Show Internal Users CC and set if want to show or not internal users in cc details. | ||
#. Go General settings/Discuss/Show Followers on mails/Show Internal Users CC and set if want to show or not internal users in cc details. | ||
#. Go Settings/Users & Company salect any user in 'Preferences' check or not the 'Show in CC' field if this user need to appear in the cc note. | ||
#. Go General settings/Discuss/Show Followers on mails/Text 'Sent to' and set the initial part of the message. | ||
#. Go General settings/Discuss/Show Followers on mails/Partner format and choose desired fields to show on CC recipients. | ||
#. Go General settings/Discuss/Show Followers on mails/Text 'Replies' and choose desired warn message |
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,2 +1,3 @@ | ||
* Valentin Vinagre <valentin.vinagre@sygel.es> | ||
* Lorenzo Battistini | ||
* Eduardo de Miguel <edu@moduon.team> |
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