Commit Graph

74 Commits

Author SHA1 Message Date
OCA-git-bot
ca0ebb8030 Merge PR #1217 into 15.0
Signed-off-by pedrobaeza
2024-02-16 11:31:51 +00:00
Pedro M. Baeza
d3cc4ec28d [IMP] account_payment_order: No error on unknown payment method codes
Since v14, the tool for changing the target transfer account is to
create new payment methods, and put a method line in the journal with
such account.

Thus, there will be "fake" payment methods with no export handler
with the only goal of having a different target account.

Raising an error on such methods when finishing the payment order, forcing
to add custom code for returning (False, False), is too much, so better
to simply return that by default and don't block in these cases.

TT47723
2024-02-13 13:31:19 +01:00
Luc De Meyer
e080a84edf [FIX] payment order: fix compute_partner_bank_id
Fix _compute_partner_bank_id on account.move.line.
The bank account number of then invoice was not selected when a supplier has
multiple bank account numbers and there is no payment mode set on the
vendor bill. This PR corrects this issue.
2023-11-06 10:00:33 +01:00
Luc De Meyer
f591233751 [IMP]grouped invoices: " - ".join in stead of "-".join 2023-11-05 10:56:44 +01:00
Víctor Martínez
84282d211f [FIX] account_payment_order: Define the value of the communication field correctly
- Purchases: Ref field from invoice always.
- Sales: Payment_ref or ref field from invoice.

TT45153
2023-10-02 17:17:47 +02:00
Carlos Lopez
61d1711ff0 [FIX] account_payment_order: change result_payorder_ids to list to show action correctly 2023-09-04 08:57:57 +02:00
Pedro M. Baeza
f14ea80664 [FIX+IMP] account_payment_order: Better error messages on "Add to order"
- The filter for payment order lines should be applied after checking
  the lack of payment mode.
- Added message when the payment mode is not valid for payment orders.
- Added message specifying the payment order where the line is already
  present.

TT44762
2023-08-18 17:41:38 +02:00
Ethan Hildick
00cabc5236 [FIX] account_payment_order: incorrect inbound partial reconciliations
- Also added float_compare to avoid possible rounding issues
2023-07-31 15:51:53 +02:00
Danny W. Adair
9b25d3d3a2 [FIX] account_payment_order: Grouped partial reconcile
When using a mode with "Group Transactions in Payment Orders"
in a payment order with multiple bills from the same supplier,
if e.g. the first bill's payment amount is reduced, the
reduction was applied to the last bill instead of the specified one.
2023-07-31 15:51:46 +02:00
Víctor Martínez
4059b738f0 [IMP] account_payment_order: Add a custom message if the invoice does not have a payment method
The message will be displayed when trying to create a line of a payment order to better clarify the reason.

TT44551
2023-07-24 08:27:22 +02:00
Pedro M. Baeza
a87c68cdbb [FIX] account_payment_order: Set payment method line for account.payment
On v15+, a new model account.payment.method.line is introduced for
fine-graining the outstanding account, being `payment_method_id` a
related field referred to this new model, so we need to change the
previous approach to select the proper method line only if found. If not
found, it will be auto-selected by standard code.

TT43278
2023-05-11 20:44:13 +02:00
Simon Gonzalez
d5822ee1e7 [IMP] account_payment_order: Concatenate all UserError messages
Gather all the errors to only show one with all the problem on the current debit order. This will avoid for the users to have to make multiple time the same process.
2023-04-18 08:22:28 +02:00
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