-
-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0][MIG] mail_quoted_reply: Migration to 17.0 #1354
base: 17.0
Are you sure you want to change the base?
Conversation
/ocabot migration mail_quoted_reply |
res = super()._compute_body() | ||
for composer in self: | ||
context = composer._context | ||
if "is_quoted_reply" in context.keys() and context["is_quoted_reply"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if "is_quoted_reply" in context.keys() and context["is_quoted_reply"]: | |
if context.get("is_quoted_reply"): |
result["subject"] = tools.ustr(subj) | ||
return result | ||
@api.depends( | ||
"composition_mode", "model", "parent_id", "res_domain", "res_ids", "template_id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you remove record_name
here?
dabd555
to
0efb748
Compare
Hello @hbrunn, I updated as you suggest 🙏 |
Currently translated at 100.0% (8 of 8 strings) Translation: social-14.0/social-14.0-mail_quoted_reply Translate-URL: https://translation.odoo-community.org/projects/social-14-0/social-14-0-mail_quoted_reply/ca/
Currently translated at 100.0% (8 of 8 strings) Translation: social-14.0/social-14.0-mail_quoted_reply Translate-URL: https://translation.odoo-community.org/projects/social-14-0/social-14-0-mail_quoted_reply/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: social-15.0/social-15.0-mail_quoted_reply Translate-URL: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_quoted_reply/
Completed the migration to 16.0 incl. the upgrade to the OWL framework to make it more lean and reliable for the future.
This commit adds functionality to include the original subject of a message when composing a quoted reply. The `get_record_data` method in the `MailComposeMessage` model has been updated to check if there is a default subject and, if so, prepend "Re: " to it. This ensures that the new subject for the quoted reply includes a "Re:" prefix.
_prep_quoted_reply_body. put the format date in the env format [15][IMP]mail_quoted_reply: Added signature, and translate fields Make it: From, Date, Subject Strings translate Addded User Signature Update mail_message.py Update CONTRIBUTORS.rst
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: social-16.0/social-16.0-mail_quoted_reply Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_quoted_reply/
Without this, it is not possible to do a copy paste of a block of text into the mail composer.
Currently translated at 100.0% (6 of 6 strings) Translation: social-16.0/social-16.0-mail_quoted_reply Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_quoted_reply/es/
Currently translated at 100.0% (6 of 6 strings) Translation: social-16.0/social-16.0-mail_quoted_reply Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_quoted_reply/it/
0efb748
to
adc2c86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very bad in JS, so only Python review
def _compute_subject(self): | ||
res = super()._compute_subject() | ||
for composer in self: | ||
subj = composer._context.get("default_subject", False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
res = super()._compute_body() | ||
for composer in self: | ||
context = composer._context | ||
if context.get("is_quoted_reply"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since it appears to depend on a context key, aren't we supposed to add this key in @api.depends_context()
?
Hello @mmequignon, I updated as you suggest, thanks |
for composer in self: | ||
context = composer._context | ||
if context.get("is_quoted_reply"): | ||
composer.body = Markup(context["quote_body"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be noted that when a user replies to a message and wants to load a template from the template_id field, the template must be added to the content that we already have in the body.
You can fix this with this code since the body in the creation of mail.compose.message is False.
if context.get("is_quoted_reply"): if composer.body: composer.body += Markup(context["quote_body"]) else: composer.body = Markup(context["quote_body"])
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Major changes in V17
_onchange_template_id
+default_get
+get_record_data
usage into editablecomputed stored fields in here
_evaluate_res_ids
is introduced to parse composer res_ids in here. As consequence, 'default_res_id' is deprecated, should use 'default_res_ids'.Components: