-
-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] account_payment_partner: keep the default value for partner_bank_id #1418
base: 16.0
Are you sure you want to change the base?
Conversation
…k_id The Odoo default computation for partner_bank_id on customer invoices sets the first bank account of the company. The override in account_payment_partner resets it to false if there is no payment mode defined. Since for customer invoices we usually don't define a payment mode (unless when using direct debit), this partner_bank_id field is therefore emptied. This is problematic for instance when generating UBL invoices with the official Odoo module, because the bank account is mandatory to create a valid Peppol document.
This is a more focused fix for #1408 |
The idea behind the else part is for avoiding Odoo assigning a partner bank automatically, which does harm, as the payment/debit order auto-selection mechanism won't select the more suitable one, and you can see by the red CI that this is something intended. |
Yes, my module is based on the feature that an invoice does not have to have a bank account if it does not have a payment mode. If this is going to be merged, my test and my module will need a little refactor to edit the default bank account if there is not a payment mode. However, i think the best is waiting for the original v16 PR to be merged and resolve Pedro's comments |
@pedrobaeza IMO if someone wants to deactivate this assignation done by Odoo, which I can understand, I would suggest to add a setting (eg on the journal) so that the computation can rely on this setting to remove the automatically assigned value. Please consider payment mode can be installed on an instance where it's not used by all the companies, in that case, it shouldn't break default behaviours as is the case with this compute. @Tisho99 what do you think about adding such a setting? |
Please specify which is the issue in the Swiss localization for determining if there are options to solve it. |
At first glance, I think that adding a configuration option is a good idea. If the default operation is left as it is now (setting the bank account to false if there is no payment method), it will not be necessary to refectorize other modules, just activate the option with Swiss accounting. |
@pedrobaeza this is not only Swiss accounting. See the description of this issue. The default Odoo behaviour of selecting the company bank account on customer invoices is disabled, so various standard Odoo behaviours that depend on having the bank account populated do not work anymore. Peppol invoice generation is an example. Adding QR code to the invoices is another. My question is why it is necessary to disable the default Odoo behaviour when there is no payment mode. I could not determine that by reading the code and the tests. |
The Odoo default computation for partner_bank_id on customer invoices sets the first bank account of the company.
The override in account_payment_partner resets it to false if there is no payment mode defined.
Since for customer invoices we usually don't define a payment mode (unless when using direct debit), this partner_bank_id field is therefore emptied.
This is problematic for instance when generating UBL invoices with the official Odoo module, because the bank account is mandatory to create a valid Peppol document.
Therefore I propose to keep the default behaviour if there is no payment mode on the invoice.