-
Notifications
You must be signed in to change notification settings - Fork 17
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
[16.0] [MIG] email_template_config #301
Conversation
[TYPO] fix typo in description
[REF] pre-commit automatic linting [REF] lint xml [REF] optimize imports [WIP] add readmes and fix manifests [REF] lint csv [REF] flake8 fixes [REF] class-camelcase [REF] method-compute [REF] duplicate-id-csv pre-commit second pass [IMP] pre-commit run -a [IMP] addons readme and table [FIX] Run pre-commit Signed-off-by: Carmen Bianca Bakker <[email protected]> [UPD] Update email_template_config.pot
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## 16.0 #301 +/- ##
==========================================
- Coverage 97.73% 97.37% -0.36%
==========================================
Files 12 15 +3
Lines 221 229 +8
Branches 30 30
==========================================
+ Hits 216 223 +7
- Misses 1 2 +1
Partials 4 4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM, same comment as hugues
d8519d8
to
0a897a4
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.
I actually suspect there is something wrong with this module, I read in our migration analysis tool :
à garder
Module indispensable pour les implémentations cooperator (notamment) car en standard tous les mail template sont en ""force send"". Du coup, si le serveur mail n'est pas OP, impossible de lettrer les demandes de libération."
I see many wrong things
- why does the cooperator modules depend on this module fo function properly while not declaring the dependency ?
force_send
's default value is False (that is, put in the email queue). Therefore it should not block the mail unless we `send_mail(id, force_send=True)- it should be named
mail_template_force_send
or the like
The need for this module comes from (version 12)
# cooperator/models/account_invoice.py
class AccountInvoice(models.Model):
def set_cooperator_effective(self, effective_date):
...
self.create_user(self.partner_id)
def create_user(self, partner):
...
user.sudo().with_context({"create_user": True}).action_reset_password()
# auth_signup/models/res_users.py
class ResUsers(models.Model):
def action_reset_password(self):
...
template.with_context(lang=user.lang).send_mail(user.id, force_send=True, raise_exception=True)
The send_mail(force_send=True) waits for the mail to be sent and blocks the process if it fails. There should be a better wait to fix this.
By using oca/queue for example.
It does not strictly depend on it. It might be required for implementation for which we don't want or can't send email to cooperators
and we indeed do in cooperator/models/account_invoice, line 197 : email_template.sudo().send_mail(self.id, True). I don't know why the force send is set in this line, though.
Yes good idea |
note: while in version 12 and 14, there are indeed 2 mail messages sent with |
@huguesdk indeed but a force_send=True is still implicitely called by |
Discuté sur la tâche : ne pas porter 💩 |
https://gestion.coopiteasy.be/web#id=10959&action=475&active_id=492&model=project.task&view_type=form&menu_id=