[18.0][MIG] scheduler_error_mailer - #3084
Conversation
d3b6403 to
077b944
Compare
|
/ocabot migration scheduler_error_mailer |
StefanRijnhart
left a comment
There was a problem hiding this comment.
Tests are fixed in #3190. Please rebase once that one is merged.
|
@StefanRijnhart I will, thank you! |
077b944 to
fb57bb5
Compare
|
rebased |
CRogos
left a comment
There was a problem hiding this comment.
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-18.0
Squash administrative commits (if any) with the previous commit for reducing commit noise. Check https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests#mergesquash-the-commits-generated-by-bots-or-weblate for details.
Here are some examples:

Maybe we could also improve the test and test "def _callback" instead of "def _handle_callback_exception"?
|
@astirpe are you still working on this? |
|
@CRogos Thank you for your review! I'm very busy with projects, I could continue with this when I can find some time. Sorry |
4cc7a69 to
33debe6
Compare
|
@CRogos Is it alright for you now? |
|
Thank you @StefanRijnhart ! |
CRogos
left a comment
There was a problem hiding this comment.
Can you squash your latest changes with the Migration commit and also cleanup the commits above according to the migration guide?
| self._handle_callback_exception(cron_name, server_action_id, e) | ||
|
|
||
| # Re-raise the original job exception | ||
| raise e |
There was a problem hiding this comment.
Can't we write raise without the e to reraise?
There was a problem hiding this comment.
Are you sure this is the best option?
Couldn't we just call load_data with the ir_cron_email_tpl.xml file?
https://github.com/OCA/openupgradelib/blob/37cc7eeb1383fbe7c3d5cd2666af3b73338a90cd/openupgradelib/openupgrade.py#L292
Something like this:
OCA/account-financial-reporting@8ba049e8
There was a problem hiding this comment.
That would be equivalent to calling reset_template on the template, but it would reset other fields as well such as subject and recipients which are customized in our setups. Also, this bit takes care to reset the body in each language (as per code taken from reset_template).
There was a problem hiding this comment.
For reference: code is based on https://github.com/odoo/odoo/blob/18.0/addons/mail/models/template_reset_mixin.py#L70-L93
|
I will do the rebase and squash, thanks! |
| @api.model | ||
| def _test_scheduler_failure(self): | ||
| """This function is used to test and debug this module.""" | ||
| raise UserError(_("Task failure with UID = %d.") % self._uid) |
There was a problem hiding this comment.
_ should also be replaced
raise UserError(self.env._("Task failure with UID = %(uid)d.", uid=self._uid))
2eab569 to
a743176
Compare
| def _test_scheduler_failure(self): | ||
| """This function is used to test and debug this module.""" | ||
| raise UserError(_("Task failure with UID = %d.") % self._uid) | ||
| raise UserError(_("Task failure with UID = %(uid)d."), uid=self._uid) |
There was a problem hiding this comment.
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-18.0
You can replace the call to translate a string () with self.env. for getting some performance improvement in some cases. See odoo/odoo#174844.
Currently translated at 100.0% (8 of 8 strings) Translation: server-tools-15.0/server-tools-15.0-scheduler_error_mailer Translate-URL: https://translation.odoo-community.org/projects/server-tools-15-0/server-tools-15-0-scheduler_error_mailer/es_AR/
[UPD] README.rst
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-tools-16.0/server-tools-16.0-scheduler_error_mailer Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-scheduler_error_mailer/
Currently translated at 100.0% (9 of 9 strings) Translation: server-tools-16.0/server-tools-16.0-scheduler_error_mailer Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-scheduler_error_mailer/es_AR/
Currently translated at 100.0% (9 of 9 strings) Translation: server-tools-16.0/server-tools-16.0-scheduler_error_mailer Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-scheduler_error_mailer/es/
Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-tools-16.0/server-tools-16.0-scheduler_error_mailer Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-scheduler_error_mailer/
[BOT] post-merge updates Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-tools-17.0/server-tools-17.0-scheduler_error_mailer Translate-URL: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-scheduler_error_mailer/
Translated using Weblate (Italian) Currently translated at 100.0% (8 of 8 strings) Translation: server-tools-17.0/server-tools-17.0-scheduler_error_mailer Translate-URL: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-scheduler_error_mailer/it/
Currently translated at 100.0% (8 of 8 strings) Translation: server-tools-17.0/server-tools-17.0-scheduler_error_mailer Translate-URL: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-scheduler_error_mailer/zh_CN/
Update scheduler_error_mailer/models/ir_cron.py Co-authored-by: Christopher Rogos <crogos@gmail.com> Update scheduler_error_mailer/models/ir_cron.py C#o-authored-by: Christopher Rogos <crogos@gmail.com>
…del changes [FIX] scheduler_error_mailer: migrated template might not have template_fs
05d6184 to
d4cee9d
Compare
|
@CRogos squashed, thanks! |
|
This PR has the |
|
/ocabot merge nobump |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 4d92829. Thanks a lot for contributing to OCA. ❤️ |
No description provided.