Add columns to avoid MemoryError on an existing Odoo instance
with lots of data.
payment_order_ok on account.move is computed from payment_order_ok
on account.payment.mode which are both introduced by this module,
so nothing to compute.
(see AccountMove._compute_payment_order_ok() in models/account_move.py)
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)
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
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.
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.
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.
This fix makes the .xml file downloadable from the .xml file name as it was in older versions
When you haven't still generated the file, `generated_user_id` is not filled, and
so, you can't control the language in which the payment order is going to be printed.
Adding a condition for using the user language in that case makes this more
comfortable.