summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAnh Thao Pham (pta) <pta@odoo.com>2021-01-29 17:08:36 +0000
committerAnh Thao Pham (pta) <pta@odoo.com>2021-02-01 12:11:35 +0000
commitd207a0fbe63c40eb879964ae6fb6c742d276fa5e (patch)
tree14dc251b519a3140ad7a31cd96680095ecc3d0ab /addons
parent3585c2c38955ece4292da77de7173fb31a6992ba (diff)
[FIX] pos_cash_rounding: fix cash rounding for cash method only
- Go to Point of Sale > Configuration > Settings & enable "Cash Rounding" - Configure POS: * Enable Invoicing * Enable "Cash Rounding" and "Only on cash methods" * Select 0.05 HALF-UP Rounding Method - Start POS session - Select a Product and change its Price to a value that should be rounded (i.e. $ 16.51) - Select a Customer - Proceed to Payment - Enable Invoice - Select Bank Payment method - Validate No rounding is applied as expected, but the rounding line still appears on printed Invoice. opw-2449222 closes odoo/odoo#65317 X-original-commit: b0eb0fe06a3a9946d2565c6f9efe67f760a3837f Signed-off-by: pimodoo <pimodoo@users.noreply.github.com> Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/point_of_sale/models/pos_order.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py
index a73f028aa26..79f5b3a6df6 100644
--- a/addons/point_of_sale/models/pos_order.py
+++ b/addons/point_of_sale/models/pos_order.py
@@ -402,7 +402,9 @@ class PosOrder(models.Model):
'invoice_date': self.date_order.astimezone(timezone).date(),
'fiscal_position_id': self.fiscal_position_id.id,
'invoice_line_ids': [(0, None, self._prepare_invoice_line(line)) for line in self.lines],
- 'invoice_cash_rounding_id': self.config_id.rounding_method.id if self.config_id.cash_rounding else False
+ 'invoice_cash_rounding_id': self.config_id.rounding_method.id
+ if self.config_id.cash_rounding and (not self.config_id.only_round_cash_method or any(p.payment_method_id.is_cash_count for p in self.payment_ids))
+ else False
}
return vals