odoo/odoo#194444

Created by fw-bot
Merged at 67bf71dc4fd792224366499b66f527827471820a

Statuses:

label
odoo-dev:master-16.0-OPW-4076246-point_of_sale_deduct_change_from_cash_payments-kdeb-Wjcp-fw
head
c2b11573661c7033f3e2485d94b3c75eedc3ede7
merged
8 months ago by Bugfix, Kawtar Drissi El Bouzaidi (kdeb)
odoo/odoo
16.0 #187727
17.0 #194097
saas-17.2 #194282
saas-17.4 #194284
18.0 #194299
saas-18.1 #194437
saas-18.2
saas-18.3
saas-18.4
19.0
master #194444

[FW][FIX] point_of_sale: deduct change from cash payment

Issue:

when making a payment using 2 different payment methods (cash and bank), the change gets deducted from the bank payment not the cash payment in the invoice.

Steps To Reproduce:

On POS, for an order totaling $120.
- Add a customer and ensure the "Invoice" box is checked.
- pay using two payments methods bank 100$ Cash 50$
- the change is $30, everything looks fine on the ticket on the pos.
- Notice on the invoice on the db backend the $30 change is incorrectly deducted from the bank payment. As a result, the invoice displays: bank : $70 cash: $50

Soltution:
- In the _create_payment_moves method, ensure that cash payment method creates an account.move including the change amount.

opw-4076246


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #194299
Forward-Port-Of: #187727