From cad5dffdfaa26c3e4b0ad299d97f1a7c3add5c9d Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 13 Apr 2015 12:57:51 +0200 Subject: [PATCH] [FIX] point_of_sale: Taxes in sales lines report product_taxes_rel is the many2many table between product.template and account.tax product_id on the POS order line is a product.product. Therefore, the join on product_taxes_rel should be done using the product.template id of the product on the pos order line, and not directly the product.product id. opw-632720 --- addons/point_of_sale/report/pos_lines.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/report/pos_lines.py b/addons/point_of_sale/report/pos_lines.py index b4cf512cbe8..f0a4c949327 100644 --- a/addons/point_of_sale/report/pos_lines.py +++ b/addons/point_of_sale/report/pos_lines.py @@ -46,7 +46,8 @@ class pos_lines(report_sxw.rml_parse): def __taxes__(self, obj): self.cr.execute ( " Select acct.name from pos_order as po " \ " LEFT JOIN pos_order_line as pol ON po.id = pol.order_id " \ - " LEFT JOIN product_taxes_rel as ptr ON pol.product_id = ptr.prod_id " \ + " LEFT JOIN product_product as pp ON pol.product_id = pp.id" + " LEFT JOIN product_taxes_rel as ptr ON pp.product_tmpl_id = ptr.prod_id " \ " LEFT JOIN account_tax as acct ON acct.id = ptr.tax_id " \ " WHERE pol.id = %s", (obj.id,)) res=self.cr.fetchone()[0]