From 82d5bb4504375da86c01212247632942a048f060 Mon Sep 17 00:00:00 2001 From: dip-odoo Date: Fri, 16 Mar 2018 18:46:53 +0530 Subject: [PATCH] [FIX] point_of_sale: fix the problem when download the invoice. - In pos payment page when we select invoice download option and validate payment that moment traceback occured. because in _match_payment_to_invoice method when we find account_precision do not find pricelist recored. --- addons/point_of_sale/models/pos_order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index d29dbadb5a1..576793273ce 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -89,7 +89,8 @@ class PosOrder(models.Model): return new_session def _match_payment_to_invoice(self, order): - account_precision = order.pricelist_id.currency_id.decimal_places + pricelist_id = self.env['product.pricelist'].browse(order.get('pricelist_id')) + account_precision = pricelist_id.currency_id.decimal_places # ignore orders with an amount_paid of 0 because those are returns through the POS if not float_is_zero(order['amount_return'], account_precision) and not float_is_zero(order['amount_paid'], account_precision):