[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.
This commit is contained in:
dip-odoo
2018-03-23 10:41:10 +01:00
committed by Nicolas Martinelli
parent 845f4ef7d3
commit 82d5bb4504
+2 -1
View File
@@ -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):