odoo/odoo#194437

Created by fw-bot
Merged at ec2f6f9e72f6325f7dfcac81b2ff2f6f5fac54ae

Statuses:

label
odoo-dev:saas-18.1-16.0-OPW-4076246-point_of_sale_deduct_change_from_cash_payments-kdeb-RxF4-fw
head
d30a4a1a3aea1d9e9df0ef1a77eeef6f607ed0fe
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