diff --git a/modules/account_invoice/invoice.py b/modules/account_invoice/invoice.py index 45de5ce051..1f61bbe2c7 100644 --- a/modules/account_invoice/invoice.py +++ b/modules/account_invoice/invoice.py @@ -2082,7 +2082,9 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin): }, depends={'company'}) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', 'Product Uom Category'), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') account = fields.Many2One('account.account', 'Account', ondelete='RESTRICT', diff --git a/modules/account_invoice_secondary_unit/account.py b/modules/account_invoice_secondary_unit/account.py index 9e9b33a87c..a9dc9d49b3 100644 --- a/modules/account_invoice_secondary_unit/account.py +++ b/modules/account_invoice_secondary_unit/account.py @@ -40,7 +40,8 @@ class InvoiceLine(metaclass=PoolMeta): product_secondary_uom_category = fields.Function( fields.Many2One( - 'product.uom.category', "Product Secondary UOM Category"), + 'product.uom.category', "Product Secondary UoM Category", + help="The category of secondary Unit of Measure for the product."), 'get_product_secondary_uom_category') @fields.depends('quantity', 'unit', 'secondary_unit', 'origin') diff --git a/modules/carrier_weight/carrier.py b/modules/carrier_weight/carrier.py index ab02f630b6..29cf7f3928 100644 --- a/modules/carrier_weight/carrier.py +++ b/modules/carrier_weight/carrier.py @@ -11,15 +11,16 @@ from trytond.transaction import Transaction class Carrier(metaclass=PoolMeta): __name__ = 'carrier' - weight_uom = fields.Many2One('product.uom', 'Weight Uom', + weight_uom = fields.Many2One( + 'product.uom', "Weight UoM", domain=[('category', '=', Id('product', 'uom_cat_weight'))], states={ 'invisible': Eval('carrier_cost_method') != 'weight', 'required': Eval('carrier_cost_method') == 'weight', 'readonly': Bool(Eval('weight_price_list', [])), }, - help="The unit of weight criteria of the price list.") - weight_uom_digits = fields.Function(fields.Integer('Weight Uom Digits'), + help="The Unit of Measure of weight criteria for the price list.") + weight_uom_digits = fields.Function(fields.Integer("Weight UoM Digits"), 'on_change_with_weight_uom_digits') weight_currency = fields.Many2One('currency.currency', 'Currency', states={ diff --git a/modules/customs/customs.py b/modules/customs/customs.py index 20f58f1979..0ed0323746 100644 --- a/modules/customs/customs.py +++ b/modules/customs/customs.py @@ -179,11 +179,13 @@ class DutyRate(CountryMatchMixin, ModelSQL, ModelView): 'required': Eval('computation_type').in_(['amount', 'quantity']), 'invisible': ~Eval('computation_type').in_(['amount', 'quantity']), }) - uom = fields.Many2One('product.uom', 'Uom', + uom = fields.Many2One( + 'product.uom', "UoM", states={ 'required': Eval('computation_type') == 'quantity', 'invisible': Eval('computation_type') != 'quantity', - }) + }, + help="The Unit of Measure.") @classmethod def __setup__(cls): diff --git a/modules/product/message.xml b/modules/product/message.xml index 340ec37af8..3546fcea27 100644 --- a/modules/product/message.xml +++ b/modules/product/message.xml @@ -4,22 +4,22 @@ this repository contains the full copyright notices and license terms. --> - You cannot modify the factor of UOM "%(uom)s". + You cannot modify the factor of the unit of measure "%(uom)s". - You cannot modify the rate of UOM "%(uom)s". + You cannot modify the rate of the unit of measure"%(uom)s". - You cannot modify the category of UOM "%(uom)s". + You cannot modify the category of the unit of measure "%(uom)s". - You cannot decrease the digits of UOM "%(uom)s". + You cannot decrease the digits of the unit of measure "%(uom)s". - If the UOM is still not used, you can delete it otherwise you can deactivate it and create a new one. + If the unit of measure is still not used, you can delete it otherwise you can deactivate it and create a new one. - Incompatible factor and rate values on UOM "%(uom)s". + Incompatible factor and rate values on unit of measure"%(uom)s". Rate and factor can not be both equal to zero. diff --git a/modules/product/product.py b/modules/product/product.py index 2976d70600..b952ae9662 100644 --- a/modules/product/product.py +++ b/modules/product/product.py @@ -93,12 +93,15 @@ class Template( help="The method used to calculate the cost price.")) cost_price_methods = fields.One2Many( 'product.cost_price_method', 'template', "Cost Price Methods") - default_uom = fields.Many2One('product.uom', "Default UOM", required=True, - help="The standard unit of measure for the product.\n" + default_uom = fields.Many2One( + 'product.uom', "Default UoM", required=True, + help="The standard Unit of Measure for the product.\n" "Used internally when calculating the stock levels of goods " "and assets.") default_uom_category = fields.Function( - fields.Many2One('product.uom.category', 'Default UOM Category'), + fields.Many2One( + 'product.uom.category', "Default UoM Category", + help="The category of the default Unit of Measure."), 'on_change_with_default_uom_category', searcher='search_default_uom_category') categories = fields.Many2Many( diff --git a/modules/product/uom.py b/modules/product/uom.py index 4b3b9fbaa6..5c7eff5079 100644 --- a/modules/product/uom.py +++ b/modules/product/uom.py @@ -195,9 +195,9 @@ class Uom(SymbolMixin, DigitsMixin, DeactivableMixin, ModelSQL, ModelView): if not qty or (from_uom is None and to_uom is None): return qty if from_uom is None: - raise ValueError("missing from_uom") + raise ValueError("missing from_UoM") if to_uom is None: - raise ValueError("missing to_uom") + raise ValueError("missing to_UoM") if from_uom.category.id != to_uom.category.id: if not factor and not rate: raise ValueError( @@ -243,9 +243,9 @@ class Uom(SymbolMixin, DigitsMixin, DeactivableMixin, ModelSQL, ModelView): if not price or (from_uom is None and to_uom is None): return price if from_uom is None: - raise ValueError("missing from_uom") + raise ValueError("missing from_UoM") if to_uom is None: - raise ValueError("missing to_uom") + raise ValueError("missing to_UoM") if from_uom.category.id != to_uom.category.id: if not factor and not rate: raise ValueError( diff --git a/modules/product_measurements/product.py b/modules/product_measurements/product.py index b1aafe6b76..111e966682 100644 --- a/modules/product_measurements/product.py +++ b/modules/product_measurements/product.py @@ -15,37 +15,43 @@ class Template(metaclass=PoolMeta): states={ 'invisible': Eval('type').in_(NON_MEASURABLE), }, - help="Length for 1 default UOM.") - length_uom = fields.Many2One('product.uom', 'Length UOM', + help="Length for 1 default unit of measure.") + length_uom = fields.Many2One( + 'product.uom', "Length UoM", domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('length')), - }) + }, + help="The Unit of Measure for the length.") height = fields.Float( "Height", digits='height_uom', states={ 'invisible': Eval('type').in_(NON_MEASURABLE), }, - help="Height for 1 default UOM.") - height_uom = fields.Many2One('product.uom', 'Height UOM', + help="Height for 1 default unit of measure.") + height_uom = fields.Many2One( + 'product.uom', 'Height UoM', domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('height')), - }) + }, + help="The Unit of Measure for the height.") width = fields.Float( "Width", digits='width_uom', states={ 'invisible': Eval('type').in_(NON_MEASURABLE), }, - help="Width for 1 default UOM.") - width_uom = fields.Many2One('product.uom', 'Width UOM', + help="Width for 1 default unit of measure.") + width_uom = fields.Many2One( + 'product.uom', 'Width UoM', domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('width')), - }) + }, + help="The Unit of Measure for the width.") volume = fields.Float( "Volume", digits='volume_uom', states={ @@ -53,25 +59,28 @@ class Template(metaclass=PoolMeta): 'readonly': (Bool(Eval('length')) & Bool(Eval('height')) & Bool(Eval('width'))), }, - help="Volume for 1 default UOM.") - volume_uom = fields.Many2One('product.uom', 'Volume UOM', + help="Volume for 1 default unit of measure.") + volume_uom = fields.Many2One( + 'product.uom', "Volume UoM", domain=[('category', '=', Id('product', 'uom_cat_volume'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('volume')), - }) + }, + help="The Unit of Measure for the volume.") weight = fields.Float( "Weight", digits='weight_uom', states={ 'invisible': Eval('type').in_(NON_MEASURABLE), }, - help="Weight for 1 default UOM.") - weight_uom = fields.Many2One('product.uom', 'Weight UOM', + help="Weight for 1 default unit of measure.") + weight_uom = fields.Many2One('product.uom', 'Weight UoM', domain=[('category', '=', Id('product', 'uom_cat_weight'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('weight')), - }) + }, + help="The Unit of Measure for the weight.") @fields.depends('volume', 'volume_uom', 'length', 'length_uom', diff --git a/modules/product_measurements/view/template_form.xml b/modules/product_measurements/view/template_form.xml index b95b976c29..5c36afcf81 100644 --- a/modules/product_measurements/view/template_form.xml +++ b/modules/product_measurements/view/template_form.xml @@ -24,7 +24,7 @@ this repository contains the full copyright notices and license terms. --> - diff --git a/modules/product_price_list_cache/product.py b/modules/product_price_list_cache/product.py index 4bf6d7cb3e..b78753508d 100644 --- a/modules/product_price_list_cache/product.py +++ b/modules/product_price_list_cache/product.py @@ -96,7 +96,8 @@ class PriceListCache(ModelSQL): product = fields.Many2One( 'product.product', "Product", required=True, ondelete='CASCADE') uom = fields.Many2One( - 'product.uom', "UoM", required=True, ondelete='CASCADE') + 'product.uom', "UoM", required=True, ondelete='CASCADE', + help="The Unit of Measure.") raw_unit_prices = fields.Char("Unit Prices") pattern = fields.Dict(None, "Pattern") diff --git a/modules/production/production.py b/modules/production/production.py index 251ec2b5e5..ecbb257b83 100644 --- a/modules/production/production.py +++ b/modules/production/production.py @@ -91,7 +91,8 @@ class Production(ShipmentAssignMixin, Workflow, ModelSQL, ModelView): 'invisible': ~Eval('product'), }) uom_category = fields.Function(fields.Many2One( - 'product.uom.category', 'Uom Category'), + 'product.uom.category', "UoM Category", + help="The category of Unit of Measure."), 'on_change_with_uom_category') unit = fields.Many2One( 'product.uom', "Unit", diff --git a/modules/production_split/production.py b/modules/production_split/production.py index efe869fe4f..0b7c2947f8 100644 --- a/modules/production_split/production.py +++ b/modules/production_split/production.py @@ -101,5 +101,6 @@ class SplitProductionStart(ModelView): domain=[ ('category', '=', Eval('uom_category')), ]) - uom_category = fields.Many2One('product.uom.category', 'Uom Category', - readonly=True) + uom_category = fields.Many2One( + 'product.uom.category', "UoM Category", readonly=True, + help="The category of Unit of Measure.") diff --git a/modules/purchase/message.xml b/modules/purchase/message.xml index df45520c2a..a2ffa0e3df 100644 --- a/modules/purchase/message.xml +++ b/modules/purchase/message.xml @@ -4,7 +4,7 @@ this repository contains the full copyright notices and license terms. --> - You are trying to change the purchase UoM on which the purchase prices are based. + You are trying to change the purchase unit of measurer on which the purchase prices are based. You cannot erase party "%(party)s" while they have pending purchases with company "%(company)s". diff --git a/modules/purchase/product.py b/modules/purchase/product.py index 37b733a3b0..e815459d0d 100644 --- a/modules/purchase/product.py +++ b/modules/purchase/product.py @@ -33,11 +33,14 @@ class Template(metaclass=PoolMeta): domain=[ If(~Eval('active'), ('active', '=', False), ()), ]) - purchase_uom = fields.Many2One('product.uom', 'Purchase UOM', states={ + purchase_uom = fields.Many2One( + 'product.uom', "Purchase UoM", + states={ 'invisible': ~Eval('purchasable'), 'required': Eval('purchasable', False), }, - domain=[('category', '=', Eval('default_uom_category'))]) + domain=[('category', '=', Eval('default_uom_category'))], + help="The default Unit of Measure for purchases.") @fields.depends('default_uom', 'purchase_uom', 'purchasable') def on_change_default_uom(self): diff --git a/modules/purchase/purchase.py b/modules/purchase/purchase.py index d303197387..e757a073f1 100644 --- a/modules/purchase/purchase.py +++ b/modules/purchase/purchase.py @@ -1146,7 +1146,9 @@ class Line(sequence_ordered(), ModelSQL, ModelView): 'readonly': Eval('purchase_state') != 'draft', }) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', 'Product Uom Category'), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') unit_price = Monetary( "Unit Price", currency='currency', digits=price_digits, diff --git a/modules/purchase_blanket_agreement/purchase.py b/modules/purchase_blanket_agreement/purchase.py index c890eff892..5b68a71b0a 100644 --- a/modules/purchase_blanket_agreement/purchase.py +++ b/modules/purchase_blanket_agreement/purchase.py @@ -460,7 +460,9 @@ class BlanketAgreementLine(ModelSQL, ModelView): ], states=_states) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', "Product UOM Category"), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') quantity = fields.Float("Quantity", digits='unit', states=_states) unit = fields.Many2One( diff --git a/modules/purchase_request/purchase_request.py b/modules/purchase_request/purchase_request.py index fb0e36fffd..942b63d766 100644 --- a/modules/purchase_request/purchase_request.py +++ b/modules/purchase_request/purchase_request.py @@ -60,15 +60,20 @@ class PurchaseRequest(ModelSQL, ModelView): 'readonly': STATES['readonly'], }) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', "Product Uom Category"), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') computed_quantity = fields.Float('Computed Quantity', readonly=True) computed_unit = fields.Many2One( 'product.uom', "Computed Unit", readonly=True) purchase_date = fields.Date('Best Purchase Date', readonly=True) supply_date = fields.Date('Expected Supply Date', readonly=True) - default_uom = fields.Function(fields.Many2One( - 'product.uom', "Default UOM"), 'on_change_with_default_uom') + default_uom = fields.Function( + fields.Many2One( + 'product.uom', "Default UoM", + help="The default Unit of Measure."), + 'on_change_with_default_uom') stock_level = fields.Float( "Stock at Supply Date", readonly=True, digits='default_uom') warehouse = fields.Many2One( diff --git a/modules/purchase_request_quotation/purchase.py b/modules/purchase_request_quotation/purchase.py index 4fa4c8b690..419ea930a2 100644 --- a/modules/purchase_request_quotation/purchase.py +++ b/modules/purchase_request_quotation/purchase.py @@ -294,7 +294,9 @@ class QuotationLine(ModelSQL, ModelView): ('category', '!=', -1)), ]) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', 'Product Uom Category'), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') unit_price = Monetary( "Unit Price", currency='currency', digits=price_digits) diff --git a/modules/purchase_requisition/purchase.py b/modules/purchase_requisition/purchase.py index dfeb995cb6..b80e9e9f47 100644 --- a/modules/purchase_requisition/purchase.py +++ b/modules/purchase_requisition/purchase.py @@ -432,7 +432,9 @@ class PurchaseRequisitionLine(sequence_ordered(), ModelSQL, ModelView): ], states=_states) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', "Product UOM Category"), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') description = fields.Text("Description", states=_states) summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary') diff --git a/modules/purchase_secondary_unit/product.py b/modules/purchase_secondary_unit/product.py index 9cb9788255..62ed385737 100644 --- a/modules/purchase_secondary_unit/product.py +++ b/modules/purchase_secondary_unit/product.py @@ -12,12 +12,13 @@ from trytond.pyson import Bool, Eval class PurchaseSecondaryMixin: __slots__ = () purchase_secondary_uom = fields.Many2One( - 'product.uom', "Purchase Secondary UOM", + 'product.uom', "Purchase Secondary UoM", domain=[ ('category', '!=', Eval('default_uom_category')), - ]) + ], + help="The second Unit of Measure for purchases.") purchase_secondary_uom_factor = fields.Float( - "Purchase Secondary UOM Factor", digits=uom_conversion_digits, + "Purchase Secondary UoM Factor", digits=uom_conversion_digits, states={ 'required': Bool(Eval('purchase_secondary_uom')), 'invisible': ~Eval('purchase_secondary_uom'), @@ -25,7 +26,7 @@ class PurchaseSecondaryMixin: help="The coefficient for the formula:\n" "1 (purchase unit) = coefficient (secondary unit)") purchase_secondary_uom_rate = fields.Float( - "Purchase Secondary UOM Rate", digits=uom_conversion_digits, + "Purchase Secondary UoM Rate", digits=uom_conversion_digits, states={ 'required': Bool(Eval('purchase_secondary_uom')), 'invisible': ~Eval('purchase_secondary_uom'), @@ -34,7 +35,7 @@ class PurchaseSecondaryMixin: "coefficient (purchase unit) = 1 (secondary unit)") purchase_secondary_uom_category = fields.Function( fields.Many2One( - 'product.uom.category', "Purchase Secondary UOM Category"), + 'product.uom.category', "Purchase Secondary UoM Category"), 'on_change_with_purchase_secondary_uom_category', searcher='search_purchase_secondary_uom_category') @@ -148,7 +149,9 @@ class ProductSupplier(PurchaseSecondaryMixin, metaclass=PoolMeta): __name__ = 'purchase.product_supplier' default_uom_category = fields.Function( - fields.Many2One('product.uom.category', "Default UOM Category"), + fields.Many2One( + 'product.uom.category', "Default UoM Category", + help="The category of the default Unit of Measure."), 'on_change_with_default_uom_category') @fields.depends('template', '_parent_template.purchase_uom', diff --git a/modules/purchase_secondary_unit/purchase.py b/modules/purchase_secondary_unit/purchase.py index 6e5465cd6e..2b872823b7 100644 --- a/modules/purchase_secondary_unit/purchase.py +++ b/modules/purchase_secondary_unit/purchase.py @@ -40,12 +40,17 @@ class Line(metaclass=PoolMeta): }), 'on_change_with_secondary_unit_price', setter='set_secondary') - secondary_uom_factor = fields.Float("Secondary UOM Factor") - secondary_uom_rate = fields.Float("Secondary UOM Rate") + secondary_uom_factor = fields.Float( + "Secondary UoM Factor", + help="The factor for the secondary Unit of Measure.") + secondary_uom_rate = fields.Float( + "Secondary UoM Rate", + help="The rate for the secondary Unit of Measure.") product_secondary_uom_category = fields.Function( fields.Many2One( - 'product.uom.category', "Product Secondary UOM Category"), + 'product.uom.category', "Product Secondary UoM Category", + help="The category of secondary Unit of Measure for the product."), 'on_change_with_product_secondary_uom_category') @fields.depends('product', 'product_supplier') @@ -176,7 +181,9 @@ class RequisitionLine(metaclass=PoolMeta): product_secondary_uom_category = fields.Function( fields.Many2One( - 'product.uom.category', "Product Secondary UOM Category"), + 'product.uom.category', "Product Secondary UoM Category", + help="The category of secondary Unit of Measure " + "for the product."), 'on_change_with_product_secondary_uom_category') @classmethod @@ -245,7 +252,9 @@ class BlanketAgreementLine(metaclass=PoolMeta): product_secondary_uom_category = fields.Function( fields.Many2One( - 'product.uom.category', "Product Secondary UOM Category"), + 'product.uom.category', "Product Secondary UOM Category", + help="The category of secondary Unit of Measure " + "for the product."), 'on_change_with_product_secondary_uom_category') @classmethod diff --git a/modules/sale/product.py b/modules/sale/product.py index 28b8140e5c..9af992323d 100644 --- a/modules/sale/product.py +++ b/modules/sale/product.py @@ -38,14 +38,15 @@ class Template(metaclass=PoolMeta): __name__ = 'product.template' salable = fields.Boolean("Salable") sale_uom = fields.Many2One( - 'product.uom', "Sale UOM", + 'product.uom', "Sale UoM", states={ 'invisible': ~Eval('salable', False), 'required': Eval('salable', False), }, domain=[ ('category', '=', Eval('default_uom_category')), - ]) + ], + help="The default Unit of Measure for sales.") lead_time = fields.MultiValue(fields.TimeDelta( "Lead Time", domain=['OR', diff --git a/modules/sale/sale.py b/modules/sale/sale.py index bb8e814f65..e8b4228222 100644 --- a/modules/sale/sale.py +++ b/modules/sale/sale.py @@ -1264,7 +1264,9 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView): depends={ 'company', 'warehouse', 'sale_date', 'currency', 'customer'}) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', 'Product Uom Category'), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') unit_price = Monetary( "Unit Price", digits=price_digits, currency='currency', diff --git a/modules/sale_blanket_agreement/sale.py b/modules/sale_blanket_agreement/sale.py index b21a158985..0292056a9e 100644 --- a/modules/sale_blanket_agreement/sale.py +++ b/modules/sale_blanket_agreement/sale.py @@ -445,7 +445,9 @@ class BlanketAgreementLine(ModelSQL, ModelView): }, depends=['company', 'unit', 'quantity']) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', "Product UOM Category"), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') quantity = fields.Float("Quantity", digits='unit', states=_states) unit = fields.Many2One( diff --git a/modules/sale_gift_card/message.xml b/modules/sale_gift_card/message.xml index c78ec492a1..efa00926f8 100644 --- a/modules/sale_gift_card/message.xml +++ b/modules/sale_gift_card/message.xml @@ -7,7 +7,7 @@ this repository contains the full copyright notices and license terms. --> The numbers for each company's gift cards must be unique. - The default UOM for the gift card "%(template)s" must be "%(unit)s". + The default unit of measure for the gift card "%(template)s" must be "%(unit)s". To do the move "%(move)s", you must use exactly %(quantity)d gift card(s). diff --git a/modules/sale_secondary_unit/product.py b/modules/sale_secondary_unit/product.py index 1b98dd068d..63c22005da 100644 --- a/modules/sale_secondary_unit/product.py +++ b/modules/sale_secondary_unit/product.py @@ -12,12 +12,13 @@ from trytond.pyson import Bool, Eval class SaleSecondaryMixin: __slots__ = () sale_secondary_uom = fields.Many2One( - 'product.uom', "Sale Secondary UOM", + 'product.uom', "Sale Secondary UoM", domain=[ ('category', '!=', Eval('default_uom_category')), - ]) + ], + help="The secondary Unit of Measure for sales.") sale_secondary_uom_factor = fields.Float( - "Sale Secondary UOM Factor", digits=uom_conversion_digits, + "Sale Secondary UoM Factor", digits=uom_conversion_digits, states={ 'required': Bool(Eval('sale_secondary_uom')), 'invisible': ~Eval('sale_secondary_uom'), @@ -25,7 +26,7 @@ class SaleSecondaryMixin: help="The coefficient for the formula:\n" "1 (sale unit) = coefficient (secondary unit)") sale_secondary_uom_rate = fields.Float( - "Sale Secondary UOM Rate", digits=uom_conversion_digits, + "Sale Secondary UoM Rate", digits=uom_conversion_digits, states={ 'required': Bool(Eval('sale_secondary_uom')), 'invisible': ~Eval('sale_secondary_uom'), @@ -33,7 +34,7 @@ class SaleSecondaryMixin: help="The coefficient for the formula:\n" "coefficient (sale unit) = 1 (secondary unit)") sale_secondary_uom_category = fields.Function( - fields.Many2One('product.uom.category', "Sale Secondary UOM Category"), + fields.Many2One('product.uom.category', "Sale Secondary UoM Category"), 'on_change_with_sale_secondary_uom_category', searcher='search_sale_secondary_uom_category') @@ -144,7 +145,9 @@ class ProductCustomer(SaleSecondaryMixin, metaclass=PoolMeta): __name__ = 'sale.product_customer' default_uom_category = fields.Function( - fields.Many2One('product.uom.category', "Default UOM Category"), + fields.Many2One( + 'product.uom.category', "Default UoM Category", + help="The category of default Unit of Measure."), 'on_change_with_default_uom_category') @fields.depends('template', '_parent_template.sale_uom', diff --git a/modules/sale_secondary_unit/sale.py b/modules/sale_secondary_unit/sale.py index 1d37c1c57d..2b23e15231 100644 --- a/modules/sale_secondary_unit/sale.py +++ b/modules/sale_secondary_unit/sale.py @@ -40,12 +40,17 @@ class Line(metaclass=PoolMeta): }), 'on_change_with_secondary_unit_price', setter='set_secondary') - secondary_uom_factor = fields.Float("Secondary UOM Factor") - secondary_uom_rate = fields.Float("Secondary UOM Rate") + secondary_uom_factor = fields.Float( + "Secondary UoM Factor", + help="The factor for the secondary Unit of Measure.") + secondary_uom_rate = fields.Float( + "Secondary UoM Rate", + help="The rate for the secondary Unit of Measure.") product_secondary_uom_category = fields.Function( fields.Many2One( - 'product.uom.category', "Product Secondary UOM Category"), + 'product.uom.category', "Product Secondary UoM Category", + help="The category of secondary Unit of Measure for the product."), 'on_change_with_product_secondary_uom_category') @fields.depends('product') @@ -196,7 +201,9 @@ class BlanketAgreementLine(metaclass=PoolMeta): product_secondary_uom_category = fields.Function( fields.Many2One( - 'product.uom.category', "Product Secondary UOM Category"), + 'product.uom.category', "Product Secondary UoM Category", + help="The category of the secondary Unit of Measure " + "for the product."), 'on_change_with_product_secondary_uom_category') @classmethod diff --git a/modules/stock/location.py b/modules/stock/location.py index 210195c067..37757bb434 100644 --- a/modules/stock/location.py +++ b/modules/stock/location.py @@ -171,10 +171,11 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView): help="The amount of stock expected to be in the location."), 'get_quantity', searcher='search_quantity') quantity_uom = fields.Function(fields.Many2One( - 'product.uom', "Quantity UOM"), + 'product.uom', "Quantity UoM", + help="The Unit of Measure for the quantities."), 'get_quantity_uom') quantity_uom_digits = fields.Function(fields.Integer( - "Quantity UOM Digits"), + "Quantity UoM Digits"), 'get_quantity_uom') cost_value = fields.Function(fields.Numeric( "Cost Value", digits=price_digits, @@ -698,7 +699,9 @@ class ProductsByLocations(DeactivableMixin, ModelSQL, ModelView): fields.Float("Forecast Quantity", digits='default_uom'), 'get_product', searcher='search_product') default_uom = fields.Function( - fields.Many2One('product.uom', "Default UOM"), + fields.Many2One( + 'product.uom', "Default UoM", + help="The default Unit of Measure."), 'get_product', searcher='search_product') cost_value = fields.Function( fields.Numeric("Cost Value"), 'get_product') diff --git a/modules/stock/message.xml b/modules/stock/message.xml index dcae4e4632..4f40a6969b 100644 --- a/modules/stock/message.xml +++ b/modules/stock/message.xml @@ -4,7 +4,7 @@ this repository contains the full copyright notices and license terms. --> - You cannot change the default UOM of a product which is associated with stock moves. + You cannot change the default unit of measure of a product which is associated with stock moves. You cannot change the type of a product which is associated with stock moves. diff --git a/modules/stock/move.py b/modules/stock/move.py index a0c911cecc..6539f1e071 100644 --- a/modules/stock/move.py +++ b/modules/stock/move.py @@ -185,7 +185,9 @@ class Move(Workflow, ModelSQL, ModelView): depends={'company'}, help="The product that the move is associated with.") product_uom_category = fields.Function( - fields.Many2One('product.uom.category', 'Product Uom Category'), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') unit = fields.Many2One( 'product.uom', "Unit", required=True, @@ -1587,7 +1589,7 @@ class Move(Workflow, ModelSQL, ModelView): """ Executes the supplied query to compute for each location and product the stock quantity in the default uom of the product and rounded to - Uom's rounding digits. + UoM's rounding digits. See compute_quantites_query for params explanation. diff --git a/modules/stock_forecast/forecast.py b/modules/stock_forecast/forecast.py index 0ec3da58c8..7ca202bd5a 100644 --- a/modules/stock_forecast/forecast.py +++ b/modules/stock_forecast/forecast.py @@ -290,7 +290,9 @@ class ForecastLine(ModelSQL, ModelView): ], states=_states) product_uom_category = fields.Function( - fields.Many2One('product.uom.category', 'Product Uom Category'), + fields.Many2One( + 'product.uom.category', "Product UoM Category", + help="The category of Unit of Measure for the product."), 'on_change_with_product_uom_category') unit = fields.Many2One( 'product.uom', "Unit", required=True, diff --git a/modules/stock_lot/stock.py b/modules/stock_lot/stock.py index c15b0f22d8..4088c7e5ae 100644 --- a/modules/stock_lot/stock.py +++ b/modules/stock_lot/stock.py @@ -85,7 +85,9 @@ class Lot(DeactivableMixin, ModelSQL, ModelView, LotMixin, StockMixin): fields.Float("Forecast Quantity", digits='default_uom'), 'get_quantity', searcher='search_quantity') default_uom = fields.Function( - fields.Many2One('product.uom', "Default UOM"), + fields.Many2One( + 'product.uom', "Default UoM", + help="The default Unit of Measure."), 'on_change_with_default_uom') @classmethod @@ -306,7 +308,9 @@ class LotsByLocations(ModelSQL, ModelView): fields.Float("Forecast Quantity", digits='default_uom'), 'get_lot', searcher='search_lot') default_uom = fields.Function( - fields.Many2One('product.uom', "Default UOM"), + fields.Many2One( + 'product.uom', "Default UoM", + help="The default Unit of Measure."), 'get_lot', searcher='search_lot') @classmethod diff --git a/modules/stock_package/stock.py b/modules/stock_package/stock.py index 691cee1113..e5c1fc1da6 100644 --- a/modules/stock_package/stock.py +++ b/modules/stock_package/stock.py @@ -64,29 +64,32 @@ class MeasurementsMixin: "Length", digits='length_uom', help="The length of the package.") length_uom = fields.Many2One( - 'product.uom', "Length UOM", + 'product.uom', "Length UoM", domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'required': Bool(Eval('length')), - }) + }, + help="The Unit of Measure for the package length.") height = fields.Float( "Height", digits='height_uom', help="The height of the package.") height_uom = fields.Many2One( - 'product.uom', "Height UOM", + 'product.uom', "Height UoM", domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'required': Bool(Eval('height')), - }) + }, + help="The Unit of Measure for the package height.") width = fields.Float( "Width", digits='width_uom', help="The width of the package.") width_uom = fields.Many2One( - 'product.uom', "Width UOM", + 'product.uom', "Width UoM", domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'required': Bool(Eval('width')), - }) + }, + help="The Unit of Measure for the package width.") packaging_volume = fields.Float( "Packaging Volume", digits='packaging_volume_uom', @@ -98,21 +101,23 @@ class MeasurementsMixin: }, help="The volume of the package.") packaging_volume_uom = fields.Many2One( - 'product.uom', "Packaging Volume UOM", + 'product.uom', "Packaging Volume UoM", domain=[('category', '=', Id('product', 'uom_cat_volume'))], states={ 'required': Bool(Eval('packaging_volume')), - }) + }, + help="The Unit of Measure for the packaging volume.") packaging_weight = fields.Float( "Packaging Weight", digits='packaging_weight_uom', help="The weight of the package when empty.") packaging_weight_uom = fields.Many2One( - 'product.uom', "Packaging Weight UOM", + 'product.uom', "Packaging Weight UoM", domain=[('category', '=', Id('product', 'uom_cat_weight'))], states={ 'required': Bool(Eval('packaging_weight')), - }) + }, + help="The Unit of Measure for the packaging weight.") @fields.depends( 'packaging_volume', 'packaging_volume_uom', diff --git a/modules/stock_secondary_unit/stock.py b/modules/stock_secondary_unit/stock.py index cd1568a2fc..e2653d8a57 100644 --- a/modules/stock_secondary_unit/stock.py +++ b/modules/stock_secondary_unit/stock.py @@ -39,7 +39,8 @@ class Move(metaclass=PoolMeta): product_secondary_uom_category = fields.Function( fields.Many2One( - 'product.uom.category', "Product Secondary UOM Category"), + 'product.uom.category', "Product Secondary UoM Category", + help="The category of secondary Unit of Measure for the product."), 'get_product_secondary_uom_category') @fields.depends('quantity', 'unit', 'secondary_unit', 'origin') diff --git a/modules/stock_shipment_measurements/stock.py b/modules/stock_shipment_measurements/stock.py index 3ff40563f2..8a2a5358bd 100644 --- a/modules/stock_shipment_measurements/stock.py +++ b/modules/stock_shipment_measurements/stock.py @@ -19,12 +19,14 @@ class Configuration(metaclass=PoolMeta): measurement_weight_uom = fields.MultiValue( fields.Many2One( - 'product.uom', "Measurement Weight Uom", required=True, - domain=[('category', '=', Id('product', 'uom_cat_weight'))])) + 'product.uom', "Measurement Weight UoM", required=True, + domain=[('category', '=', Id('product', 'uom_cat_weight'))], + help="The default Unit of Measure for weight.")) measurement_volume_uom = fields.MultiValue( fields.Many2One( - 'product.uom', "Measurement Volume Uom", required=True, - domain=[('category', '=', Id('product', 'uom_cat_volume'))])) + 'product.uom', "Measurement Volume UoM", required=True, + domain=[('category', '=', Id('product', 'uom_cat_volume'))], + help="The default Unit of Measure for volume.")) @classmethod def multivalue_model(cls, field): @@ -49,10 +51,10 @@ class ConfigurationMeasurement(ModelSQL, CompanyValueMixin): __name__ = 'stock.configuration.measurement' measurement_weight_uom = fields.Many2One( - 'product.uom', "Measurement Weight Uom", required=True, + 'product.uom', "Measurement Weight UoM", required=True, domain=[('category', '=', Id('product', 'uom_cat_weight'))]) measurement_volume_uom = fields.Many2One( - 'product.uom', "Measurement Volume Uom", required=True, + 'product.uom', "Measurement Volume UoM", required=True, domain=[('category', '=', Id('product', 'uom_cat_volume'))]) @classmethod @@ -179,7 +181,10 @@ class MeasurementsMixin(object): help="The total weight of the record's moves."), 'get_measurements', searcher='search_measurements') weight_uom = fields.Function( - fields.Many2One('product.uom', "Weight Uom"), 'get_measurements_uom') + fields.Many2One( + 'product.uom', "Weight UoM", + help="The Unit of Measure of weight."), + 'get_measurements_uom') volume = fields.Function( fields.Float( "Volume", digits='volume_uom', @@ -189,7 +194,10 @@ class MeasurementsMixin(object): help="The total volume of the record's moves."), 'get_measurements', searcher='search_measurements') volume_uom = fields.Function( - fields.Many2One('product.uom', "Volume Uom"), 'get_measurements_uom') + fields.Many2One( + 'product.uom', "Volume UoM", + help="The Unit of Measure of volume."), + 'get_measurements_uom') @classmethod def get_measurements_uom(cls, shipments, name): @@ -364,11 +372,12 @@ class Package(MeasurementsMixin, object, metaclass=PoolMeta): "Additional Weight", digits='additional_weight_uom', help="The weight to add to the packages.") additional_weight_uom = fields.Many2One( - 'product.uom', "Additional Weight Uom", + 'product.uom', "Additional Weight UoM", domain=[('category', '=', Id('product', 'uom_cat_weight'))], states={ 'required': Bool(Eval('additional_weight')), - }) + }, + help="The Unit of Measure for additional weight.") total_weight = fields.Function( fields.Float( "Total Weight", digits='weight_uom', diff --git a/modules/stock_split/stock.py b/modules/stock_split/stock.py index b2e97b3fcd..f28c01f342 100644 --- a/modules/stock_split/stock.py +++ b/modules/stock_split/stock.py @@ -84,8 +84,9 @@ class SplitMoveStart(ModelView): domain=[ ('category', '=', Eval('uom_category')), ]) - uom_category = fields.Many2One('product.uom.category', 'Uom Category', - readonly=True) + uom_category = fields.Many2One( + 'product.uom.category', "UoM Category", readonly=True, + help="The category of Unit of Measure.") class SplitMove(Wizard): diff --git a/modules/web_shop_shopify/message.xml b/modules/web_shop_shopify/message.xml index 972d1c5dda..80e03fb836 100644 --- a/modules/web_shop_shopify/message.xml +++ b/modules/web_shop_shopify/message.xml @@ -25,7 +25,7 @@ this repository contains the full copyright notices and license terms. --> To update products on the shop "%(shop)s", you must set the language to "%(shopify_primary_locale)s" instead of "%(shop_language)s". - To update product "%(product)s" on Shopify, you must use an UOM without digits. + To update product "%(product)s" on Shopify, you must use an unit of measure without digits. To change the template of product "%(product)s" you must unpublish it from the Shopify web shops. diff --git a/modules/web_shop_shopify/product.py b/modules/web_shop_shopify/product.py index 98a2e22491..e5d2337fd9 100644 --- a/modules/web_shop_shopify/product.py +++ b/modules/web_shop_shopify/product.py @@ -70,12 +70,13 @@ class Template(IdentifiersMixin, metaclass=PoolMeta): __name__ = 'product.template' shopify_uom = fields.Many2One( - 'product.uom', "Shopify UOM", + 'product.uom', "Shopify UoM", states={ 'readonly': Bool(Eval('shopify_identifiers', [-1])), 'invisible': ~Eval('salable', False), }, - depends={'default_uom_category'}) + depends={'default_uom_category'}, + help="The Unit of Measure of the product on Shopify.") @classmethod def __setup__(cls):