From 150bf7dba650bf149720f5e2ac32d42543a672f9 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 25 Jul 2016 13:34:12 +0200 Subject: [PATCH] [FIX] point_of_sale: missing tax in accounting entry The accounting item generated from a PoS order does not contain the related taxes. Although the accounting entry is globally correct since the tax line is created manually, the tax should still be written on the accounting item for reporting purpose. Note that this is already the behavior when the accounting entry is generated directly from an invoice. Fixes #10855 --- addons/point_of_sale/point_of_sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 29bee71a778..b2bf0b024e3 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1345,6 +1345,7 @@ class pos_order(osv.osv): 'analytic_account_id': self._prepare_analytic_account(cr, uid, line, context=context), 'credit': ((amount>0) and amount) or 0.0, 'debit': ((amount<0) and -amount) or 0.0, + 'tax_ids': [(6, 0, line.tax_ids.ids)], 'partner_id': order.partner_id and self.pool.get("res.partner")._find_accounting_partner(order.partner_id).id or False }) @@ -1383,7 +1384,7 @@ class pos_order(osv.osv): for value in group_data: all_lines.append((0, 0, value),) if move_id: #In case no order was changed - self.pool.get("account.move").write(cr, SUPERUSER_ID, [move_id], {'line_ids':all_lines}, context=context) + self.pool.get("account.move").write(cr, SUPERUSER_ID, [move_id], {'line_ids':all_lines}, context=dict(context or {}, dont_create_taxes=True)) self.pool.get("account.move").post(cr, SUPERUSER_ID, [move_id], context=context) return True