Commit Graph

31 Commits

Author SHA1 Message Date
David Ramia
814b2ec324 [FIX][17.0] Fix dynamic domain
Return domain on onchange is deprecated in v17
Created computed Binary field to store domain
2024-04-10 20:39:50 +02:00
David Ramia
1f9fb94511 [MIG] account_payment_order: Migration to 17.0 2024-02-28 20:59:50 +01:00
David Ramia
eb14ae21c7 [IMP] account_payment_order: pre-commit auto fixes 2024-02-26 22:06:46 +01:00
Víctor Martínez
d882d8e690 [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
2024-02-26 22:06:46 +01:00
Víctor Martínez
fca73ec341 [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
2024-02-26 22:06:46 +01:00
Víctor Martínez
8667d74eed [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
2024-02-26 22:06:45 +01:00
Wolfgang Pichler
c255abb1b3 [MIG] account_payment_order: Migration to 16.0 2024-02-26 22:06:45 +01:00
Pedro M. Baeza
d0c1c61ccc [FIX] account_payment_order: Do correctly the fix on tests
Previous patch by Alexis created a co-dependency between
account_payment_order and account_banking_sepa_direct_debit, which is
not correct.

This patch avoids such problem and fix properly the test, although
the utility of some of them is debatible.
2024-02-26 22:06:44 +01:00
Pedro M. Baeza
342d898c8b [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
2024-02-26 22:06:44 +01:00
Denis Roussel
bbb10e3d8f [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
2024-02-26 22:06:44 +01:00
Pedro M. Baeza
6da1bb5040 [FIX] account_payment_order: Proper indentation for test + make it work
The test introduced in 7bdb286aa1 is not
valid, as its indentation made it to not be executed. Anyways, the
content and the tested things are also not correct.
2024-02-26 22:06:44 +01:00
Carlos Lopez
f7166e96e0 [IMP] account_payment_order: outbound inheritable + SavepointCase
This commit split the tests for outbound payment in a base inheritable class that
can be reused in other dependant modules, and the test of this module.

similar to 86bd1a2525
2024-02-26 22:06:44 +01:00
David Ramia
e74aa0dd04 [FIX] account_payment_order: Fix tests
Some tests need to be run on post-install
The bank_journal.inbound_payment_order_only field is true only if all inbound_payment_method_ids are payment_order_only True. For this we must include the "SEPA Direct Debit for customers" in test
2024-02-26 22:06:44 +01:00
Pedro M. Baeza
238ecd4932 [FIX] account_payment_order: Don't fail due to tz
When the test hour is around midnight, and demo data using CET/CEST
timezones, current code fails due to some asserts not having this into
consideration. This fix avoids such problem, and irons the execution
no matter the hour.
2024-02-26 22:06:44 +01:00
Marçal Isern
70f7c9dfed [MIG] account_payment_order: Migration to 15.0 2024-02-26 22:06:44 +01:00
Alexis de Lattre
22ab93155e [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
2024-02-26 22:06:44 +01:00
João Marques
b3f7294c95 [FIX] account_payment_order: Fix multi-company issues in tests
Use base `account` tests from Odoo to avoid issues with the environment.
2024-02-26 22:06:43 +01:00
manu
3b3c1ebb58 [IMP]account_payment_order: payment date when adding transaction line 2024-02-26 22:06:43 +01:00
Benoit Aimont
622edf640f [13.0][IMP] account_payment_order - move date should be bank line date when offsetting_account is bank_account 2024-02-26 22:06:43 +01:00
João Marques
4e95a4f842 [FIX] account_payment_order: Fix tests
After fcaa54939e, we need to specify the invoice date for vendor bills to be able to post it
2024-02-26 22:06:43 +01:00
João Marques
1a195aa55d [FIX] account_payment_order: Fix tests
On multi-company settings, we need to make sure we are searching and creating objects with the correct company associated.

TT28423
2024-02-26 22:06:43 +01:00
Jesús Alan Ramos Rodríguez
0fade4d4ab [MIG] account_payment_order: Migration to 14.0 2024-02-26 22:06:43 +01:00
Raf Ven
91d53e6d08 [MIG] account_payment_order: Migration to 13.0 2024-02-26 22:06:42 +01:00
Raf Ven
c0ab186d6a [IMP] account_payment_order: black, isort 2024-02-26 22:06:42 +01:00
Pedro M. Baeza
d2350550a0 [FIX+IMP] account_payment_order: Make tests resilient + inbound inheritable + SavepointCase
Previous tests did several risk operations on tests, like performing an unbound search
on payment orders, what can lead to errors if there are some data on DB (or for example
we add in the future some payment orders in demo.

This commit also split the tests for inbound payment in a base inheritable class that
can be reused in other dependant modules, and the test of this module.

Finally, we use SavepointCase for improving performance in tests.
2024-02-26 22:06:42 +01:00
Raf Ven
271a43a42a [12.0] [FIX] Failing test test_account_payment_02 2024-02-26 22:06:42 +01:00
Thomas Binsfeld
f210639941 [REF+IMP] account_payment_order: invoice addition + move generation + restrict payment modes selection on orders
- allow add to order from invoice if order exists
- payment line creation from move line
  Benefits of the batch creation of Odoo 12.0
  The method returns the created payment lines
- split generate_move method
- 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
2024-02-26 22:06:41 +01:00
Jordi Ballester
6c1eb20bbf 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.
2024-02-26 22:06:40 +01:00
etobella
47e7e895f6 [MIG] account_payment_order 2024-02-26 22:06:40 +01:00
Pedro M. Baeza
d22e00068a [FIX] account_payment_order: Adapt test to v10 2024-02-26 22:06:40 +01:00
Akim Juillerat
e1352c972d [IMP] account_payment_order: Restriction + tests
* Restrict the deletion of bank payment line
* Add test_cancel_payment_order
2024-02-26 22:06:40 +01:00