diff options
| author | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-07-15 07:51:57 +0000 |
|---|---|---|
| committer | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-07-23 18:54:23 +0000 |
| commit | 2442892ec171a89d12c2c52e382a9205eb18541a (patch) | |
| tree | d0c942271eeb47f46d29bbdbf20279c94b5a0ca6 /addons/point_of_sale/wizard | |
| parent | cf741bb7fc76b6947f244e469f344fa442aad23c (diff) | |
[FIX] point_of_sale,pos_cash_rounding: return payment with rounding
In the PoS, activate the cash rounding.
Open a PoS session and make a sale.
Close the session (without validating the entries yet),
Go to the just made order to return the items.
Upon making return payment, it gets stuck, because Odoo offers
to refund the unrounded amount and it doesn't match what the customer
paid.
opw-2289751
closes odoo/odoo#54870
X-original-commit: 0811db53c728c2e159c50c2c9f096a06d3ac3be2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/point_of_sale/wizard')
| -rw-r--r-- | addons/point_of_sale/wizard/pos_payment.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index ac753f403f6..40f3741973c 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -49,12 +49,12 @@ class PosMakePayment(models.TransientModel): if not float_is_zero(init_data['amount'], precision_rounding=currency.rounding): order.add_payment({ 'pos_order_id': order.id, - 'amount': currency.round(init_data['amount']) if currency else init_data['amount'], + 'amount': order._get_rounded_amount(init_data['amount']), 'name': init_data['payment_name'], 'payment_method_id': init_data['payment_method_id'][0], }) - if float_is_zero(order.amount_total - order.amount_paid, precision_rounding=currency.rounding): + if order._is_pos_order_paid(): order.action_pos_order_paid() order._create_order_picking() return {'type': 'ir.actions.act_window_close'} |
