[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
This commit is contained in:
Denis Ledoux 2015-04-13 12:57:51 +02:00
parent a41d8ef937
commit cad5dffdfa
1 changed files with 2 additions and 1 deletions

View File

@ -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]