This commit is contained in:
2026-01-26 17:32:33 +01:00
parent fbfc943301
commit 757b9f724d
5 changed files with 145 additions and 8 deletions

View File

@@ -92,6 +92,13 @@ class Uom(SymbolMixin, DigitsMixin, DeactivableMixin, ModelSQL, ModelView):
def default_digits():
return 2
@classmethod
def get_by_name(cls, name):
uom = cls.search([('symbol', '=', name)], limit=1)
if not uom:
return None
return uom[0]
@fields.depends('factor')
def on_change_factor(self):
if (self.factor or 0.0) == 0.0: