Debian Codegraph @

addons/hr_timesheet/models/uom_uom.py

raw
1 # -*- coding: utf-8 -*-
2 # Part of Odoo. See LICENSE file for full copyright and licensing details.
3
4 from odoo import fields, models
5
6
7 class UomUom(models.Model):
8 _inherit = 'uom.uom'
9
10 def _unprotected_uom_xml_ids(self):
11 # Override
12 # When timesheet App is installed, we also need to protect the hour UoM
13 # from deletion (and warn in case of modification)
14 return [
15 "product_uom_dozen",
16 "product_uom_pack_6",
17 ]
18
19 # widget used in the webclient when this unit is the one used to encode timesheets.
20 timesheet_widget = fields.Char("Widget", export_string_translation=False)