Commit Graph

62 Commits

Author SHA1 Message Date
Pedro M. Baeza
25533267f4 [OU-ADD] account_payment_order: Migration scripts to native payment ref
This adapts the old bank.payment.line records to account.payment records
according the new approach, taking into account if you come from v14
with the refactoring applied.
2023-03-04 19:25:27 +01:00
Pedro M. Baeza
e3d9930b04 [REF+IMP] account_payment_order: Use native payments
The previous approach creates manually the journal entries and does all
the hard work, plus not being 100% compatible with the bank statement
reconciliation widget (requiring a patch on OCB to see blue lines).

That decision made sense on the moment it was done (v9), where the
native payment model (account.payment) was very limited, and wasn't able
to store all the needed information for the bank transaction.

Now that the limitations are gone, we can get rid off this extra model,
and generate instead `account.payment` records, using both the native
model + methods to perform the same operations.

This serves also to workaround the problem found in #966.

All the code, views and tests of main module have been adapted to this
new approach in this commit. Later commits will adapt the rest of the
modules of the suite, and add migration scripts to transit from the
previous approach to this new one.

TT39832
2023-03-04 18:56:37 +01:00
Alexis de Lattre
676a9429f8 [IMP] account_payment_order: add link to payment order in chatter 2023-03-04 12:41:01 +01:00
Denis Roussel
eedc6300b5 [IMP] account_payment_order: Better communication field management
- Add a hook method to retrieve communication type and communication
- Improve normal communication if there is a credit note
  If there is a credit note that partially cancel an invoice, the payment communication
  should be the combination of the invoice reference and the credit note one.
- Remove not needed assert as parameter is required
- Use the 'payment_reference' field if filled in
- Add existing payment references to communication
  If some movements have been reconciled with the original invoice,
  their references should be added in communication too.
  e.g.: Manual credit notes
- Don't duplicate communication reference
2023-03-04 12:41:01 +01:00
Antony Herrera
f8398a527b [FIX] account_payment_order: Error in Batch Payments when deleting a Batch Content line 2022-12-14 22:59:13 -04:00
OCA-git-bot
d5ec7c2975 Merge PR #976 into 15.0
Signed-off-by pedrobaeza
2022-11-17 11:42:33 +00:00
manu
adb729a997 [IMP]account_payment_order: Add activities to account.payment.order model 2022-10-27 11:14:03 +02:00
Adrien Peiffer
6c5dc419ec [FIX] Restore payment order number in account move line label. 2022-09-26 16:27:47 +02:00
Alexis de Lattre
62d7e977b6 [FIX] account_payment_order: fix action returned by create_account_payment_line()
create_account_payment_line() is supposed to returned a form view for a
single payment order and a tree view for multiple payment orders. Before
this fix, it would return a tree view if you were payment more than 1
invoices while generating a single payment order, because the list
result_payorder_ids would contain several time the same ID.
2022-09-21 08:07:00 +02:00
Miquel Raïch
bc46ef19e6 [IMP] account_payment_order: don't requiere reference_type anymore 2022-03-10 12:01:36 +01:00
Alexis de Lattre
907024dec0 account_payment_order: communication required in form view 2022-03-10 09:34:36 +01:00
Marçal Isern
169ee94b17 [MIG] account_payment_order: Migration to 15.0 2022-03-10 00:03:41 +01:00
Alexis de Lattre
fd1ec5ab85 account_payment_order: payment_mode_id readonly when state != draft 2022-03-09 17:58:47 +01:00
Alexis de Lattre
74bed02f0e FIX crash when communication=null on payment line 2022-03-09 17:58:47 +01:00
Alexis de Lattre
6b5859b8bc account_payment_order: remove done state (migration script provided)
Don't set reference_type field on account.move required=True, because it
causes a lot of problems in other modules that don't depend on this one.
Setting it as required in the view is enough.
2022-03-09 17:58:47 +01:00
Alexis de Lattre
74dd1adc3e Improve computation of sepa on account.payment.order: check IBAN is in SEPA zone
Update move line generation to get transfer account from bank journal
Update payment mode configuration accordingly (3 fields removed)
Several improvements in payment order tree and form view
2022-03-09 17:58:47 +01:00
AmmarOfficewalaSerpentCS
3a60f4d1ab [IMP] account_payment_order: Pass single move in a get_account_payment_domain mehtod to find move in a method. 2022-03-09 17:58:47 +01:00
AmmarOfficewalaSerpentCS
24e4ffc760 [IMP] account_payment_order: Add hook method for finding previous payment orders 2022-03-09 17:58:47 +01:00
manu
ec0e1c5f64 [IMP]account_payment_order: payment date when adding transaction line 2022-03-09 17:58:47 +01:00
Benoit Aimont
97af20520f [13.0][IMP] account_payment_order - move date should be bank line date when offsetting_account is bank_account 2022-03-09 17:58:47 +01:00
Pedro M. Baeza
5bb5b02f01 [FIX] account_payment_order: Computed non-stored fields needs always a value
We should assign a value for all records of the set.
2022-03-09 17:58:47 +01:00
Carlos Roca
a5b1cdbe50 [MIG] account_payment_order: Migration to v14 2022-03-09 17:58:47 +01:00
Jesús Alan Ramos Rodríguez
6d486d8b93 [MIG] account_payment_order: Migration to 14.0 2022-03-09 17:58:47 +01:00
Andrea
d7e72114e6 [FIX] avoid cache miss in compute 2022-03-09 17:58:47 +01:00
Valentin Vinagre Urteaga
ad66139589 [FIX] account_payment_order: fix set partner_bank_id in account move lines
Case:
The bank account isn't set properly in the payment order lines, because the bank account is only got from account.move.line or the first bank account in the partner_id, but never from the invoice (account.move).

Solution:
With this fix, the bank account will be get from account.move when matching the criteria.
2022-03-09 17:58:47 +01:00
Raf Ven
10a529c859 [MIG] account_payment_order: Migration to 13.0 2022-03-09 17:58:47 +01:00
Raf Ven
4f076b21f4 [IMP] account_payment_order: black, isort 2022-03-09 17:58:47 +01:00
Carlos Dauden
46245a3288 [IMP] account_payment_order: Select first partner bank 2022-03-09 17:58:47 +01:00
Pedro M. Baeza
de31571676 [FIX] account_payment_error: Avoid singleton error in allowed_journal_ids
Fixes #612
2022-03-09 17:58:47 +01:00
Guewen Baconnier
6d862e3e71 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.
2022-03-09 17:58:47 +01:00
Thomas Binsfeld
a78917fa89 [REF] Payment Order: move all move preparation code in _prepare_move 2022-03-09 17:58:47 +01:00
Thomas Binsfeld
257289dfb2 [ADD] Payment Order: only payment order option on payment methods
New option on payment methods: payment order only (unchecked by default) allowing to enforce the use of payment orders for some payment methods
2022-03-09 17:58:47 +01:00
Thomas Binsfeld
ec160255a8 [REF] Account Payment Order: split generate_move method 2022-03-09 17:58:47 +01:00
Thomas Binsfeld
1ad7003dd1 [REF] Payment Order: payment line creation from move line
Benefits of the batch creation of Odoo 12.0
The method returns the created payment lines
2022-03-09 17:58:47 +01:00
Thomas Binsfeld
cdacd28064 [REF] Payment Order: allow add to order from invoice if order exists 2022-03-09 17:58:47 +01:00
Pedro M. Baeza
e652a4a6ac [FIX] account_payment_order: Fix journal domain
Steps to reproduce
------------------

* Create a payment mode with "Link to Bank Account" = "Variable".
* Select several journals.
* Create a payment order with that payment mode.
* Save.
* Go to other menu and come back to payment order.
* Try to select a journal: the list is empty.

Fixes #544
2022-03-09 17:58:47 +01:00
Thomas Binsfeld
660a461697 [REF] Payment Order: better performance of draft2open method
Add a norecompute in draft2open to avoid the recomputation of total_company_currency n times (where n is the number of payment lines)
2022-03-09 17:58:47 +01:00
Pedro M. Baeza
43e2876e76 [MIG] account_banking_sepa_direct_debit: Finish migration to 12.0
* Fixed tests
* Adjust code for Python dates handling
* Update copyrights
2022-03-09 17:58:47 +01:00
Pedro M. Baeza
82d1cade74 [MIG] account_payment_order: Finish migration to v12
* Removed deprecated YAML tests.
* Removed document dependency, as now there's no attachment dropdown.
* Switched deprecated `compute` method of res.currency.
* Restored missing field `reference_type` in invoices.
* Fixed call to `message_post`.
* Added missing description in model.
2022-03-09 17:58:47 +01:00
Martronic SA
105d3d080f Fix structured communication
Adds 'structured' to the invoice_reference_type2communication_type ans the 'structured' type is added by the module itself in account_invoice but breaks the account_move_line.py as explained here: https://github.com/OCA/bank-payment/issues/495
2022-03-09 17:58:47 +01:00
ecino
c1a9f672f5 [IMP] account_payment_order: Use bank.payment.line reference in Payment Order Move Lines (#418) 2022-03-09 17:58:47 +01:00
Alexis de Lattre
dde0542196 Several small usability improvements
- when manually encoding a payment line, get company currency as default currency
- Search on payment order numbers
- Direct search on bank journal name in payment orders
- remove widget="selection" on account.payement.mode : this object is rarely modified, so widget='selection' is not a time saver, but we miss the HTML link, which can be pretty convenient to check the configuration.
2022-03-09 17:58:47 +01:00
Pedro M. Baeza
34c82d0c2d [FIX] account_payment_order: Take payment mode from move (#466)
When adding to a payment order from invoices, the payment mode
considered is the one in the invoice, but once you have confirmed it,
you can't change it, so if you change the payment mode in the journal
items, it doesn't make the difference.

With this change, this is taken into account for adding to the
payment order(s) properly.
2022-03-09 17:58:47 +01:00
Jordi Ballester
664efc93c5 When the user looks for open payables or receivables, in the
context of payment orders, she should ocus on the amount that
is due to be paid. In this method we are forcing to display both
the amount due in company and in the invoice currency.

We then hide the fields debit and credit, because they add no value.
2022-03-09 17:58:47 +01:00
etobella
4cc8a3aa8e [MIG] account_payment_order 2022-03-09 17:58:47 +01:00
Gilles Meyomesse (ACSONE)
75b0e49949 [ADD] report for payment order (#370) 2022-03-09 17:58:47 +01:00
gilles
01ffe7e665 [ADD] description field for payment order 2022-03-09 17:58:47 +01:00
Akim Juillerat
85bb5853a4 [10.0]Fix payment method onchange with multicompany (#374) 2022-03-09 17:58:47 +01:00
Adrien Peiffer (ACSONE)
acbf3aac29 [IMP] account_payment_order: select partner bank account automatically. 2022-03-09 17:58:47 +01:00
Akim Juillerat
04df6fa875 [IMP] account_payment_order: Restriction + tests
* Restrict the deletion of bank payment line
* Add test_cancel_payment_order
2022-03-09 17:58:47 +01:00