-
-
Notifications
You must be signed in to change notification settings - Fork 692
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
[MIG] account_global_discount: 16.0 #1338
Conversation
I can't say too much. Maybe you have to override |
4c057fc
to
c44a654
Compare
Hey @OCA/accounting-maintainers this should be ready for review now! 🥳 |
c44a654
to
86046c8
Compare
/ocabot migration account_global_discount |
Hi @OCA/accounting-maintainers I'm having trouble migrating the tests for this module, for some reason when a global discount is added a new tax line is added too instead of updating the existing one. Does anyone have encountered a similar problem? I'd be very thankful if anyone could help me out here. Thanks in advance |
@ferran-S73 not sure if this is the right place for feedback to that module. I tested everything and it looks quite good from a users perspective. But the two new lines at the bottom of the Sale Order and Invoice are not in the right place. Maybe this is already fixed? Can you reproduce this? I added an attachment. |
Hi I'll try to reproduce with the same currency and reach you back with anything I find out @BT-skettler |
e455d65
to
bb3d463
Compare
8299c87
to
1c0979a
Compare
@OCA/accounting-maintainers |
/ocabot rebase |
@rafaelbn The rebase process failed, because command
|
Hello @ferran-S73 , Is this whay you except? I have beed testing and I don't like to much this module, complicated. REAMDE in configuration should be reviewed. Any case, testing is OK no error, just some maybe UX? Up to you! |
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.
Functional basic test in runbot 👍🏼
You can review here @BT-skettler ! 🥳 |
@ferran-S73 I hope I tested it correctly. On runbot I could see that the summary below the sale order line is aligned (with currency CHF). |
Please, cherry-pick #1531 to commit history |
5630ec1
to
af02d49
Compare
… amount_currency and it could fail with constraint
Currently translated at 100.0% (36 of 36 strings) Translation: account-invoicing-14.0/account-invoicing-14.0-account_global_discount Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-14-0/account-invoicing-14-0-account_global_discount/it/
odoo/odoo@c9d5f06 has changed the number of arguments on the method `_recompute_tax_lines`, so we need to adapt the overrides to such change.
Currently translated at 100.0% (35 of 35 strings) Translation: account-invoicing-14.0/account-invoicing-14.0-account_global_discount Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-14-0/account-invoicing-14-0-account_global_discount/pt/
In a foreign currency invoice the amounts (amount_total, amount_untaxed) are expressed in the `invoice` currency while the accounting entry lines are expressed in the `company` currency. The base_before_global_discounts has to be expressed in the invoice currency as well in such invoices because the discounts need to be computed in the same currency as the other amounts. Also set the invoice currency_id on the tax line so that it doesn't default to the company currency, and convert the discount journal entry amount to the company currnecy.
- Depending on the installed set of modules, the company currency may be USD or EUR. If the second case, these tests will fail, so we make sure that the company currency is USD for our tests, doing the change by SQL, as there's a Python constraint that prevents it. Not needed in v17 due to: odoo/odoo#107113.
…issues on big database installation
2fd9f4e
to
df03898
Compare
@PauBForgeFlow |
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.
Functional review LGTM :) Thanks!
TT45863
@@ -0,0 +1 @@ | |||
odoo-addon-base_global_discount @ git+https://github.com/OCA/server-backend.git@refs/pull/221/head#subdirectory=setup/base_global_discount |
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.
This module is already merged, could you please remove this file in order to pass the tests in Github Actions.
Is there anything else to do? so we can unlock some migrations! ping @pedrobaeza |
For unlocking the situation, I have extracted the migration from this PR and remove the depending change in #1724 Closing this one. When the other PR gets unlocked, you can propose the improvement in this module in a new PR. |
Depends on:
Hi I'm gonna need some help migrating this module @OCA/accounting-maintainers @kirca @omar7r @pedrobaezaMany accounting code has been refactored in v16 and so my approach here, since there's no_recompute_tax_lines
nor_recompute_dynamic_lines
is to do this module's calculations whenever an invoice is created or the fieldglobal_discount_ids
is written following indications from Odoo's commit description.I'm not quite getting the desired results and I was wondering if you could help me pointing if this is a viable approach or if you have any other idea.I also looked at this migration but can't seem to figure how could I do something similar here.
Thanks in advance to anyone who can helpIn order to adapt this module to the new way of handling invoices in 16.0 I moved the creation / update of discount lines to the
create
andwrite
methods of theaccount.move
. We no longer need the recalc the bas amount for the discount lines since it is done automatically by Odoo as well as the total amounts of the invoice.Also, for the field
global_discount_item
which was needed becauseinvoice_global_discount_id
wasn't properly filled, I checked and that last field is now handled correctly. I'm not removing theglobal_discount_item
altogether for compatibility reasons with old invoices since there's no clear way to migrate it to fillinvoice_global_discount_id
.