Skip to content
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

account_payment_partner: partner_bank_id should not be set to False if payment_mode is not set #1290

Open
PNurm opened this issue Jun 13, 2024 · 7 comments
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.

Comments

@PNurm
Copy link

PNurm commented Jun 13, 2024

Module

account_payment_partner

Describe the bug

This module as of 16.0 overrides the default behavior, and previous behavior of this module in 14.0.

  • Invoices without payment_mode_id are created without a partner_bank_id

  • When creating a sales invoice through sales order without a payment_mode_id, it will create invoice without partner_bank_id. This module overrides _compute_partner_bank_id and changes the behavior so if payment_mode_id is not set, it will not assign partner_bank_id.

  • From users point of view and from configuration standpoint, users should not be forced to configure a otherwise useless payment_mode_id and set that by hand on sales order. For a lot of our customers, payment_mode_id is never used for sales, and mostly used for bills and payment orders. For sales it is unnecessary step to fill out just to get bank account to compute properly.

To Reproduce

Affected versions:
16.0

Steps to reproduce the behavior:

  1. Create sales order without setting payment_mode_id
  2. Create invoice from sales order, it will not have bank account, therefore printing invoice will not have necessary payment related information.

Expected behavior

  • partner_bank_id should still be computed regardless if payment_mode_id is undefined.

Additional context
Add any other context about the problem here. (e.g. OS, Python version, ...)

@PNurm PNurm added the bug label Jun 13, 2024
Copy link

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 15, 2024
@remi-filament
Copy link
Contributor

Thanks @PNurm for reporting this. I also find it weird that we reset the bank account on invoice when this module is installed for move without payment_mode_id.

There is probably a good reason for this but I cannot find which one ?

Using account_edi module with Factur-x/XRechnung CII 2.2.0 enabled, if you do not have a partner_bank_id on invoice, you get an banner stating that bank_partner_id is required for this EDI format.
Also, since odoo/odoo@7c3e5e9 on v16 (same applies to v15+), partner_bank_id is used on invoice report to show bank account on which payment is expected.

Resetting the field to False in most cases as it is currently done in this module forces the users to configure the proper account on each invoice, when in most of the cases there is only one (either the one from company / partner if no payment_mode_id selected, or the one from account_journal if payment_mode is selected).

Maybe @alexis-via @pedrobaeza @victoralmau or @grindtildeath can clarify why it is needed to reset partner_bank_id to False ?

@remi-filament
Copy link
Contributor

Maybe it is expected that default Manual payment mode is created and used everywhere instead of None ?

@pedrobaeza
Copy link
Member

We reset it for being sure the code in account_payment_partner that shows the bank account numbers works. It's also for making sure the correct bank account is selected in the moment the payment order is done.

Imagine this situation: you do an invoice, and "fix" one bank account. Before doing the payment order, the partner tells you that they change bank account. Having it fixed, you have to modify all the invoices. With this method, the new one is automatically selected as soon as you swap the order in the partner form.

@remi-filament
Copy link
Contributor

Thanks @pedrobaeza, I understand it makes sense when using a payment order, however, it breaks the default way Odoo is working when not using payment_mode (and expecting manual payment from customer).

Also, it probably makes more sense for supplier bill that Odoo user needs to pay to a specific account, but in the case of customer invoice, the partner_bank_id is normally set with the bank account from your own company (and is not changing every other morning).

Do you think it would be acceptable to overwrite partner_bank_id only if payment_mode_id is selected (and leave it as calculated by Odoo if no payment_mode_id is selected) ?
I could propose a PR for that.

Thanks !

@pedrobaeza
Copy link
Member

It's also valid for only invoices, as this way, all the possible bank accounts that you have when you select to show them in the invoice on the payment mode configuration are shown.

So my answer is no to change this.

@remi-filament
Copy link
Contributor

I am afraid I do not understand your rationale, this module is clearly breaking defaut Odoo behaviour that user may want to keep when not using automated payment.

I do not think that partner_bank_id is the proper field on customer invoice to store information about what will be used in payment_order, in case your customer wants to change their source bank account before you issue the order, you should update it on payment order directly, not on invoice on which corresponding mandate is already fixed and cannot be modified neither...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

No branches or pull requests

3 participants