Make it public because it is the core logic of the module.
Also, clarify that recurring_invoicing_type
and recurring_invoicing_offset are needed only when
we want the next period to be computed from a
user chosen next invoice date.
monthlylastday is (almost) not a special case anymore \o/.
montlylastday is simply a montly period where the
periods are aligned on month boundaries.
The last bit of special casing is that postpaid generates
invoice the day after the last dasy of the period, except
for monthlylastday where the invoice is generated on the
last day of the period. This last exception will disappear
when we put the offset under user control.
This is a breaking change because the post-paid/pre-paid
mode becomes relevant for monthlylastday invoicing.
The field becomes visible in the UI. Code that generate
monthlylastday contract lines must now correctly set
the pre-paid/post-paid mode too. Some tests have had
to be adapted to reflect that.
get_relative_delta now works the same for all recurring rules.
Move the special case handling to _init_last_date_invoiced
which is used only for migration.
Using that approach (that is the current one in core) has a lot of side effects and
performance bottlenecks. You can read odoo/odoo#40156 for summarizing them.
This also improves the handling of the values of payment term an fiscal position
for using the partner ones if not set.
* Remove incorrect oldname attributes.
* Add filter on partners for running contracts (+ a support o2m field for that).
* Cover more tables in model renaming + cleaner code using a loop.
* Don't copy contract lines, but rename table + copy contract records on pre.
* Contract code is now populated to "Reference/Description" field in invoice.
* Order on new contract model has been restored to the same as old analytic accounts.
[RMV] - Remove empty file
[IMP] - Update no_update cron after migration
[IMP] - move contract template recurrence info to line level
[FIX] - Fix contract line model description
[IMP] - Link contracts to analytic accounts
[FIX] - Fix pylint
[IMP] - Move chatter and attachments from analytic account to contract
[IMP] - Move account_analytic_id to contract line level
[IMP] - Improve version check in migration script
[IMP] - Move contracts followers from analytic accounts
[ADD] - Add mail.activity.mixin to contract.contract model
remove data drop from migration scripts
[12.0][FIX] - Fix _init_last_date_invoiced
fix flake8
[ADD] - Update contributors list
[REF] Contract Sale Invoicing: update translations
[IMP] - Assert that the predecessor is available for new link at uncancel
[RMV] - remove usless changes
[RMV] - Remove usless field recurring_invoices
after the total isolation between contract model and account analytic one.
recurring_invoices which was used to mark analytic account as contract became usless
[IMP] - P3 syntax
[IMP] - use @openupgrade.migrate() and openupgrade.logged_query
[IMP] - drop transient table in migration script
[FIX] - Fix stop post message
[FIX] - Fix sale_contract_count should count all partner contract
[FIX] - set recurring_next_date to False if contract line stoped at last date invoiced
[FIX] - Group by next_invoice also considers dates in the past
[REF] - refactoring for compute_first_date_end
[RMV] - remove auto_renew_rule_type option monthlylastday
[IMP] - rename manual_renew_needed label
[IMP] - use get_product_multiline_description_sale to get contract line description