[MIG] contract: Migration to 15.0

Most changes are related to the switch from jinja to qweb in mail templates.

Also included:
- convert deprecated onchange that returns a domain and other deprecation warnings
  (see below)
- Add migration scripts from version 14.0 (force the update of the mail templates)
- Fix warnings from pre-commit checks

Fixes depreciation warnings:

- onchange method ContractAbstractContractLine._onchange_product_id returned
  a domain, this is deprecated
- SavepointCase is deprecated:
  https://github.com/odoo/odoo/blob/15.0/odoo/tests/common.py#L742
- assertDictContainsSubset: According to:
  https://stackoverflow.com/questions/20050913/python-unittests-assertdictcontainssubset-recommended-alternative
This commit is contained in:
Jean-Charles Drubay
2021-10-28 18:24:51 +07:00
parent 7537451d2f
commit 119b5b6700
19 changed files with 377 additions and 232 deletions

View File

@@ -47,7 +47,7 @@ class ContractRecurrencyBasicMixin(models.AbstractModel):
string="Invoice Every",
help="Invoice every (Days/Week/Month/Year)",
)
date_start = fields.Date(string="Date Start")
date_start = fields.Date()
recurring_next_date = fields.Date(string="Date of Next Invoice")
@api.depends("recurring_invoicing_type", "recurring_rule_type")
@@ -80,7 +80,7 @@ class ContractRecurrencyMixin(models.AbstractModel):
recurring_next_date = fields.Date(
compute="_compute_recurring_next_date", store=True, readonly=False, copy=True
)
date_end = fields.Date(string="Date End", index=True)
date_end = fields.Date(index=True)
next_period_date_start = fields.Date(
string="Next Period Start",
compute="_compute_next_period_date_start",
@@ -89,9 +89,7 @@ class ContractRecurrencyMixin(models.AbstractModel):
string="Next Period End",
compute="_compute_next_period_date_end",
)
last_date_invoiced = fields.Date(
string="Last Date Invoiced", readonly=True, copy=False
)
last_date_invoiced = fields.Date(readonly=True, copy=False)
@api.depends("next_period_date_start")
def _compute_recurring_next_date(self):