summaryrefslogtreecommitdiff
path: root/addons/website_forum_doc/data/doc_data.xml
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-02-20 12:26:31 +0100
committerDenis Ledoux <dle@odoo.com>2015-02-20 12:44:11 +0100
commit4ad329de55a96d0ff31bc13850945aacb89d0e30 (patch)
treed501440bc3c458742a76017d80b674f27767bcb6 /addons/website_forum_doc/data/doc_data.xml
parent4ed38c2a920aeaacb70c2a81967b57d8f6bb26f6 (diff)
[FIX] delivery: shipping invoice line depending on amount total
The delivery module overrode the method _create_invoice_from_picking to add the shipping costs according to the invoice and the shipping. The issue is that the method _create_invoice_from_picking creates an empty invoice, without any line. The lines are added afterwards, using the method _create_invoice_line_from_vals, within the method _invoice_create_line. So, after having called _create_invoice_from_picking, the invoice is indeed created, but without lines, and therefore without the amount total value. Adding the shipping costs there will thus prevent the shipping costs based on the total price of the invoice (e.g. free for an order of 500€) This rev. overrides the method _invoice_create_line instead, as, after the call to this method, the invoice will be completely set, with all its lines, and with a correct amount total. The side effect is that we need to recompute the taxes a second time, using button_compute. This is not the cleanest way to solve this issue. Indeed, a cleaner patch would be to change the method _create_invoice_from_picking so it creates the invoice along with its invoice lines, using the ORM command (0, _, values) to creates the lines directly within the invoice creation: invoice['invoice_line'] = [(0, _, values) for values in invoice_lines_vals]. Nevertheless, this is a bigger change, that will probably require API changes, and therefore should be done in master. opw-626226 opw-628517
Diffstat (limited to 'addons/website_forum_doc/data/doc_data.xml')
0 files changed, 0 insertions, 0 deletions