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.
* company_id was empty because an onchange, not inheritance nor visibility
* Added multi-company group to company_id fields
* Added multi-company access rule to contract templates
* Fix double %% in XML dates that was causing an error
* When creating a contract, recurring_invoices is set by default
* Correct domain attribute in field journal_id
Original domain includes unknown value company_id. Throws error when selecting the journal.
* Corregidos errores detectados por Lint
* Refactoring, DRY
* [FIX] Add missing field company_id to account_analytic_contract
* Small refactoring for company_id field
* [FIX+IMP] contract: Improve usability and don't fail on wrong data
* Cron create invoices masked for avoiding silent errors
* New constraints for assuring data consistency
* UI helps for entering consistent data
* Spanish translation
* Remove double company_id field on form
**Be totally deterministic about which views to use**
Having a primary view that is not explicitly declared to be uses and w/o priority
makes Odoo to choose between one of them randomly (well, not exactly, but kind of),
so we put here which views to use.
I have also put tree view as primary and put a large priority for not being
selected on other actions that don't have this explicit views.
A friendly name in views is also assigned.
**Improvements in tests**
* Use SavepointCase for making the setup only once for all tests
* Make them inheritable, creating a base class with only the setup,
so that it can be inherited without the need of executing all tests
contained here each time you inherit it, and adding other class
in the same module that inherits from the base class that actually
performs the tests.
* Removed duplicated test method