Commit Graph

16 Commits

Author SHA1 Message Date
Víctor Martínez
41f75f1f00 [FIX] account_payment_purchase: Leave the partner_bank_id field empty in purchase invoice process
Example use case:
- Create a Supplier and set a bank account.
- Creating a purchase order with a Supplier Bank Account
- The payment method of the payment method must have the Bank Account Required box unchecked.
- Confirm the purchase order and create the invoice with the "Create Bill" button.
- The invoice must have the bank account empty.

TT46502
2024-06-28 17:04:00 +02:00
Pedro M. Baeza
e4d4c113e6 [FIX] account_payment_purchase: Don't propagate empty payment mode
Steps to reproduce the problem:

- Have a partner without payment mode.
- Create a PO with such partner.
- No payment mode is filled.
- Now fill the payment mode in the partner.
- Create the invoice for the PO.

Current behavior:

The invoice has empty payment mode.

Expected behavior:

The invoice has the partner payment mode. Someone may think that having
no payment mode in the PO may prevail over the partner's payment mode,
or even their flows may consist in empyting the payment mode in the PO
for not binding it with anything yet, but that strategy has more holes
than the one implemented here, as the flow presented proves.

You can then use another one like having an extra payment mode
"Undetermined" or similar for doing such classification as a more
resilient strategy.

It includes a regression test that fails before the change and now is
correct.

TT38608
2024-06-13 10:40:11 -05:00
Alexis de Lattre
4c3e829097 account_payment_purchase: replace api.onchange by computed field on purchase.order
Add check_company=True on the 2 fields of purchase.order
2023-11-06 22:43:36 +01:00
David Ramia
3094e7e25c [MIG] account_payment_purchase: Migration to 16.0 2023-06-01 11:26:57 +02:00
Vladimir Mitreski
6ab34e532b [FIX] account_payment_purchase: Make payment method to require bank account
Without this fix, the partner_bank_id was being reset to False on change of 'company_id'
in the _onchange_purchase_auto_complete method in account.move in the following unit test:
def test_from_purchase_order_invoicing_bank

That's because in commit 9be9766535 we switched to
getting payment method from env.ref('account.account_payment_method_manual_out'), which has
bank_account_required == False by default, while before that we were creating payment method for
which we were explicitly setting bank_account_required as True

Also tag unit test as post_install
2023-06-01 11:26:57 +02:00
Koen Loodts
ce5da9d7ef [MIG] account_payment_purchase: Migration to 15.0 2023-06-01 11:26:57 +02:00
Jordi Ballester
77a51dc034 [account_payment_purchase][fix] Only warn for non-blank payment mode or bank PO
- Only issue a warning message if the PO had a non-blank payment mode or bank.
2023-06-01 11:26:56 +02:00
Carlos Roca
ab2736c56a [MIG] account_payment_purchase: Migration to v14 2023-06-01 11:26:56 +02:00
Andrea
c450a8a8e2 Split account_payment_purchase (add account_payment_purchase_stock) 2023-06-01 11:26:55 +02:00
mreficent
b48955c943 [MIG] account_payment_purchase: Migration to 13.0 2023-06-01 11:26:55 +02:00
mreficent
9a66745752 [IMP] account_payment_purchase: black, isort 2023-06-01 11:26:55 +02:00
cubells
850663b898 account_payment_purchase: Migration to 11.0 2023-06-01 11:26:55 +02:00
Abranes
ec61427e4e account_payment_purchase: Migration to 10.0 2023-06-01 11:26:54 +02:00
cubells
090dc8440d account_payment_purchase module 2023-06-01 11:26:54 +02:00
Alexis de Lattre
b3c160823b Remove module account_payment_purchase 2023-06-01 11:26:54 +02:00
Pedro M. Baeza
6939b277fd account_payment_purchase: Propagate payment_mode on MTO/drop shipping 2023-06-01 11:26:53 +02:00