Commit Graph

68 Commits

Author SHA1 Message Date
Luc De Meyer
8faf8edf05 [IMP] account_payment_order: 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-06-09 22:10:17 +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
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
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
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
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
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
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
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
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
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
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
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
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
Andrea
61c2488a82 [FIX] avoid cache miss in compute 2024-02-26 22:06:43 +01:00
Valentin Vinagre Urteaga
68924e3bf5 [FIX] account_payment_order: set partner_bank_id + order generation from invoice tree + attachment file name
- fix set partner_bank_id in account move lines
  Case: The bank account isn't set properly in the payment order lines, because the bank account is only got from account.move.line or the first bank account in the partner_id, but never from the invoice (account.move).
  Solution: With this fix, the bank account will be get from account.move when matching the criteria.
-  fix payment orders from invoice tree view
  Case: User can't add invoices to payment/debit orders from the tree view but it's still possible to add them one by one from the form view.
  Solution: Remove binding_views="form": by default are "tree & form". With this fix, users can add payment/debit orders from the invoice tree view
- fix the attachment file name & dowload.
  Case: After the configuration of a debit order and generating the .xml file, user can't download it from the next step screen using the download link.
  Solution: This fix makes the .xml file downloadable from the .xml file name as it was in older versions
2024-02-26 22:06:42 +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
Carlos Dauden
cea2c57a1b [IMP] account_payment_order: Select first partner bank 2024-02-26 22:06:42 +01:00
Pedro M. Baeza
a7704a15d7 [FIX] account_payment_error: Avoid singleton error in allowed_journal_ids
Fixes #612
2024-02-26 22:06:42 +01:00
Guewen Baconnier
f3985b6e02 Add indexes on account payment models
The fields where the indexes are added are used in searches in
account_payment_order, which becomes really slow when a database have
many lines.
2024-02-26 22:06:42 +01:00
Thomas Binsfeld
7fc14c0139 [REF] Payment Order: move all move preparation code in _prepare_move 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
Pedro M. Baeza
98a19d7334 [FIX] account_payment_order: Fix journal domain
Steps to reproduce
------------------

* Create a payment mode with "Link to Bank Account" = "Variable".
* Select several journals.
* Create a payment order with that payment mode.
* Save.
* Go to other menu and come back to payment order.
* Try to select a journal: the list is empty.

Fixes #544
2024-02-26 22:06:41 +01:00
Thomas Binsfeld
447fab8fc0 [REF] Payment Order: better performance of draft2open method
Add a norecompute in draft2open to avoid the recomputation of total_company_currency n times (where n is the number of payment lines)
2024-02-26 22:06:41 +01:00
Pedro M. Baeza
7bb25d68f1 [MIG] account_banking_sepa_direct_debit: Finish migration to 12.0
* Fixed tests
* Adjust code for Python dates handling
* Update copyrights
2024-02-26 22:06:41 +01:00
Pedro M. Baeza
995a09e137 [MIG] account_payment_order: Finish migration to v12
* Removed deprecated YAML tests.
* Removed document dependency, as now there's no attachment dropdown.
* Switched deprecated `compute` method of res.currency.
* Restored missing field `reference_type` in invoices.
* Fixed call to `message_post`.
* Added missing description in model.
2024-02-26 22:06:41 +01:00
Martronic SA
52f7d45b1d Fix structured communication
Adds 'structured' to the invoice_reference_type2communication_type ans the 'structured' type is added by the module itself in account_invoice but breaks the account_move_line.py as explained here: https://github.com/OCA/bank-payment/issues/495
2024-02-26 22:06:41 +01:00
ecino
c530f74fa7 [IMP] account_payment_order: Use bank.payment.line reference in Payment Order Move Lines (#418) 2024-02-26 22:06:41 +01:00
Alexis de Lattre
ccaf009c82 Several small usability improvements
- when manually encoding a payment line, get company currency as default currency
- Search on payment order numbers
- Direct search on bank journal name in payment orders
- remove widget="selection" on account.payement.mode : this object is rarely modified, so widget='selection' is not a time saver, but we miss the HTML link, which can be pretty convenient to check the configuration.
2024-02-26 22:06:41 +01:00
Pedro M. Baeza
35901fe19a [FIX] account_payment_order: Take payment mode from move (#466)
When adding to a payment order from invoices, the payment mode
considered is the one in the invoice, but once you have confirmed it,
you can't change it, so if you change the payment mode in the journal
items, it doesn't make the difference.

With this change, this is taken into account for adding to the
payment order(s) properly.
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