Commit Graph

27 Commits

Author SHA1 Message Date
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
OCA-git-bot
7a87c77a1d Merge PR #919 into 14.0
Signed-off-by pedrobaeza
2022-04-24 10:01:12 +00:00
Pedro M. Baeza
0c179baafd [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:24:40 +02:00
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
16acbcd01a [14.0][IMP] account_payment_order: Set tests as post-install
Since 81aac30dd2
AccountTestInvoicingCommon should be tagged post-install
2022-04-14 14:29:23 +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
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
Pedro M. Baeza
556fe38491 [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.
2022-01-17 08:53:50 +01:00
Carlos Lopez
c8ceb4bf37 [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
2022-01-17 08:25:06 +01:00
Alexis de Lattre
b52edf3287 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)
2021-11-03 08:33:13 +01:00
João Marques
557e6ad1ab [FIX] account_payment_order: Fix multi-company issues in tests
Use base `account` tests from Odoo to avoid issues with the environment.
2021-09-14 13:39:58 +01:00
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
João Marques
23cdd52316 [FIX] account_payment_order: Fix tests
After fcaa54939e, we need to specify the invoice date for vendor bills to be able to post it
2021-04-14 13:32:26 +01:00
João Marques
0ca96bc789 [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
2021-03-31 11:28:16 +01:00
João Marques
1d93e34653 [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
2021-02-25 09:51:14 +00:00
Jesús Alan Ramos Rodríguez
bd5c8b24ec [MIG] account_payment_order: Migration to 14.0 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
Pedro M. Baeza
183efec307 [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.
2021-01-05 14:03:52 +01:00
Raf Ven
a8c3920627 [12.0] [FIX] Failing test test_account_payment_02 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
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
Pedro M. Baeza
3d8053902b [FIX] account_payment_order: Adapt test to v10 2021-01-05 14:03:52 +01:00
Akim Juillerat
d108422b93 [IMP] account_payment_order: Restriction + tests
* Restrict the deletion of bank payment line
* Add test_cancel_payment_order
2021-01-05 14:03:52 +01:00