-
-
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
[14.0][ADD] account_global_discount_amount module #807
[14.0][ADD] account_global_discount_amount module #807
Conversation
@chafique-delli @sebastienbeau it seems there is a double effort here, see this generic module being migrated to v13 by Tecnativa https://github.com/Tecnativa/server-backend/tree/13.0-mig-base_global_discount/base_global_discount |
And this one is not preserving commit history. |
@rvalyi , @pedrobaeza , I have added an explanation of what the module will do. |
Sorry, I got confused this module with |
Hi @pedrobaeza it's not the same module but having you feedback will be a pleasure In our case we need to put a discount amount (not a percentage but an amount) on sale order and/or invoice. We need to split this amount (by taxes), so we were thinking of adding extra (sale.order.line /account.invoice.line) like the carrier one. More over since V13 the invoice and move are merge adding new line with the type discount seem for use the simpliest solution. Maybe we should try to add this feature directly in your module ? Instead of doing something else (the issue is that we are going to create a lot of global.discount) Did you plan to migrate account_global_discount in V13 ? how to do plan to support this discount line ? still in the global.discount.line or directly like an account.move.line ? |
My colleague @chienandalu and me thought initially to add both kind of discounts in What is the main problem? The distribution of the discount across lines. You can't create an extra line for such discount (or at least not only one), as account and taxes may vary from line to line. So you need then to spread everything proportionally. In percentage discount, that proportionality is simple: apply the same percentage everywhere. On fixed discount, you need to add a bit more logic to spread it over lines, but it can be done with such addition. Then the challenge is to get to proper invoice and journal items data. We use the intermediate model for easing this task, and touch on totals and tax computations, and on move generation. My colleague @ernestotejeda is now analyzing how to port this to v13, and we will have soon this migration done. I haven't dug too much, but now that the move line generation is immediate, I think we can create as many extra move lines as needed for balancing the amounts, hidden as journal items, but not sure if the code, that is very convoluted, will allow us this for the computed totals, and maybe the extra model is still needed. Anyway, these changes will be the same for you once you have made the spread over the lines (proportionally by line amount over the fixed amount?), so I recommend that if you can wait, adapt these set of modules for adding the new type of discount. |
fdc64d2
to
784ea02
Compare
#967 should be taken into account, as previous version is not fully correct. |
account_global_discount_amount/tests/test_account_global_discount_amount.py
Outdated
Show resolved
Hide resolved
a922058
to
90c747d
Compare
9f26f0a
to
ae79b03
Compare
@chafique-delli @sebastienbeau What's the status of this ? |
@sebastienbeau , Can you update the status of the P.R. |
…orrectly, fix rounding issue
@rousseldenis Module is ready for review. |
Note I have approve only to remove my blocking review, please review and approve this work before any merge |
ce6e410
to
a3ded7c
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
This module allows you to enter an amount for a global discount to be applied to the invoice.
Discount lines will be automatically created per tax group.
When creating and modifying an invoice with a global discount, all total amounts will be checked to ensure that the discount has been applied correctly. If not, an automatic correction of the invoice will be made.