Files
odoo_source/addons/resource/models
Audric Onockx (auon) 62a7c0cee1 [FIX] resource: copy default company and calendar
Prior to this fix, when a ResourceMixin was copied
and a `company_id` set in its default values,
it was not taken into account, because
ResourceMixin.copy_data first copied self.resource_id
without default values, then set the company of it
into the default values for its own copy.
Same went with `resource_calendar_id`,
just copying the calendar of its resource.

With this fix, if present, we first set these two values
in the Resource default values (`company_id` and `calendar_id`)
and only then copy them in the ResourceMixin default values
(as `company_id` and `resource_calendar_id`).

closes odoo/odoo#93823

Related: odoo/enterprise#28490
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-16 19:16:45 +02:00
..