[FIX] resource: enable changing company in working times

Currently when trying to change the company in the configuration of a working times, a traceback error occurs.

Steps to reproduce:
-------------------
* Select app ´Employees´
* Select ´Configuration´ -> ´Working Times´
* Select any
* Try changing the ´Company´ field

Why the fix:
------------
Result of [False, self.env.companies.ids]:
	[False, [1]]

opw-3634123

closes odoo/odoo#148344

X-original-commit: 85bc53984b97e98ab8fe2cf966e32c0146891a88
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Sarah Bellefroid (sbel) <sbel@odoo.com>
This commit is contained in:
sbel-odoo
2024-01-08 16:06:48 +00:00
parent a4335ab1e5
commit 101fef18ee
+1 -1
View File
@@ -80,7 +80,7 @@ class ResourceCalendar(models.Model):
active = fields.Boolean("Active", default=True,
help="If the active field is set to false, it will allow you to hide the Working Time without removing it.")
company_id = fields.Many2one(
'res.company', 'Company', domain=lambda self: [('id', 'in', [False, self.env.companies.ids])],
'res.company', 'Company', domain=lambda self: [('id', 'in', self.env.companies.ids)],
default=lambda self: self.env.company)
attendance_ids = fields.One2many(
'resource.calendar.attendance', 'calendar_id', 'Working Time',