From 7bbca26c4841be271b473e4aa4560b9729446da0 Mon Sep 17 00:00:00 2001 From: wilson gomez Date: Fri, 3 Dec 2021 14:41:04 -0500 Subject: [PATCH] minor fix --- wage_type.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wage_type.py b/wage_type.py index 93e6b84..c4d1f70 100644 --- a/wage_type.py +++ b/wage_type.py @@ -7,6 +7,7 @@ from trytond.transaction import Transaction from trytond.i18n import gettext from .exceptions import WageTypeValidationError from trytond.tools import lstrip_wildcard +from trytond.pool import Pool STATES = {'readonly': Not(Bool(Eval('active')))} @@ -29,9 +30,13 @@ class WageType(ModelSQL, ModelView): ('deduction', 'Deduction'), ], 'Definition', required=True) unit_price_formula = fields.Char('Unit Price Formula', - help='Python expression for eval(expr)') + help="""Python expression for eval(expr) \b + -salary: the salary employee \b + -minimum_salary: the salary minimum fixed """) expense_formula = fields.Char('Expense Formula', - help='Python expression for eval(expr)') + help="""Python expression for eval(expr) \b + -salary: the salary employee \b + -minimum_salary: the salary minimum fixed """) uom = fields.Many2One('product.uom', 'UOM', required=True) default_quantity = fields.Numeric('Default Quantity', digits=(16, 2)) type_concept = fields.Selection([ @@ -132,6 +137,9 @@ class WageType(ModelSQL, ModelView): Compute a formula field with a salary value as float :return: A decimal ''' + Configuration = Pool().get('staff.configuration') + configuration = Configuration(1) + minimum_salary = float(configuration.minimum_salary or 0) formula = getattr(self, formula) if not formula: return Decimal('0.0')