Bug description
---------------
`account.analytic.contract.line` inherits
`account.analytic.invoice.line`
`account.analytic.invoice.line` defines field `analytic_account_id`:
- comodel='account.analytic.account'
`account.analytic.contract.line` redefines field `analytic_account_id`:
- comodel='account.analytic.contract'
On attempt to extend `account.analytic.invoice.line` model adding
field that depends on `analytic_account_id.date_start`
Odoo fails to update, because it adds this field to
`account.analytic.contract.line` through inheritance,
and `account.analytic.contract` model have no this field.
What is done
------------
Change inheritance order:
- `account.analytic.invoice.line` inherits
`account.analytic.contract.line`
- no file renames at this stage (this wil be done in next commit)
If you have contract lines with automatic price and your pricelist
contains different prices per quantity, the price is not changed
when computing quantity.
This PR fixes this.
=================================================
Variable quantity in contract recurrent invoicing
=================================================
With this module, you will be able to define in recurring contracts some
lines with variable quantity according a provided formula.
Configuration
=============
* Go to Sales > Configuration > Contracts > Formulas (quantity).
* Define any formula based on Python code that stores at some moment a
float/integer value of the quantity to invoice in the variable 'result'.
You can use these variables to compute your formula:
* *env*: Environment variable for getting other models.
* *context*: Current context dictionary.
* *user*: Current user.
* *line*: Contract recurring invoice line that triggers this formula.
* *contract*: Contract whose line belongs to.
* *invoice*: Invoice (header) being created.
Usage
=====
To use this module, you need to:
* Go to Sales -> Contracts and select or create a new contract.
* Check *Generate recurring invoices automatically*.
* Add a new recurring invoicing line.
* Select "Variable quantity" in column "Qty. type".
* Select one of the possible formulas to use (previously created).
* 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