changeset 1843ec99ecf0 in modules/product:default
details: https://hg.tryton.org/modules/product?cmd=changeset;node=1843ec99ecf0
description:
Add help text
issue6314
review33151002
diffstat:
category.py | 9 ++++++---
configuration.py | 3 ++-
product.py | 43 +++++++++++++++++++++++++++++++------------
uom.py | 30 +++++++++++++++++++-----------
4 files changed, 58 insertions(+), 27 deletions(-)
diffs (186 lines):
diff -r 4625bdcb62b9 -r 1843ec99ecf0 category.py
--- a/category.py Thu Mar 19 19:06:06 2020 +0100
+++ b/category.py Mon Apr 13 17:50:45 2020 +0200
@@ -7,9 +7,12 @@
"Product Category"
__name__ = "product.category"
name = fields.Char('Name', required=True, translate=True)
- parent = fields.Many2One('product.category', 'Parent', select=True)
- childs = fields.One2Many('product.category', 'parent',
- string='Children')
+ parent = fields.Many2One(
+ 'product.category', "Parent", select=True,
+ help="Used to add structure above the category.")
+ childs = fields.One2Many(
+ 'product.category', 'parent', string="Children",
+ help="Used to add structure below the category.")
@classmethod
def __setup__(cls):
diff -r 4625bdcb62b9 -r 1843ec99ecf0 configuration.py
--- a/configuration.py Thu Mar 19 19:06:06 2020 +0100
+++ b/configuration.py Mon Apr 13 17:50:45 2020 +0200
@@ -7,7 +7,8 @@
from trytond.tools.multivalue import migrate_property
default_cost_price_method = fields.Selection(
- 'get_cost_price_methods', "Default Cost Method")
+ 'get_cost_price_methods', "Default Cost Method",
+ help="The default cost price method for new products.")
@classmethod
diff -r 4625bdcb62b9 -r 1843ec99ecf0 product.py
--- a/product.py Thu Mar 19 19:06:06 2020 +0100
+++ b/product.py Mon Apr 13 17:50:45 2020 +0200
@@ -54,29 +54,43 @@
states={
'invisible': Eval('type', 'goods') != 'goods',
},
- depends=['type'])
+ depends=['type'],
+ help="Check to allow stock moves to be assigned "
+ "regardless of stock level.")
list_price = fields.MultiValue(fields.Numeric(
- "List Price", required=True, digits=price_digits))
+ "List Price", required=True, digits=price_digits,
+ help="The standard price the product is sold at."))
list_prices = fields.One2Many(
'product.list_price', 'template', "List Prices")
cost_price = fields.Function(fields.Numeric(
- "Cost Price", digits=price_digits), 'get_cost_price')
+ "Cost Price", digits=price_digits,
+ help="The amount it costs to purchase or make the product, "
+ "or carry out the service."),
+ 'get_cost_price')
cost_price_method = fields.MultiValue(fields.Selection(
- COST_PRICE_METHODS, "Cost Price Method", required=True))
+ COST_PRICE_METHODS, "Cost Price Method", required=True,
+ 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)
+ 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'),
'on_change_with_default_uom_category',
searcher='search_default_uom_category')
categories = fields.Many2Many(
'product.template-product.category', 'template', 'category',
- "Categories")
+ "Categories",
+ help="The categories that the product is in.\n"
+ "Used to group similar products together.")
categories_all = fields.Many2Many(
'product.template-product.category.all',
'template', 'category', "Categories", readonly=True)
- products = fields.One2Many('product.product', 'template', "Variants")
+ products = fields.One2Many(
+ 'product.product', 'template', "Variants",
+ help="The different variants the product comes in.")
@classmethod
def __register__(cls, module_name):
@@ -222,7 +236,9 @@
template = fields.Many2One(
'product.template', "Product Template",
required=True, ondelete='CASCADE', select=True,
- search_context={'default_products': False})
+ search_context={'default_products': False},
+ help="The product that defines the common properties "
+ "inherited by the variant.")
code_readonly = fields.Function(fields.Boolean('Code Readonly'),
'get_code_readonly')
prefix_code = fields.Function(fields.Char(
@@ -238,12 +254,15 @@
},
depends=['code_readonly'],
help="The unique identifier for the product (aka SKU).")
- code = fields.Char("Code", readonly=True, select=True)
+ code = fields.Char("Code", readonly=True, select=True,
+ help="A unique identifier for the variant.")
identifiers = fields.One2Many(
'product.identifier', 'product', "Identifiers",
- help="Add other identifiers to the variant.")
+ help="Other identifiers associated with the variant.")
cost_price = fields.MultiValue(fields.Numeric(
- "Cost Price", required=True, digits=price_digits))
+ "Cost Price", required=True, digits=price_digits,
+ help="The amount it costs to purchase or make the variant, "
+ "or carry out the service."))
cost_prices = fields.One2Many(
'product.cost_price', 'product', "Cost Prices")
description = fields.Text("Description", translate=True)
@@ -648,7 +667,7 @@
_rec_name = 'code'
product = fields.Many2One('product.product', "Product", ondelete='CASCADE',
required=True, select=True,
- help="The product identified by this identifier.")
+ help="The product identified by the code.")
type = fields.Selection([
(None, ''),
('ean', "International Article Number"),
diff -r 4625bdcb62b9 -r 1843ec99ecf0 uom.py
--- a/uom.py Thu Mar 19 19:06:06 2020 +0100
+++ b/uom.py Mon Apr 13 17:50:45 2020 +0200
@@ -20,10 +20,10 @@
class UomCategory(ModelSQL, ModelView):
- 'Product uom category'
+ "Unit of Measure Category"
__name__ = 'product.uom.category'
name = fields.Char('Name', required=True, translate=True)
- uoms = fields.One2Many('product.uom', 'category', 'Unit of Measures')
+ uoms = fields.One2Many('product.uom', 'category', "Units of Measure")
@classmethod
def __setup__(cls):
@@ -32,27 +32,35 @@
class Uom(DeactivableMixin, ModelSQL, ModelView):
- 'Unit of measure'
+ "Unit of Measure"
__name__ = 'product.uom'
name = fields.Char("Name", size=None, required=True, translate=True)
- symbol = fields.Char("Symbol", size=10, required=True, translate=True)
+ symbol = fields.Char(
+ "Symbol", size=10, required=True, translate=True,
+ help="The symbol that represents the unit of measure.")
category = fields.Many2One(
- 'product.uom.category', "Category", required=True, ondelete='RESTRICT')
+ 'product.uom.category', "Category", required=True, ondelete='RESTRICT',
+ help="The category that contains the unit of measure.\n"
+ "Conversions between different units of measure can be done if they "
+ "are in the same category.")
rate = fields.Float(
"Rate", digits=uom_conversion_digits, required=True,
- help=('The coefficient for the formula:\n'
- '1 (base unit) = coef (this unit)'))
+ help="The coefficient for the formula:\n"
+ "1 (base unit) = coef (this unit)")
factor = fields.Float(
"Factor", digits=uom_conversion_digits, required=True,
- help=('The coefficient for the formula:\n'
- 'coef (base unit) = 1 (this unit)'))
+ help="The coefficient for the formula:\n"
+ "coefficient (base unit) = 1 (this unit)")
rounding = fields.Float(
"Rounding Precision", digits=(12, Eval('digits', 12)), required=True,
domain=[
('rounding', '>', 0),
],
- depends=['digits'])
- digits = fields.Integer('Display Digits', required=True)
+ depends=['digits'],
+ help+ help="The accuracy to which values are rounded.")
+ digits = fields.Integer(
+ "Display Digits", required=True,
+ help="The number of digits to display after the decimal separator.")
@classmethod
def __setup__(cls):