pos icon indicating copy to clipboard operation
pos copied to clipboard

[15.0] pos_payment_change_wizard strange behavior on rounding

Open PlantBasedStudio opened this issue 1 year ago • 1 comments

Module

pos_payment_change -> pos_payment_change_wizard -> button_change_payment() method https://github.com/OCA/pos/blob/520940ba976bb6580529dc534d3de400d454c237/pos_payment_change/wizards/pos_payment_change_wizard.py#L59

Describe the bug

When you wish to modify a payment method that was originally in cash, odoo's basic operation converts the amount by rounding. The amount_total and amount_paid values will take on a value such as 12.4000008 instead of 12.40. The problem has already been reported in the following link, but without correction: https://github.com/odoo/odoo/issues/7024

the problem is that the current module will compare the odoo values and therefore the change of payment method will not take place. I think we should modify the method that compares the amounts to check that the first two digits after the decimal point are correct, rather than all the currency digits.

To Reproduce

Affected versions: 15.0

Steps to reproduce the behavior:

  1. Sell an article in POS by using cash
  2. Try to change paiement method to something else

PlantBasedStudio avatar Apr 17 '24 12:04 PlantBasedStudio

thanks

Charles2029 avatar Jun 19 '24 10:06 Charles2029