Commit Graph

40 Commits

Author SHA1 Message Date
Miquel Alzanillas
4d46d09a4b [IMP] account_payment_partner: pre-commit auto fixes 2023-11-22 22:20:03 +01:00
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
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
David Ramia
6acda8a431 [FIX] account_payment_partner: fix error in _reverse_moves 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
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
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
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
JordiMForgeFlow
47802297c8 [14.0][FIX] account_payment_partner: pass invoice_partner_bank_id correctly on account move create 2023-11-22 22:13:18 +01:00
Carlos Dauden
7afd7b6f18 [FIX] account_payment_partner: _compute_invoice_partner_bank isn't executed
- When value is set from SO _prepare_invoice method
- When partner_id changes

TT30875
2023-11-22 22:13:18 +01:00
Víctor Martínez
0b62e5dd84 [IMP] account_payment_partner: Add refund_payment_mode_id to set in reverse moves (Adapt to 14.0) 2023-11-22 22:13:18 +01:00
Víctor Martínez
989de87103 [IMP] account_payment_partner: Add refund_payment_mode_id to assign any payment mode to set auto-compute in reverse moves (in_refund and out_refund) 2023-11-22 22:13:18 +01:00
Alexis de Lattre
bf0edfe419 account_payment_partner: FIX form view of account.move
Replace python constraint by check_company=True on payment_mode_id of account.move
2023-11-22 22:13:18 +01:00
Marçal Isern
b004ad80da [MIG] account_payment_partner: Migration to 14.0 2023-11-22 22:13:18 +01:00
Atchuthan Ubendran
614839b74c [FIX] account_payment_partner: payment_mode_id default not set for Refund 2023-11-22 22:13:18 +01:00
mreficent
e77a67f3ad [MIG] account_payment_purchase: Migration to 13.0 2023-11-22 22:13:18 +01:00
mreficent
1704e8ae8a [IMP] account_payment_purchase: black, isort 2023-11-22 22:13:18 +01:00
Raf Ven
6fb95bbd95 [MIG] account_payment_sale: Migration to 13.0 2023-11-22 22:13:18 +01:00
Raf Ven
c291c0f6fc [MIG] account_payment_partner: Migration to 13.0 2023-11-22 22:13:18 +01:00
Raf Ven
1ec4093c3a [IMP] account_payment_partner: black, isort 2023-11-22 22:13:18 +01:00
Guewen Baconnier
abcd792808 Add indexes on account payment models
The fields where the indexes are added are used in searches in
account_payment_order, which becomes really slow when a database have
many lines.
2023-11-22 22:13:18 +01:00
Pedro M. Baeza
50048895c9 [MIG] account_banking_pain_base: Migration to 12.0
* Standard migration procedure
* README by fragments
* Fixed tests
* Change
* Fix related no readonly in account_banking_pain_base
* Override default partner bank account check on account_payment_partner
* Convert Python date to string
2023-11-22 22:13:18 +01:00
Pedro M. Baeza
dd68f62db7 [MIG] account_payment_partner: Adapt tests + code to latest version 2023-11-22 22:13:18 +01:00
cubells
ab3c2f0cc5 [IMP] account_payment_partner: Add several tests 2023-11-22 22:13:18 +01:00
Carlos Dauden
b9ad9f3076 [FIX+IMP] account_payment_partner: Fix invoice bank account assignation + show it on invoice report
* IMP: Add options to show partner bank account on invoice report
* FIX: Don't auto-assign partner bank account due to problems when you have a direct debit payment
  method with bank_account_link = 'fixed'. Bank account is shown through new mechanism.
2023-11-22 22:13:18 +01:00
Adrien Peiffer (ACSONE)
b5fcacd2ca [CHG] account_payment_partner: Prevent to delete bank account linked on invoices. 2023-11-22 22:13:18 +01:00
Andrea
10ce669a9e [11.0][FIX] account_payment_partner: onchange if more than one bank 2023-11-22 22:13:18 +01:00
oihane
c4be6a810a [FIX] account_payment_partner: impossible to define if there was no company in partner (#438) 2023-11-22 22:13:18 +01:00
Jordi Ballester
450142073b add tests and small fixes 2023-11-22 22:13:18 +01:00
etobella
b0efca7955 [MIG] account_payment_partner 2023-11-22 22:13:18 +01:00
Pedro M. Baeza
d8358bb035 [IMP] account_payment_partner: Several things:
* Change copyright and author after company merging
* Fill payment mode in invoices if none is provided

  Using same method as in upstream, payment mode is filled on invoice creation if
  no payment method is provided. This way, we don't need to install
  account_payment_sale if we don't want to handle several payment modes at sales
  level. Even more, if we install the module later and we have already existing
  sales orders without payment mode filled, those orders will be invoiced with
  the customer payment mode.

* Signature changed in convert_to_write
2023-11-22 22:13:18 +01:00
Alexis de Lattre
9f682697ef Port almost all modules to v10 (#305)
Port almost all modules to v10

* Update to EPC Rulebook v9.2 that start to apply on 2016-11-20 (bug #300)
2023-11-22 22:13:18 +01:00
Alexis de Lattre
ae429549ce [MIG] account_payment_partner: Start to port bank-payment to v9 (with a lot of improvements) during the Sorrento Code sprint 2016
Improvements include:
- full re-organisation of modules and big re-organisation of the code
- simplification of the code related to the fact that support for direct debit is now in t
he base module, not added by an optional module account_direct_debit (module was removed)
- new design of the wizard to select move lines to pay
- support for non-SEPA file transfer-
- support for German direct debit SEPA files (fixes bug #129)
- remove workflow of payment.order
* Finalise the wizard of selection of move lines to pay
* Add button "Add to payment/debit order" on invoice form view
* Started to integrate payment transfer in account_payment_order (not finished at all though)
* Copy payment mode and mandate from invoice to refund
* Run dos2unix on the few files that had DOS carriage return
* Add _id suffix on M2O fields customer_payment_mode and supplier_payment_mode (Odoo did the same on all the M2O property fields of res.partner)
* Better handling of partner_bank_id and mandate_id on invoice: invisible/required/onchange
* Move field bank_account_required from module account_payment_partner to account_payment_mode
2023-11-22 22:13:18 +01:00
Pedro M. Baeza
75fa499e4e [IMP] account_payment_partner: Several things
* Short headers
* Remove label field

  There's already a field in the payment mode called 'note' that is
  printed on the invoices, so there's no need of another field for
  that purpose. This field is added by account_banking_payment_export

* Bump version numbers
* es translations
* Name to filter for better inheratiblity
2023-11-22 22:13:18 +01:00
Alexis de Lattre
bc636ae56f [FIX+IMP] account_payment_partner: Several things:
* Forgot to remove a usecase of debit_denied
* Add ACL
* Better filters on payment.order.create wizard
* Add default values for those filters on payment.mode
* FIX remove coma at end of line
* Add translatable 'label' field on payment.mode, designed to be used in invoice report
2023-11-22 22:13:18 +01:00
Alexis de Lattre
04fdd7f547 [IMP] account_payment_partner: Several things:
* move unused file + cleanup code
* Add sale_ok and purchase_ok filters in partner/sale/purchase form views
* Use widget=selection for payment_mode_id fields
* Update demo data
* Return res in inherit (even if res is empty in this case)
2023-11-22 22:13:18 +01:00
Pedro M. Baeza
e0fcc36ac9 [MIG] account_payment_partner: Migration to v8
* Migration and enhancement of all modules involved in SEPA
* Clean files
* Replace deprecated workflow calls
* Translation template files
* Translations to spanish
* Use sale_ok and purchase_ok instead of tweaking payment type
2023-11-22 22:13:18 +01:00