-
Notifications
You must be signed in to change notification settings - Fork 247
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
pricelist rules total discount not carried to invoices #1109
Comments
@anajuaristi, this is one of your modules. Please check. |
I have just realized about this issue. About combining them... I think it's more visual to the customer to see exactly the 3 discount that are applied in cascade instead of showing a single combined one. So even if the single field can be used to calculate subtotal or something in standar way to avoid further not needed developments, I think we should show somehow to the user the detail of the 3 applied discounts Thank you very much!! |
Ana, I agree with you that we should show three discounts. That will remain as it is right now. Only we will use another field for discount1 instead of discount field and compute discount field out of three discount fields (discount1, discount2, discount3). I'll do the fix today and we review it again. |
I see.. It could work. On the other side I was speaking about the invoice. 2015-12-17 12:20 GMT+01:00 Levent Karakaş [email protected]:
CEO Avanzosc, S.L http://www.avanzosc.es : Office phone / Tfono oficina: _El contenido de esta comunicación y de toda su documentación anexa es _Komunikazio honen edukia eta dokumentazio erantsia konfidentziala da eta |
it is possible but it is very hard. all invoice functions using discount should be made compatible. if you search discount on account.invoice model, there are many places to fix. One big problem is that some of them are big functions and needs to get parted by monkeypatching. I have seen pedro's mrp_hook addon and reasons behind creating that addon. we recently needed to monkeypatch half of the accounting functions to add currency rate type. it is such a pain. on the other hand maybe we can use a similar approach on invoices. It will require at least inheriting of the above methods I mentioned. We have experience on moving fields to invoice. I will think about it and propose a solution if possible. |
I made this PR related to this discussion: Now discounts plays nicely with invoice discount. I just want to point a few things that I came up while making the fix.
Please let me know your comments. I'll be glad to help. |
Regarding multiple discounts on invoice, it is possible to add three discounts on invoice calculating the actual discount. After that we can get three discounts feeded into invoice into above methods. |
When pricelist rules are used with multiple discounts, only first discount is carried to invoices. This logic is somewhat distributed into several methods and wizards in various modules. Following methods needs to be inherited and set the discount to correct value.
On the other hand, there is an alternative way, which is used in sale_three_discount module of Adhoc.
https://github.com/ingadhoc/odoo-addons/blob/8.0/sale_three_discounts/
This is simply making discount field readonly and setting it to combined discount of other three. If this method is used, rest of the flow works flawlessly. Only drawback is three discounts are combined and shown as one discount in invoices. I don't think it is necessary in invoices anyway.
If you can comment on this issue, I can happily help you fixing this issue and make a PR for it.
The text was updated successfully, but these errors were encountered: