Commit Graph

67 Commits

Author SHA1 Message Date
Pedro M. Baeza
fbcf02fb85 [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.
2023-01-01 17:45:02 +01:00
Pedro M. Baeza
b8d818967b [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
2022-12-25 12:51:03 +01:00
Alexis de Lattre
a0cec2ad66 [IMP] account_payment_order: add link to payment order in chatter 2022-11-08 11:31:20 +01:00
manu
e5bcbb4842 [IMP]account_payment_order: Add activities to account.payment.order model 2022-10-24 17:24:36 +02:00
Adrien Peiffer
c12fe2ba46 [FIX] Restore payment order number in account move line label. 2022-09-26 11:21:17 +02:00
OCA-git-bot
c0f2f29ecd Merge PR #936 into 14.0
Signed-off-by pedrobaeza
2022-09-05 00:01:57 +00:00
Alexis de Lattre
a861023e01 [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-08-10 21:48:13 +02:00
Vandan-OSI
f03867a218 [FIX] FIX Code for None communication Value. 2022-06-29 15:26:02 +05:30
Denis Roussel
c4e2f64334 [14.0][FIX] account_payment_order: Don't duplicate communication reference 2022-04-22 14:14:53 +02:00
Denis Roussel
e346c66e4b [14.0][IMP] account_payment_order: 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
2022-04-19 11:50:52 +02:00
Denis Roussel
18495aaf03 [14.0][IMP] account_payment_order: Use the 'payment_reference' field if filled in 2022-04-14 13:40:43 +02:00
Denis Roussel
919928e98f [14.0][IMP] account_payment_order: Remove not needed assert as parameter is required 2022-04-14 11:20:59 +02:00
Denis Roussel
becc8ac426 [14.0][IMP] account_payment_order: 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.
2022-04-14 11:16:37 +02:00
Denis Roussel
da8e2da5bb [14.0][IMP] account_payment_order: Add a hook method to retrieve communication type and communication 2022-04-14 09:26:00 +02:00
Miquel Raïch
af433396ff [IMP] account_payment_order: don't requiere reference_type anymore 2022-03-08 15:35:00 +01:00
Alexis de Lattre
46d94511c9 account_payment_order: communication required in form view 2022-02-16 09:52:33 +01:00
Alexis de Lattre
e3b7c097a0 account_payment_order: payment_mode_id readonly when state != draft 2021-10-28 00:11:34 +02:00
Alexis de Lattre
ee56b631e4 FIX crash when communication=null on payment line 2021-10-28 00:11:34 +02:00
Alexis de Lattre
7fa38049be 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.
2021-10-28 00:11:34 +02:00
Alexis de Lattre
cbe1eed5ac 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
2021-10-28 00:11:12 +02:00
OCA-git-bot
9c73d05320 Merge PR #821 into 14.0
Signed-off-by pedrobaeza
2021-07-26 11:40:23 +00:00
AmmarOfficewalaSerpentCS
9e4fb17954 [IMP] account_payment_order: Pass single move in a get_account_payment_domain mehtod to find move in a method. 2021-07-09 13:49:35 +05:30
AmmarOfficewalaSerpentCS
1f4e943129 [IMP] account_payment_order: Add hook method for finding previous payment orders 2021-07-06 15:23:15 +05:30
manu
7bdb286aa1 [IMP]account_payment_order: payment date when adding transaction line 2021-06-02 15:58:42 +02:00
Benoit Aimont
1bf42d17a0 [13.0][IMP] account_payment_order - move date should be bank line date when offsetting_account is bank_account 2021-05-12 12:40:11 +02:00
Pedro M. Baeza
5ce95f4a84 [FIX] account_payment_order: Computed non-stored fields needs always a value
We should assign a value for all records of the set.
2021-04-15 20:43:30 +02:00
Carlos Roca
a7a5006ff4 [MIG] account_payment_order: Migration to v14 2021-01-05 14:17:34 +01:00
Jesús Alan Ramos Rodríguez
bd5c8b24ec [MIG] account_payment_order: Migration to 14.0 2021-01-05 14:03:52 +01:00
Andrea
5138c5ce2b [FIX] avoid cache miss in compute 2021-01-05 14:03:52 +01:00
Valentin Vinagre Urteaga
232b17b423 [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.
2021-01-05 14:03:52 +01:00
Raf Ven
369f18bbed [MIG] account_payment_order: Migration to 13.0 2021-01-05 14:03:52 +01:00
Raf Ven
001bd7e976 [IMP] account_payment_order: black, isort 2021-01-05 14:03:52 +01:00
Carlos Dauden
22390eded5 [IMP] account_payment_order: Select first partner bank 2021-01-05 14:03:52 +01:00
Pedro M. Baeza
5d79ac61a7 [FIX] account_payment_error: Avoid singleton error in allowed_journal_ids
Fixes #612
2021-01-05 14:03:52 +01:00
Guewen Baconnier
2769011d68 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.
2021-01-05 14:03:52 +01:00
Thomas Binsfeld
e46f096c0d [REF] Payment Order: move all move preparation code in _prepare_move 2021-01-05 14:03:52 +01:00
Thomas Binsfeld
d6c1472fec [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
2021-01-05 14:03:52 +01:00
Thomas Binsfeld
e6253b98ca [REF] Account Payment Order: split generate_move method 2021-01-05 14:03:52 +01:00
Thomas Binsfeld
703cee011d [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
2021-01-05 14:03:52 +01:00
Thomas Binsfeld
e4838106e6 [REF] Payment Order: allow add to order from invoice if order exists 2021-01-05 14:03:52 +01:00
Pedro M. Baeza
a497d69ac5 [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
2021-01-05 14:03:52 +01:00
Thomas Binsfeld
71d60d6d1d [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)
2021-01-05 14:03:52 +01:00
Pedro M. Baeza
04173ee973 [MIG] account_banking_sepa_direct_debit: Finish migration to 12.0
* Fixed tests
* Adjust code for Python dates handling
* Update copyrights
2021-01-05 14:03:52 +01:00
Pedro M. Baeza
f74e498e6e [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.
2021-01-05 14:03:52 +01:00
Martronic SA
bc0ca8c104 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
2021-01-05 14:03:52 +01:00
ecino
af235126cd [IMP] account_payment_order: Use bank.payment.line reference in Payment Order Move Lines (#418) 2021-01-05 14:03:52 +01:00
Alexis de Lattre
0896ab6227 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.
2021-01-05 14:03:52 +01:00
Pedro M. Baeza
e12ac64e44 [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.
2021-01-05 14:03:52 +01:00
Jordi Ballester
81152bf603 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.
2021-01-05 14:03:52 +01:00
etobella
a73310e854 [MIG] account_payment_order 2021-01-05 14:03:52 +01:00