Skip to content

[16.0][FIX] account_payment_term_extension: Define the appropriate value in some cases #807

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

Merged

Conversation

victoralmau
Copy link
Member

@victoralmau victoralmau commented Feb 27, 2025

Apply the same behavior as in account https://github.com/odoo/odoo/blob/733b1474e75b32c3a467b7c3f0a83c75467d4e50/addons/account/models/account_payment_term.py#L112.

Several problems are solved

ERROR prod odoo.addons.account_payment_term_extension.tests.test_account_payment_term_multi_day: FAIL: TestAccountPaymentTermMultiDay.test_invoice_multi_payment_term_round Traceback (most recent call last):
  File "/opt/odoo/auto/addons/account_payment_term_extension/tests/test_account_payment_term_multi_day.py", line 322, in test_invoice_multi_payment_term_round
    self.assertEqual(
AssertionError: 500.1 != 500 : Incorrect round for invoice with payment days on 15 and 20 then 5 and 10 (round)

If account_invoice_report_due_list was installed, an error was displayed in tests

ERROR prod odoo.addons.account_invoice_report_due_list.tests.test_invoice_report_due_list: FAIL: TestInvoiceReportDueList.test_due_list_currency_extra Traceback (most recent call last):
  File "/opt/odoo/auto/addons/account_invoice_report_due_list/tests/test_invoice_report_due_list.py", line 123, in test_due_list_currency_extra
    self.assertEqual(invoice2.get_multi_due_list()[0][2], 50.0)
AssertionError: 32.7 != 50.0

@Tecnativa

… some cases

Several problems are solved

ERROR prod odoo.addons.account_payment_term_extension.tests.test_account_payment_term_multi_day: FAIL: TestAccountPaymentTermMultiDay.test_invoice_multi_payment_term_round
Traceback (most recent call last):
  File "/opt/odoo/auto/addons/account_payment_term_extension/tests/test_account_payment_term_multi_day.py", line 322, in test_invoice_multi_payment_term_round
    self.assertEqual(
AssertionError: 500.1 != 500 : Incorrect round for invoice with payment days on 15 and 20 then 5 and 10 (round)

If account_invoice_report_due_list was installed, an error was displayed in tests

ERROR prod odoo.addons.account_invoice_report_due_list.tests.test_invoice_report_due_list: FAIL: TestInvoiceReportDueList.test_due_list_currency_extra
Traceback (most recent call last):
  File "/opt/odoo/auto/addons/account_invoice_report_due_list/tests/test_invoice_report_due_list.py", line 123, in test_due_list_currency_extra
    self.assertEqual(invoice2.get_multi_due_list()[0][2], 50.0)
AssertionError: 32.7 != 50.0
@victoralmau victoralmau marked this pull request as ready for review February 27, 2025 09:08
@victoralmau victoralmau changed the title [16.0][WIP] account_payment_term_extension: Define the appropriate value in some cases [16.0][FIX] account_payment_term_extension: Define the appropriate value in some cases Feb 27, 2025
@pedrobaeza pedrobaeza added this to the 16.0 milestone Mar 3, 2025
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Can we avoid overwriting the full method and instead just touch where needed?

@victoralmau
Copy link
Member Author

Can we avoid overwriting the full method and instead just touch where needed?

But the method should do the same as the standard does, right? Since the method was “copied” until now it has changed, that's why the data is incorrect.
Maybe we can create a PR to odoo so we can extend the method instead of having to overwrite it completely?

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Yes, but I don't have faith in having it merged. That's why I tell you to try to do it here. Anyway, let's merge for now for having this correct.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-807-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit f298474 into OCA:16.0 Mar 11, 2025
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at cf8c305. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 16.0-fix-account_payment_term_extension-tests branch March 11, 2025 19:53
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.

3 participants