Skip to content

[19.0] [MIG] account_invoice_overdue_reminder: Migration to 19.0#560

Open
stferraro wants to merge 116 commits into
OCA:19.0from
Jenrax-git:19.0-mig-account_invoice_overdue_reminder
Open

[19.0] [MIG] account_invoice_overdue_reminder: Migration to 19.0#560
stferraro wants to merge 116 commits into
OCA:19.0from
Jenrax-git:19.0-mig-account_invoice_overdue_reminder

Conversation

@stferraro

Copy link
Copy Markdown

No description provided.

alexis-via and others added 30 commits April 28, 2026 14:05
…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/
oca-ci and others added 4 commits April 28, 2026 14:05
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-git-bot OCA-git-bot added series:19.0 mod:account_invoice_overdue_reminder Module account_invoice_overdue_reminder labels Apr 28, 2026
@stferraro

Copy link
Copy Markdown
Author

@OCA credit-control/manteiners ping .

@stferraro stferraro mentioned this pull request Apr 29, 2026
13 tasks
@rrebollo

Copy link
Copy Markdown

@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).

image

@rrebollo rrebollo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
counter = fields.Integer(readonly=True)
counter = fields.Integer()

See above comment on this topic

Comment on lines +52 to +55
if action.invoice_id and action.invoice_id.move_type not in [
"out_invoice",
"out_refund",
]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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._(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.envv._(
self.env._(

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.write({"state": "skipped"})
self.state = "skipped"

orao.create(vals)
if rec.create_activity:
mao.create(self._prepare_mail_activity())
self.write({"state": "done"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)]})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
actions.write({"reminder_type": self.reminder_type})
actions.reminder_type = self.reminder_type

@stferraro stferraro changed the title 19.0 mig account invoice overdue reminder [19.0] [MIG] account_invoice_overdue_reminder: Migration to 19.0 Apr 29, 2026
@stferraro stferraro force-pushed the 19.0-mig-account_invoice_overdue_reminder branch from c564ccd to 82f9afa Compare April 30, 2026 00:06
@stferraro stferraro requested a review from rrebollo April 30, 2026 00:16
@rrebollo

rrebollo commented May 4, 2026

Copy link
Copy Markdown

@stferraro what about bringing back the tests adapted from v17?

@stferraro

Copy link
Copy Markdown
Author

Hi, @rrebollo Sure, I’ll bring back the tests adapted from v17 and update them accordingly for v19.0 to ensure proper coverage., @rrebollo

@stferraro stferraro force-pushed the 19.0-mig-account_invoice_overdue_reminder branch 2 times, most recently from bccc792 to b49ef71 Compare May 5, 2026 00:31
@stferraro stferraro force-pushed the 19.0-mig-account_invoice_overdue_reminder branch from b49ef71 to de5e2d9 Compare May 5, 2026 00:35

@rrebollo rrebollo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review. LGTM!

@stferraro

Copy link
Copy Markdown
Author

Hi, @alexis-via please check this PR and approve

@Yusuke1998 Yusuke1998 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@Karla-Villegas Karla-Villegas left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @stferraro. Your command failed:

Invalid command: ping.

Ocabot commands

  • ocabot merge major|minor|patch|nobump
  • ocabot rebase
  • ocabot migration {MODULE_NAME}

More information

@AnizR AnizR left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work !
I have some nit picking regarding the 'translation' of fields (I see that it has already been flagged).

Comment on lines +58 to +60
("mail", self.env._("E-mail")),
("phone", self.env._("Phone")),
("post", self.env._("Letter")),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +37 to +38
("onebyone", self.env._("One by One")),
("mass", self.env._("Mass")),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +44 to +46
("last_reminder", self.env._("Last Reminder")),
("last_invoice", self.env._("Last Invoice")),
("invoice_contact", self.env._("Invoice Contact")),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@stferraro

Copy link
Copy Markdown
Author

Thanks for the review and the positive feedback, @AnizR! Highly appreciate it. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.