Commit Graph

85 Commits

Author SHA1 Message Date
OCA-git-bot
f82cd63e28 Merge PR #1346 into 16.0
Signed-off-by pedrobaeza
2024-09-16 08:32:54 +00:00
Graeme Gellatly
9ffd86f0af [FIX] account_payment_order: Correct payment date 2024-09-13 09:10:37 +12:00
OCA-git-bot
5e627305ad Merge PR #1333 into 16.0
Signed-off-by adrienpeiffer
2024-09-12 15:43:51 +00:00
Pedro M. Baeza
7768143563 [FIX] account_payment_order: Assure partner bank account in payments
On certain v16 instances, although the partner bank account that is
being pre-set in the account.payment creation values dictionary:

https://github.com/OCA/bank-payment/blob/fc7783669f40d85/account_payment_order/models/account_payment_line.py#L206

it's being marked as dirty (it's a computed writable field), and thus,
being recomputed before being saved, getting an invalid value (on
direct debits, the company's bank account).

The triggers that lead to this situation are unknown due to the low
level where it's happening and the tons of interactions being taken in
place, so the best way to deal with this is to override the compute
method that computes this value, so even if the field is recomputed, it
gets the correct value.

Let's be pragmatic...

TT50804
2024-09-11 20:44:09 +02:00
Stéphane Bidoul
a3aed62583 [FIX] account_payment_order: allow multiple payment lines without move line 2024-08-27 22:13:16 +02:00
Stéphane Bidoul
bd88cecd2f [IMP] account_payment_order: add button to view business document
Quick access to business document on payment lines.
2024-08-17 12:45:14 +02:00
Stéphane Bidoul
a8319e3ce5 [FIX] account_payment_order: use payment_reference if present for out payments
When a payment reference (field `payment_reference`) is provided on the vendor bill, it should be used in priority over the vendor bill number (field `ref`).

One reason is that the `ref` field is different for each invoice of the same supplier (it is used in Odoo's standard duplicate warning),
but the payment reference maybe the same for all payments to the
same supplier. For instance some suppliers request that the customer
id is used on the payment communication and it is the same on
all their invoices.

Another reason is that some supplier use a structured payment communication scheme, and that one only makes sense in
the payment_reference field.
2024-08-17 12:27:28 +02:00
OCA-git-bot
b96fcf12c1 Merge PR #1315 into 16.0
Signed-off-by pedrobaeza
2024-07-16 08:37:02 +00:00
sbejaoui
2b75096e78 [FIX] account_payment_order: add missing option "structured" to payment line ref type
The payment line reference type takes its value from the invoice reference
type, and both fields must have the same options.
The missing option "structured" causes a bug during payment creation.

the test is modified to be able to reproduce the problem.
2024-07-15 09:23:07 +02:00
Víctor Martínez
a8867f4062 [IMP] account_payment_order*: Define the correct date in the files that are generated.
Compatibility with https://github.com/OCA/bank-payment/pull/1304

The payment (account.payment) and the account entry (account.move) are defined with today's date,
but the "important" date is the date of the line, therefore the payment_line_date field is created.

The modules account_banking_sepa_sepa_direct_debit + account_banking_sepa_credit_transfer
to use the payment_line_date field.

TT49988
2024-07-10 16:33:03 +02:00
Víctor Martínez
337f6bf370 [IMP] account_payment_order: Add Transfer moves dates
In v13 the existing behavior was defined with today's date the Transfer Move, therefore, we define
that behavior by default without configuration since it is the expected behavior.

https://github.com/OCA/bank-payment/pull/805/files

TT49582
2024-07-01 08:34:40 +02:00
Pedro M. Baeza
73872800c3 [IMP] account_payment_order: Mark invoices in a payment order as in payment
Odoo core already includes a mechanism, only activated in enterprise,
to mark invoices reconciled against a payment as "In payment", not as
"Paid", and then when the bank reconciliation is done, passed to "Paid".

As we already refactored the payment order transfer entries generation
to be done by payments, the only missing bits is to override the method
that returns the payment state to put.

We have limited this new payment state though to those invoices that
are part of a payment order, not all including those which were paid
pressing the button "Register payment", as that's out of the scope
of this module.

TT49386
2024-05-28 14:08:02 +02:00
Alejandro Ji Cheung
bff6d34936 [IMP] account_payment_order: adds restriction for duplicated move lines in payment order 2024-04-24 08:56:00 +02:00
Luc De Meyer
d05aba74c2 [IMP] update payment reference on open payment order
This commits adds the possibility to update the payment reference on a
payment transaction before generating XML file.
2024-04-20 09:33:04 +02:00
Luc De Meyer
7c7fbfa999 [FIX]account_payment_order transfer journal
The transfer journal functionality has been broken by commit
65a19492a8

This fix adds transfer journal support to this constraint.
2024-04-15 00:03:26 +02:00
Luc De Meyer
73d857295f [IMP] integrate transfer journal option into account_payment_order 2024-04-14 19:52:49 +02:00
Víctor Martínez
ef05873365 [IMP] account_payment_order: Display a message with the archived bank accounts
TT47789
2024-03-01 17:36:52 +01:00
Pedro M. Baeza
ca9135e361 [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-16 17:21:43 +01:00
OCA-git-bot
0a3854e22b Merge PR #1169 into 16.0
Signed-off-by pedrobaeza
2024-01-30 08:13:34 +00:00
Víctor Martínez
f2b050b093 [FIX] account_payment_order: Always return a string in the _get_payment_order_order_communication_direct() method.
Related to: https://github.com/OCA/bank-payment/issues/1178
2023-11-27 09:21:04 +01:00
Luc De Meyer
0137e46889 [IMP] account_payment_order: add payment lines smart button on invoice 2023-11-09 19:59:22 +01:00
Luc De Meyer
dc39f0c3ff [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:12:33 +01:00
Luc De Meyer
7edd69ca78 [IMP]grouped invoices: " - ".join in stead of "-".join 2023-11-05 11:10:21 +01:00
Alexis de Lattre
e287dda966 Add warning when payment order is not SEPA
The field 'sepa' on account.payment.order is only display for SEPA
payment methods.
If the option "show warning if not SEPA" is enabled on the payment
method, a warning banner is now displayed on payment orders with a SEPA
payment method which are not SEPA.
2023-11-03 23:38:57 +01:00
Víctor Martínez
0757fe89ab [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-03 13:51:31 +02:00
Carlos Lopez
7817d7c13d [FIX] account_payment_order: change result_payorder_ids to list to show action correctly 2023-09-04 09:06:27 +02:00
Pedro M. Baeza
38a41a9d85 [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-21 13:29:22 +02:00
Víctor Martínez
bd445ec935 [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 15:57:54 +02:00
Pedro M. Baeza
fcb2093e63 [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-12 19:46:09 +02:00
Simon Gonzalez
b4a46bebef [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:32:39 +02:00
Reyes4711
594a3e4fa6 [FIX] account_payment_order: create lines with same sequence name 2023-04-06 12:53:43 +02:00
Wolfgang Pichler
0c98de15fa [MIG] account_payment_order: Migration to 16.0 2023-03-04 20:54:01 +01:00
Pedro M. Baeza
05c6c0111f [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 19:44:00 +01:00
Alexis de Lattre
6eb7ad01e3 [IMP] account_payment_order: add link to payment order in chatter 2023-03-04 19:44:00 +01:00
Denis Roussel
f3eca92554 [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 19:44:00 +01:00
Antony Herrera
610cd5e4f7 [FIX] account_payment_order: Error in Batch Payments when deleting a Batch Content line 2023-03-04 19:44:00 +01:00
manu
8dd5a31124 [IMP]account_payment_order: Add activities to account.payment.order model 2023-03-04 19:44:00 +01:00
Adrien Peiffer
38c56c5c61 [FIX] Restore payment order number in account move line label. 2023-03-04 19:44:00 +01:00
Alexis de Lattre
b0b48a204d [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.
2023-03-04 19:44:00 +01:00
Miquel Raïch
62ca0b90f8 [IMP] account_payment_order: don't requiere reference_type anymore 2023-03-04 19:44:00 +01:00
Alexis de Lattre
7e7ebe1c75 account_payment_order: communication required in form view 2023-03-04 19:44:00 +01:00
Marçal Isern
ad9f376b29 [MIG] account_payment_order: Migration to 15.0 2023-03-04 19:44:00 +01:00
Alexis de Lattre
dc8dd37f0e [IMP] account_payment_order: computation of sepa + remove done state + UI adjustments
- 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
- 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.
- add optional="hide" on payment mode in invoice tree view
- FIX crash when communication=null on payment line
- payment_mode_id readonly when state != draft
2023-03-04 19:44:00 +01:00
AmmarOfficewalaSerpentCS
a597822f2c [IMP] account_payment_order: Add hook method for finding previous payment orders + Pass single move in a get_account_payment_domain mehtod to find move in a method. 2023-03-04 19:43:51 +01:00
manu
d49f95cb95 [IMP]account_payment_order: payment date when adding transaction line 2023-03-04 19:43:51 +01:00
Benoit Aimont
3c11cf2aab [13.0][IMP] account_payment_order - move date should be bank line date when offsetting_account is bank_account 2023-03-04 19:42:52 +01:00
Pedro M. Baeza
320be4a4c7 [FIX] account_payment_order: Computed non-stored fields needs always a value
We should assign a value for all records of the set.
2023-03-04 19:42:52 +01:00
Carlos Roca
16274598ac [MIG] account_payment_order: Migration to v14 2023-03-04 19:42:47 +01:00
Jesús Alan Ramos Rodríguez
c65a93af5b [MIG] account_payment_order: Migration to 14.0 2023-03-04 19:42:47 +01:00
Andrea
28a35012b0 [FIX] avoid cache miss in compute 2023-03-04 19:42:47 +01:00