diff --git a/addons/hr_timesheet/models/res_company.py b/addons/hr_timesheet/models/res_company.py index 0d890a77108..8d48a0e4bb1 100644 --- a/addons/hr_timesheet/models/res_company.py +++ b/addons/hr_timesheet/models/res_company.py @@ -10,27 +10,29 @@ class ResCompany(models.Model): @api.model def _default_project_time_mode_id(self): uom = self.env.ref('uom.product_uom_hour', raise_if_not_found=False) + wtime = self.env.ref('uom.uom_categ_wtime') if not uom: - uom = self.env['uom.uom'].search([('measure_type', '=', 'working_time'), ('uom_type', '=', 'reference')], limit=1) + uom = self.env['uom.uom'].search([('category_id', '=', wtime.id), ('uom_type', '=', 'reference')], limit=1) if not uom: - uom = self.env['uom.uom'].search([('measure_type', '=', 'working_time')], limit=1) + uom = self.env['uom.uom'].search([('category_id', '=', wtime.id)], limit=1) return uom @api.model def _default_timesheet_encode_uom_id(self): uom = self.env.ref('uom.product_uom_hour', raise_if_not_found=False) + wtime = self.env.ref('uom.uom_categ_wtime') if not uom: - uom = self.env['uom.uom'].search([('measure_type', '=', 'working_time'), ('uom_type', '=', 'reference')], limit=1) + uom = self.env['uom.uom'].search([('category_id', '=', wtime.id), ('uom_type', '=', 'reference')], limit=1) if not uom: - uom = self.env['uom.uom'].search([('measure_type', '=', 'working_time')], limit=1) + uom = self.env['uom.uom'].search([('category_id', '=', wtime.id)], limit=1) return uom - + project_time_mode_id = fields.Many2one('uom.uom', string='Project Time Unit', - default=_default_project_time_mode_id, domain=[('measure_type', '=', 'working_time')], + default=_default_project_time_mode_id, help="This will set the unit of measure used in projects and tasks.\n" "If you use the timesheet linked to projects, don't " "forget to setup the right unit of measure in your employees.") timesheet_encode_uom_id = fields.Many2one('uom.uom', string="Timesheet Encoding Unit", - default=_default_timesheet_encode_uom_id, domain=[('measure_type', '=', 'working_time')], required=True, + default=_default_timesheet_encode_uom_id, domain=lambda self: [('category_id', '=', self.env.ref('uom.uom_categ_wtime').id)], help="""This will set the unit of measure used to encode timesheet. This will simply provide tools and widgets to help the encoding. All reporting will still be expressed in hours (default value).""") diff --git a/addons/l10n_it_edi/data/invoice_it_template.xml b/addons/l10n_it_edi/data/invoice_it_template.xml index 3138e2c8e5a..12c318cc3aa 100644 --- a/addons/l10n_it_edi/data/invoice_it_template.xml +++ b/addons/l10n_it_edi/data/invoice_it_template.xml @@ -19,7 +19,7 @@ - + diff --git a/addons/mrp/report/mrp_production_templates.xml b/addons/mrp/report/mrp_production_templates.xml index de1dfe3d523..f8c2704f925 100644 --- a/addons/mrp/report/mrp_production_templates.xml +++ b/addons/mrp/report/mrp_production_templates.xml @@ -108,6 +108,7 @@