From 87639119e4969bddceebe125fb89130f9073b0ad Mon Sep 17 00:00:00 2001 From: sinergia Date: Mon, 27 Jun 2022 14:41:57 -0500 Subject: [PATCH] add domain in measurements --- measurements.py | 7 ++++++- uom.xml | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/measurements.py b/measurements.py index c746d7d..7ca7359 100644 --- a/measurements.py +++ b/measurements.py @@ -2,20 +2,25 @@ # this repository contains the full copyright notices and license terms. from trytond.model import fields from trytond.pool import PoolMeta +from trytond.pyson import Id class Measurements(metaclass=PoolMeta): __name__ = 'product.template' temperature = fields.Float("Temperature") - temperature_uom = fields.Many2One('product.uom', "Temperature UOM") + temperature_uom = fields.Many2One('product.uom', 'Temperature UOM', + domain=[('category', '=', Id('product', "uom_cat_temperature"))]) frequency = fields.Float("Frequency") frequency_uom = fields.Many2One('product.uom', "Frequency UOM") + # ,domain = [('category', '=', Id('product', 'uom_cat_frequency'))]) wet = fields.Float("Wet") wet_uom = fields.Many2One('product.uom', "Wet UOM") voltageAC = fields.Float("Voltage AC") voltageAC_uom = fields.Many2One('product.uom', "Voltage AC UOM") + #,domain = [('category', '=', Id('product', 'uom_cat_electrical_tension'))]) voltageDC = fields.Float("Voltage DC") voltageDC_uom = fields.Many2One('product.uom', "Voltage DC UOM") + #,domain = [('category', '=', Id('product', 'uom_cat_electrical_tension'))]) diff --git a/uom.xml b/uom.xml index 0d241cc..21786b1 100644 --- a/uom.xml +++ b/uom.xml @@ -27,13 +27,43 @@ this repository contains the full copyright notices and license terms. --> - + Frequency Hertz Hrz - + + + + + + + + Temperature + + + Celsius + °C + + + + + + + + Fahrenheit + °F + + + + + + + + Kelvin + °K +