Commit Graph

136 Commits

Author SHA1 Message Date
Akim Juillerat
f79dca5010 account_payment_partner: Fix computation of partner_bank_id
The computation of partner_bank_id has not been migrated properly
since the move from account.invoice to account.move.

Before, we had an onchange on partner_id that did the following:
  - If no partner or no company, remove payment mode
    - If type = in_invoice, remove partner_bank_id as well
  - If partner and company,
    - If type = in_invoice, set payment mode from partner
      - if payment mode's payment method has bank account required,
        set the partner_bank_id to the commercial partner's bank
      - else set partner_bank_id to False
    - If type = out_invoice, set payment mode from partner and
      do not assign partner_bank_id

We also had an onchange on payment_mode_id that did the following:
  - If payment mode and its payment_type=outbound and its payment method
    has bank account required, set partner_bank_id to False
  - If no payment mode, set partner_bank_id to False

Now that partner_bank_id is a computed field, we shouldn't set its value
to False if the move is not a vendor bill or doesn't have a payment mode.

The computation of partner_bank_id must instead reflect the conditions we
used to have, that is:
  - If we don't have a payment_mode, set value to False
  - If we have a payment mode
    - If type=in_invoice and payment mode's payment method has not bank
      account required, set partner_bank_id to False (as setting the bank account
      from the partner is done in the call to super)
    - If type=out_invoice
      - if payment mode's payment method has bank account required
        - set partner_bank_id to the bank account linked to the fixed journal
          of payment mode if defined
        - do not set anything if that isn't the case since setting the bank account
          from the company is done in the call to super)
      - if payment mode's payment method does not have bank account required,
        set partner_bank_id to False

Closes: #1091
2023-11-22 22:13:18 +01:00
OCA-git-bot
a094cd0108 account_payment_partner 16.0.1.2.0 2023-11-22 22:13:18 +01:00
Rodrigo
32e6c6e125 [FIX] account_payment_partner: bad application of attributes on the field partner_bank_id, this commit fixes showing the same field twice in customer invoices. 2023-11-22 22:13:18 +01:00
gelo joga Rodríguez
5fe0e38208 Translated using Weblate (Spanish)
Currently translated at 100.0% (37 of 37 strings)

Translation: bank-payment-16.0/bank-payment-16.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_payment_partner/es/
2023-11-22 22:13:18 +01:00
OCA-git-bot
60eda6f545 account_payment_partner 16.0.1.1.1 2023-11-22 22:13:18 +01:00
Danny W. Adair
409e64d44c Add pre_init_hook to add computed columns
Add columns to avoid Memory error on an existing Odoo instance
with lots of data.

The payment_mode_id fields are introduced by this module and computed only
from each other or the also newly introduced supplier_payment_mode_id and
customer_payment_mode_id on res.partner, so they can stay NULL, nothing
to compute.
2023-11-22 22:13:18 +01:00
Weblate
c9a5f92ecb Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: bank-payment-16.0/bank-payment-16.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_payment_partner/
2023-11-22 22:13:18 +01:00
OCA-git-bot
b9991a6fec account_payment_partner 16.0.1.1.0 2023-11-22 22:13:18 +01:00
oca-ci
6fdfe8b085 [UPD] Update account_payment_partner.pot 2023-11-22 22:13:18 +01:00
Pedro M. Baeza
5e47c9dfb1 [IMP] account_payment_partner: Make payment mode editable on entry
Complement of 998f8df6aa254266c015fab144ba290e1a386cf0

Extend the editability to the journal entry (account.move), taking
as criteria if there's no reconciliation made, which is the definitory
one.

It includes test for this new feature, both the mode propagation and
the editability check.

TT39850
2023-11-22 22:13:18 +01:00
Pedro M. Baeza
9f5b540b53 [IMP] account_payment_partner: Make payment mode editable on journal item
This field was editable in previous version before invoice > move
refactoring, and it's logic to allow to change payment mode once the
invoice has been posted without the need of resetting it to draft.

Thus, the field has been changed to computed writable field, taking care
of the consequences at model level (compute) and view level (add the
field in views + proper attrs).

This commits adds tracking=True to the payment mode field as well to be
aware when and who the payment mode is changed in the invoice, no matter
if directly changed in draft, or through the change on the journal item.

TT39850
2023-11-22 22:13:18 +01:00
Bole
389fc51e07 Translated using Weblate (Croatian)
Currently translated at 94.7% (36 of 38 strings)

Translation: bank-payment-16.0/bank-payment-16.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_payment_partner/hr/
2023-11-22 22:13:18 +01:00
OCA-git-bot
15b15c0bc0 account_payment_partner 16.0.1.0.1 2023-11-22 22:13:18 +01:00
David Ramia
6acda8a431 [FIX] account_payment_partner: fix error in _reverse_moves 2023-11-22 22:13:18 +01:00
OCA-git-bot
be8e5d2f75 [UPD] README.rst 2023-11-22 22:13:18 +01:00
oca-ci
4d357f8d4e [UPD] Update account_payment_partner.pot 2023-11-22 22:13:18 +01:00
Thomas Binsfeld
e0e25d6542 [MIG] account_payment_partner: Migration to 16.0 2023-11-22 22:13:18 +01:00
OCA-git-bot
c5fc6d7069 account_payment_partner 15.0.1.2.0 2023-11-22 22:13:18 +01:00
Felipe
31bdfc3637 [FIX] company in payment_mode_id domain 2023-11-22 22:13:18 +01:00
João Marques
a79f957910 [FIX] account_payment_partner: Fix multi-company issues
Make payment_mode fields limited to the correct company

TT28906
2023-11-22 22:13:18 +01:00
OCA-git-bot
578ac5c04d account_payment_partner 15.0.1.1.2 2023-11-22 22:13:18 +01:00
David Ramia
07a952be63 [FIX] account_payment_partner: Fix tests
Add company permissions to the admin user to be able to create the demo data
2023-11-22 22:13:18 +01:00
OCA-git-bot
83756df53e account_payment_partner 15.0.1.1.1 2023-11-22 22:13:18 +01:00
OCA-git-bot
5ae29371bb [UPD] README.rst 2023-11-22 22:13:18 +01:00
Enric Tobella
c46ee4bc48 [IMP] account_payment_partner: Promote to Mature 2023-11-22 22:13:18 +01:00
Noel estudillo
f15a4d6cf7 Translated using Weblate (Catalan)
Currently translated at 100.0% (38 of 38 strings)

Translation: bank-payment-15.0/bank-payment-15.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-15-0/bank-payment-15-0-account_payment_partner/ca/
2023-11-22 22:13:18 +01:00
juliap98
aa5770c22b Translated using Weblate (Catalan)
Currently translated at 97.3% (37 of 38 strings)

Translation: bank-payment-15.0/bank-payment-15.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-15-0/bank-payment-15-0-account_payment_partner/ca/
2023-11-22 22:13:18 +01:00
OCA-git-bot
9706827372 account_payment_partner 15.0.1.1.0 2023-11-22 22:13:18 +01:00
Miquel Raïch
0a68b3ace5 [FIX] account_payment_partner: only use bank_account_required in bills 2023-11-22 22:13:18 +01:00
OCA-git-bot
aef563b15f [UPD] README.rst 2023-11-22 22:13:18 +01:00
oca-ci
e021d87a12 [UPD] Update account_payment_partner.pot 2023-11-22 22:13:18 +01:00
Marçal Isern
4c85747dfe [MIG] account_payment_partner: Migration to 15.0 2023-11-22 22:13:18 +01:00
Marçal Isern
a420a625f4 [IMP] account_payment_partner: black, isort, prettier 2023-11-22 22:13:18 +01:00
Simon S
44917b475f Translated using Weblate (Swedish)
Currently translated at 89.4% (34 of 38 strings)

Translation: bank-payment-14.0/bank-payment-14.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-0-account_payment_partner/sv/
2023-11-22 22:13:18 +01:00
Simon S
5629c520d5 Added translation using Weblate (Swedish) 2023-11-22 22:13:18 +01:00
Francesco Foresti
464389ffeb Translated using Weblate (Italian)
Currently translated at 2.6% (1 of 38 strings)

Translation: bank-payment-14.0/bank-payment-14.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-0-account_payment_partner/it/
2023-11-22 22:13:18 +01:00
Francesco Foresti
af1dfabc77 Added translation using Weblate (Italian) 2023-11-22 22:13:18 +01:00
Alexis de Lattre
eb1516bedc Update test suite
Fix bug in account_banking_mandate when a res.partner.bank is not attached to a particular company (company_id is NOT required on res.partner.bank)
2023-11-22 22:13:18 +01:00
Alexis de Lattre
dcca3d9b49 account_payment_partner: add optional="hide" on payment mode in invoice tree view 2023-11-22 22:13:18 +01:00
Pedro Castro Silva
b5532ffba5 Translated using Weblate (Portuguese)
Currently translated at 100.0% (38 of 38 strings)

Translation: bank-payment-14.0/bank-payment-14.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-0-account_payment_partner/pt/
2023-11-22 22:13:18 +01:00
Pedro Castro Silva
371668c074 Added translation using Weblate (Portuguese) 2023-11-22 22:13:18 +01:00
OCA-git-bot
13c5c22a76 account_payment_partner 14.0.1.3.1 2023-11-22 22:13:18 +01:00
Víctor Martínez
7ceeae0aeb [FIX] account_payment_partner: Set the correct value of payment_mode_id
instead of False

TT31904
2023-11-22 22:13:18 +01:00
Ignacio Buioli
aba4f0bf3c Translated using Weblate (Spanish (Argentina))
Currently translated at 100.0% (38 of 38 strings)

Translation: bank-payment-14.0/bank-payment-14.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-0-account_payment_partner/es_AR/
2023-11-22 22:13:18 +01:00
OCA Transbot
eb308907ee Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: bank-payment-14.0/bank-payment-14.0-account_payment_partner
Translate-URL: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-0-account_payment_partner/
2023-11-22 22:13:18 +01:00
OCA-git-bot
7e2be6f142 account_payment_partner 14.0.1.3.0 2023-11-22 22:13:18 +01:00
OCA-git-bot
73a39b8214 [UPD] README.rst 2023-11-22 22:13:18 +01:00
oca-travis
ce8f8a3564 [UPD] Update account_payment_partner.pot 2023-11-22 22:13:18 +01:00
Víctor Martínez
269eadc6cf [IMP] account_payment_partner: Add Payment mode to Invoices Analysis 2023-11-22 22:13:18 +01:00
OCA-git-bot
4039f4cf6e account_payment_partner 14.0.1.2.2 2023-11-22 22:13:18 +01:00