diff --git a/hr_multi_company/models/hr_multi_company.py b/hr_multi_company/models/hr_multi_company.py index 38f98e2a..b7c5c17d 100755 --- a/hr_multi_company/models/hr_multi_company.py +++ b/hr_multi_company/models/hr_multi_company.py @@ -27,14 +27,14 @@ class HrAttendanceMultiCompany(models.Model): _inherit = 'hr.attendance' company_id = fields.Many2one('res.company', 'Company', copy=False, readonly=True, help="Company", - default=lambda self: self.env.user.company_id) + default=lambda self: self.env.company) class HrLeaveMultiCompany(models.Model): _inherit = 'hr.leave' company_id = fields.Many2one('res.company', 'Company', copy=False, readonly=True, help="Company", - default=lambda self: self.env.user.company_id.id) + default=lambda self: self.env.company) @api.onchange('name') def dfgb(self): print(self.env.user.company_id) @@ -47,11 +47,11 @@ class HrPayslipMultiCompany(models.Model): _inherit = 'hr.payslip.run' company_id = fields.Many2one('res.company', 'Company', copy=False, readonly=True, help="Company", - default=lambda self: self.env.user.company_id) + default=lambda self: self.env.company) class HrSalaryCategoryMultiCompany(models.Model): _inherit = 'hr.salary.rule.category' company_id = fields.Many2one('res.company', 'Company', copy=False, readonly=True, help="Comapny", - default=lambda self: self.env.user.company_id) + default=lambda self: self.env.company)