diff --git a/contract/models/account_analytic_contract.py b/contract/models/account_analytic_contract.py index 5749f650..295fe406 100644 --- a/contract/models/account_analytic_contract.py +++ b/contract/models/account_analytic_contract.py @@ -60,6 +60,12 @@ class AccountAnalyticContract(models.Model): default=lambda s: s._default_journal(), domain="[('type', '=', 'sale'),('company_id', '=', company_id)]", ) + company_id = fields.Many2one( + 'res.company', + string='Company', + required=True, + default=lambda self: self.env.user.company_id, + ) @api.model def _default_journal(self): @@ -69,3 +75,4 @@ class AccountAnalyticContract(models.Model): ('type', '=', 'sale'), ('company_id', '=', company_id)] return self.env['account.journal'].search(domain, limit=1) + diff --git a/contract/views/account_analytic_contract_view.xml b/contract/views/account_analytic_contract_view.xml index 23edd517..00da85fe 100644 --- a/contract/views/account_analytic_contract_view.xml +++ b/contract/views/account_analytic_contract_view.xml @@ -7,6 +7,7 @@
+