Commit Graph

436 Commits

Author SHA1 Message Date
Pedro M. Baeza
dc03f1070c [FIX] account_payment_order: Restrict payment lines button to payment group
If not, you get an access error when accessing the invoice if you
don't have such permission:

```
You are not allowed to access 'Payment Lines' (account.payment.line) records.

This operation is allowed for the following groups:
      - Extra Rights/Accounting / Payments

Contact your administrator to request access if necessary
```

TT45952
2024-02-26 22:06:46 +01:00
Luc De Meyer
a39adcf3e5 [IMP] account_payment_order: add payment lines smart button on invoice 2024-02-26 22:06:46 +01:00
Luc De Meyer
60dcc45383 [IMP]grouped invoices: " - ".join in stead of "-".join 2024-02-26 22:06:46 +01:00
Alexis de Lattre
9285446226 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.
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
faba2734a9 [IMP] account_payment_order: Add payment_ref field to account.payment tree and form views
Co-authored-by: luc-demeyer

TT45153
2024-02-26 22:06:45 +01:00
Víctor Martínez
0dc3f1c36f [FIX] account_payment_order: Add colspan=2 to a correct visualization 2024-02-26 22:06:45 +01:00
Víctor Martínez
a2dd94fdd4 [FIX] account_payment_order: Add extra form view only to avoid open move lines in edit mode
TT45211
2024-02-26 22:06:45 +01:00
Carlos Lopez
66868fa55a [FIX] account_payment_order: change result_payorder_ids to list to show action correctly 2024-02-26 22:06:45 +01:00
Pedro M. Baeza
f8043265ac [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
2024-02-26 22:06:45 +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
Yadier A. De Quesada
da438f025b [FIX] account_payment_order Allow to download file in edit mode 2024-02-26 22:06:45 +01:00
Pedro M. Baeza
fc3573739b [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
2024-02-26 22:06:45 +01:00
Pedro M. Baeza
f80f6a17e1 [FIX] account_payment_order: treet2 > street2 2024-02-26 22:06:45 +01:00
Nikul-OSI
1601945a83 [FIX] Fixed Payment Transaction view 2024-02-26 22:06:45 +01:00
Simon Gonzalez
867c8c030f [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.
2024-02-26 22:06:45 +01:00
Reyes4711
ad31eab5de [FIX] account_payment_order: create lines with same sequence name 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
Wolfgang Pichler
c34825a469 [I18N] account_payment_order: Better translations for de_DE 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
Alexis de Lattre
2be42df05e [IMP] account_payment_order: add link to payment order in chatter 2024-02-26 22:06:44 +01:00
Bert Driehuis
06ac42cdd4 [FIX] account_payment_order: Fallback to payment_ref if ref is undefined 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
Danny W. Adair
3a354feaee Add pre_init_hook to add computed column
Add partner_bank_id column to avoid MemoryError on an existing Odoo
instance with lots of data.

partner_bank_id on account.move.line requires payment_order_ok to be True
which it won't be as it's newly introduced - again nothing to compute.
(see AccountMoveLine._compute_partner_bank_id() in models/account_move_line.py)
2024-02-26 22:06:44 +01:00
Antony Herrera
5b260f8a5e [FIX] account_payment_order: Error in Batch Payments when deleting a Batch Content line 2024-02-26 22:06:44 +01:00
manu
9fe1a59e79 [IMP]account_payment_order: Add activities to account.payment.order model 2024-02-26 22:06:44 +01:00
Adrien Peiffer
6535e3e5c3 [FIX] Restore payment order number in account move line label. 2024-02-26 22:06:44 +01:00
Alexis de Lattre
018375d4f0 [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.
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
Enric Tobella
9327880094 [IMP] account_payment_order: Promote to Mature 2024-02-26 22:06:44 +01:00
Miquel Raïch
2011692951 [IMP] account_payment_order: don't requiere reference_type anymore 2024-02-26 22:06:44 +01:00
Alexis de Lattre
d066ad5b2b account_payment_order: communication required in form view 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
Miracle Ayodele
aa4074ae5e [FIX] account_payment_order: Bind report to model 2024-02-26 22:06:43 +01:00
AmmarOfficewalaSerpentCS
889a87e400 [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. 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
João Marques
5d9b6f501e [FIX] account_payment_order: Change security group category + Make post move field invisible in payment modes + fix account move views
- Change security group category
  Before this change, the group was creating a new section in each user's settings called "Other" with a field called "Other Extra Rights" that could select "Accounting / Payments" as an option
  This places it in the correct location
  TT29182
- Make post move field invisible in payment modes
  When the generate_moves option is not selected, the post_move option should not be available
  TT29182
- fix account move views
  Current spec was causing weird display in account move view, both for customer invoices and vendor bills
  Changing the placement and adding back the label fixes the issue
  TT29027
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
Pedro M. Baeza
27ff381ad6 [FIX] account_payment_order: Remove old migration scripts 2024-02-26 22:06:43 +01:00
Pedro M. Baeza
2c92f8ddae [FIX] account_payment_order: Computed non-stored fields needs always a value
We should assign a value for all records of the set.
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
Carlos Roca
f4de0562bc [MIG] account_payment_order: Migration to v14 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