[IMP] resource: show only company's calendars

To avoid any misconfiguration, only the current companies' calendars are
shown and not all the resource.calendar.

task-3254874

closes odoo/odoo#117663

Related: odoo/enterprise#39311
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Kevin Baptiste
2023-04-13 15:26:21 +02:00
parent d2cb4fffb1
commit de7d7a71ea
2 changed files with 2 additions and 1 deletions
+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',
'res.company', 'Company', domain=lambda self: [('id', 'in', [False, self.env.companies.ids])],
default=lambda self: self.env.company)
attendance_ids = fields.One2many(
'resource.calendar.attendance', 'calendar_id', 'Working Time',
@@ -73,6 +73,7 @@
<field name="name">Working Times</field>
<field name="res_model">resource.calendar</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('company_id', '=', False), ('company_id', 'in', allowed_company_ids)]</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_resource_calendar_search"/>
<field name="help" type="html">