Browse Source

[FIX] analytic invoice/contract lines inheritance

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)
pull/238/head
Dmytro Katyukha 7 years ago
committed by sbejaoui
parent
commit
c229566c96
  1. 4
      contract_variable_quantity/models/contract.py

4
contract_variable_quantity/models/contract.py

@ -45,8 +45,8 @@ class AccountAnalyticAccount(models.Model):
return vals return vals
class AccountAnalyticInvoiceLine(models.Model):
_inherit = 'account.analytic.invoice.line'
class AccountAnalyticContractLine(models.Model):
_inherit = 'account.analytic.contract.line'
qty_type = fields.Selection( qty_type = fields.Selection(
selection=[ selection=[

Loading…
Cancel
Save