From f0f45c8fa2e9069f25b202e57774d3f4d44b1d2a Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Fri, 25 Sep 2015 15:55:21 +0200 Subject: [PATCH] [FIX] point_of_sale: set taxes when creating pos_order from form view When creating pos_orders from the form view, tax_ids on the pos_order_lines were never set. This was kind of fixed in 5327869356ca629728ef45ebdef2598c1d02dd4b. But in there it was in onchange_qty, because the way the fiscal position was taken into account required it to be. Because we take the fiscal position into account in a different way now we can assign the taxes in onchange_product_id which makes a bit more sense. --- addons/point_of_sale/point_of_sale.py | 4 ++++ addons/point_of_sale/point_of_sale_view.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 11f554eea1e..c587e259543 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1403,6 +1403,10 @@ class pos_order_line(osv.osv): result = self.onchange_qty(cr, uid, ids, pricelist, product_id, 0.0, qty, price, context=context) result['value']['price_unit'] = price + + prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context) + result['value']['tax_ids'] = prod.taxes_id.ids + return result def onchange_qty(self, cr, uid, ids, pricelist, product, discount, qty, price_unit, context=None): diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 8db659c0678..cea736d597a 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -51,6 +51,7 @@ +