Skip to content
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] account invoice fixed discount: Migration to 16.0 #1481

Conversation

TITUS6304658
Copy link

@TITUS6304658 TITUS6304658 commented Jun 10, 2023

16.0 mig account invoice fixed discount

Migration to version 16.0

LoisRForgeFlow and others added 30 commits June 11, 2023 00:20
Currently translated at 100.0% (6 of 6 strings)

Translation: account-invoicing-12.0/account-invoicing-12.0-account_invoice_fixed_discount
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_invoice_fixed_discount/de/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-invoicing-13.0/account-invoicing-13.0-account_invoice_fixed_discount
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-13-0/account-invoicing-13-0-account_invoice_fixed_discount/
Odoo has changed the signature of the method `_get_fields_onchange_balance_model`.
@TITUS6304658 TITUS6304658 force-pushed the 16.0-mig-account_invoice_fixed_discount branch 18 times, most recently from d09c80b to ca5752c Compare June 13, 2023 09:49
Copy link

@CRogos CRogos left a comment

Choose a reason for hiding this comment

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

Please reaname the module in your PR subject to account_invoice_fixed_discount.

There is also a second PR ongoing here. #1488

Comment on lines 87 to 107
def test_01_discounts_fixed(self):
"""Tests multiple discounts in line with taxes."""
invoice = self._create_invoice(discount_fixed=57)
with self.assertRaises(ValidationError):
invoice.invoice_line_ids.discount = 50
invoice.invoice_line_ids._onchange_discount_fixed()
self.assertEqual(invoice.invoice_line_ids.discount, 0.00)
invoice.invoice_line_ids._onchange_price_subtotal()
invoice.line_ids.write({"recompute_tax_line": True})
invoice._onchange_invoice_line_ids()
# compute amount total (200 - 57) * 10%
self.assertEqual(invoice.amount_total, 157.3)
self.assertEqual(invoice.invoice_line_ids.price_unit, 200.00)
self.assertEqual(invoice.invoice_line_ids.price_subtotal, 143.00)
if not cls.tax_account_id:
raise Exception("No account with user_type_id of type 'Revenue' found")

def test_02_discounts(self):
invoice = self._create_invoice(discount=50)
invoice.invoice_line_ids._onchange_discount()
self.assertEqual(invoice.invoice_line_ids.discount_fixed, 0.00)
self.assertEqual(invoice.invoice_line_ids.price_unit, 200.00)
self.assertEqual(invoice.invoice_line_ids.price_subtotal, 100.00)
Copy link

Choose a reason for hiding this comment

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

Why did you remove these tests? There is no test left in this file.

@rousseldenis
Copy link
Contributor

rousseldenis commented Jul 24, 2023

@TITUS6304658 @CRogos In fact, the module has to be refactored due to core changes. See #1488 (comment) comments.

Tests are passing but in fact... not tested.

So, this one is invalid at this time being

Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

To be refactored or superseded by #1488

@rafaelbn
Copy link
Member

rafaelbn commented Aug 3, 2023

/ocabot migration account_invoice_fixed_discount

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Aug 3, 2023
@OCA-git-bot OCA-git-bot mentioned this pull request Aug 3, 2023
64 tasks
@rafaelbn
Copy link
Member

rafaelbn commented Aug 3, 2023

superseded by #1488

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.