[19.0] [MIG] account_invoice_overdue_reminder: Migration to 19.0#560
[19.0] [MIG] account_invoice_overdue_reminder: Migration to 19.0#560stferraro wants to merge 116 commits into
Conversation
…instead of supplier invoice form
…update your mail templates) Add ability to add contacts as Cc of the reminder email (added to the Cc of the mail template) Add partner_policy with 3 options to give some choice about which contact should be selected to send reminders Access reminders from partner via Action menu
Advantages: 1) easy access to the history in the chatter of the partner. 2) no problem to access the email by other users (avoid "The requested operation cannot be completed due to security restrictions. Please contact your system administrator.")
Co-authored-by: ypapouin <y.papouin@dec-industrie.com>
Co-authored-by: ypapouin <y.papouin@dec-industrie.com>
…e customer invoices Move "Send overdue reminder" button to the alter banner.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: credit-control-14.0/credit-control-14.0-account_invoice_overdue_reminder Translate-URL: https://translation.odoo-community.org/projects/credit-control-14-0/credit-control-14-0-account_invoice_overdue_reminder/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: credit-control-14.0/credit-control-14.0-account_invoice_overdue_reminder Translate-URL: https://translation.odoo-community.org/projects/credit-control-14-0/credit-control-14-0-account_invoice_overdue_reminder/
Currently translated at 98.9% (185 of 187 strings) Translation: credit-control-14.0/credit-control-14.0-account_invoice_overdue_reminder Translate-URL: https://translation.odoo-community.org/projects/credit-control-14-0/credit-control-14-0-account_invoice_overdue_reminder/fr/
…mail vals generation
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: credit-control-18.0/credit-control-18.0-account_invoice_overdue_reminder Translate-URL: https://translation.odoo-community.org/projects/credit-control-18-0/credit-control-18-0-account_invoice_overdue_reminder/
Currently translated at 100.0% (185 of 185 strings) Translation: credit-control-18.0/credit-control-18.0-account_invoice_overdue_reminder Translate-URL: https://translation.odoo-community.org/projects/credit-control-18-0/credit-control-18-0-account_invoice_overdue_reminder/it/
|
@OCA credit-control/manteiners ping . |
|
@stferraro the migration should be done in a single commit. I'm referring strictly to the migration to version 19.0—you may have a pre-commit solving commit prior to that (still in 18.0), but you shouldn't have multiple commits for the migration itself (apart from that ones from git history, (work till 18.0).
|
rrebollo
left a comment
There was a problem hiding this comment.
These are the suggestions made in #523. Please also review the Migration to version 19.0 guide for the v19 specifications.
Additionally, during the migration to v18, the tests were removed. I strongly encourage bringing them back. You can look at the v17 tests and adapt them to v19.
| # Because of the "counter" field: a single reminder action for a customer, | ||
| # the "counter" may not be the same for each invoice | ||
| invoice_id = fields.Many2one( | ||
| "account.move", string="Invoice", ondelete="cascade", readonly=True |
There was a problem hiding this comment.
| "account.move", string="Invoice", ondelete="cascade", readonly=True | |
| "account.move", string="Invoice", ondelete="cascade" |
Consider OCA's Guidelines for migration to v17 comments on this topic:
If a field is marked as readonly=True on the model, it won't be possible to import it through the Odoo import tool, so avoid it as possible and define the readonly attribute on the views instead.
| action_result_notes = fields.Html(related="action_id.result_notes", readonly=False) | ||
| action_mail_id = fields.Many2one(related="action_id.mail_id") | ||
| action_mail_cc = fields.Char( | ||
| related="action_id.mail_id.email_cc", readonly=True, string="Cc" |
There was a problem hiding this comment.
| related="action_id.mail_id.email_cc", readonly=True, string="Cc" | |
| related="action_id.mail_id.email_cc", string="Cc" |
This is default behavior
| action_mail_state = fields.Selection( | ||
| related="action_id.mail_id.state", string="E-mail Status" | ||
| ) | ||
| counter = fields.Integer(readonly=True) |
There was a problem hiding this comment.
| counter = fields.Integer(readonly=True) | |
| counter = fields.Integer() |
See above comment on this topic
| if action.invoice_id and action.invoice_id.move_type not in [ | ||
| "out_invoice", | ||
| "out_refund", | ||
| ]: |
There was a problem hiding this comment.
| if action.invoice_id and action.invoice_id.move_type not in [ | |
| "out_invoice", | |
| "out_refund", | |
| ]: | |
| if action.invoice_id and not action.invoice_id.is_sale_document(): |
| "out_refund", | ||
| ]: | ||
| raise ValidationError( | ||
| self.envv._( |
There was a problem hiding this comment.
| self.envv._( | |
| self.env._( |
There was a problem hiding this comment.
Hi @rrebollo, thanks for your contribution and help. I'm going to correct these codes. Stay tuned for any further corrections.
| return action | ||
|
|
||
| def skip(self): | ||
| self.write({"state": "skipped"}) |
There was a problem hiding this comment.
| self.write({"state": "skipped"}) | |
| self.state = "skipped" |
| orao.create(vals) | ||
| if rec.create_activity: | ||
| mao.create(self._prepare_mail_activity()) | ||
| self.write({"state": "done"}) |
There was a problem hiding this comment.
| self.write({"state": "done"}) | |
| self.state = "done" |
| mail = self.env["mail.mail"].sudo().create(mvals) | ||
| if self.company_id.overdue_reminder_attach_invoice: | ||
| attachment_ids = self._get_attachment_ids(mail) | ||
| mail.write({"attachment_ids": [Command.set(attachment_ids)]}) |
There was a problem hiding this comment.
| mail.write({"attachment_ids": [Command.set(attachment_ids)]}) | |
| mail.attachment_ids = [Command.set(attachment_ids)] |
|
|
||
| def print_letter(self): | ||
| self.check_warnings() | ||
| self.write({"letter_printed": True}) |
There was a problem hiding this comment.
| self.write({"letter_printed": True}) | |
| self.letter_printed = True |
| elif self.update_action == "reminder_type": | ||
| if not self.reminder_type: | ||
| raise UserError(self.env._("You must select the new reminder type.")) | ||
| actions.write({"reminder_type": self.reminder_type}) |
There was a problem hiding this comment.
| actions.write({"reminder_type": self.reminder_type}) | |
| actions.reminder_type = self.reminder_type |
c564ccd to
82f9afa
Compare
|
@stferraro what about bringing back the tests adapted from v17? |
bccc792 to
b49ef71
Compare
b49ef71 to
de5e2d9
Compare
|
Hi, @alexis-via please check this PR and approve |
|
This PR has the |
|
Hi @stferraro. Your command failed:
Ocabot commands
More information
|
AnizR
left a comment
There was a problem hiding this comment.
Thanks for your work !
I have some nit picking regarding the 'translation' of fields (I see that it has already been flagged).
| ("mail", self.env._("E-mail")), | ||
| ("phone", self.env._("Phone")), | ||
| ("post", self.env._("Letter")), |
| ("onebyone", self.env._("One by One")), | ||
| ("mass", self.env._("Mass")), |
| ("last_reminder", self.env._("Last Reminder")), | ||
| ("last_invoice", self.env._("Last Invoice")), | ||
| ("invoice_contact", self.env._("Invoice Contact")), |
|
Thanks for the review and the positive feedback, @AnizR! Highly appreciate it. 🙏 |

No description provided.