diff --git a/contract/models/account_analytic_contract_line.py b/contract/models/account_analytic_contract_line.py index a18d5dbd..9328178c 100644 --- a/contract/models/account_analytic_contract_line.py +++ b/contract/models/account_analytic_contract_line.py @@ -4,14 +4,13 @@ from odoo import fields, models -class AccountAnalyticContractLine(models.Model): - _name = 'account.analytic.contract.line' - _description = 'Contract Lines' - _inherit = 'account.analytic.invoice.line' +class AccountAnalyticInvoiceLine(models.Model): + _name = 'account.analytic.invoice.line' + _inherit = 'account.analytic.contract.line' analytic_account_id = fields.Many2one( - string='Contract', - comodel_name='account.analytic.contract', + 'account.analytic.account', + string='Analytic Account', required=True, ondelete='cascade', ) diff --git a/contract/models/account_analytic_invoice_line.py b/contract/models/account_analytic_invoice_line.py index 8f547aaf..5eff76aa 100644 --- a/contract/models/account_analytic_invoice_line.py +++ b/contract/models/account_analytic_invoice_line.py @@ -14,8 +14,9 @@ from odoo.exceptions import ValidationError from odoo.tools.translate import _ -class AccountAnalyticInvoiceLine(models.Model): - _name = 'account.analytic.invoice.line' +class AccountAnalyticContractLine(models.Model): + _name = 'account.analytic.contract.line' + _description = 'Contract Lines' _order = "sequence,id" product_id = fields.Many2one( @@ -24,8 +25,8 @@ class AccountAnalyticInvoiceLine(models.Model): required=True, ) analytic_account_id = fields.Many2one( - 'account.analytic.account', - string='Analytic Account', + string='Contract', + comodel_name='account.analytic.contract', required=True, ondelete='cascade', ) diff --git a/contract_variable_quantity/models/contract.py b/contract_variable_quantity/models/contract.py index 1d25df93..dff047a4 100644 --- a/contract_variable_quantity/models/contract.py +++ b/contract_variable_quantity/models/contract.py @@ -45,8 +45,8 @@ class AccountAnalyticAccount(models.Model): return vals -class AccountAnalyticInvoiceLine(models.Model): - _inherit = 'account.analytic.invoice.line' +class AccountAnalyticContractLine(models.Model): + _inherit = 'account.analytic.contract.line' qty_type = fields.Selection( selection=[