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