Commit Graph

24 Commits

Author SHA1 Message Date
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
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
Pedro M. Baeza
784c6b9e61 [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.
2023-03-04 12:29:16 +01:00
Carlos Lopez
3bc92b0f10 [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
2023-03-04 12:29:16 +01:00
David Ramia
46ab40f75f [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
2022-07-06 21:35:00 +02:00
Pedro M. Baeza
715da8fd19 [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.
2022-04-23 10:33:21 +02:00
Marçal Isern
169ee94b17 [MIG] account_payment_order: Migration to 15.0 2022-03-10 00:03:41 +01:00
Alexis de Lattre
48db1b15ae Update test suite
Fix bug in account_banking_mandate when a res.partner.bank is not attached to a particular company (company_id is NOT required on res.partner.bank)
2022-03-09 17:58:47 +01:00
João Marques
a4c4005b47 [FIX] account_payment_order: Fix multi-company issues in tests
Use base `account` tests from Odoo to avoid issues with the environment.
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
João Marques
a9abd87729 [FIX] account_payment_order: Fix tests
After fcaa54939e, we need to specify the invoice date for vendor bills to be able to post it
2022-03-09 17:58:47 +01:00
João Marques
1af183d413 [FIX] account_payment_order: Fix tests
Don't use taxes in invoices to avoid inconsistency across localization settings
Create account instead of relying on environment
2022-03-09 17:58:47 +01:00
João Marques
f41cf5516d [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
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
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
Pedro M. Baeza
071fb9f9ce [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.
2022-03-09 17:58:47 +01:00
Raf Ven
2cb49e4bf4 [12.0] [FIX] Failing test test_account_payment_02 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
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
Pedro M. Baeza
f447d5ce25 [FIX] account_payment_order: Adapt test to v10 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