diff --git a/service.py b/service.py index b4834c2755..1e6559dca7 100644 --- a/service.py +++ b/service.py @@ -1,5 +1,6 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. +from decimal import Decimal from trytond.model import ModelView, ModelSQL, fields from trytond.model.cacheable import Cacheable from trytond.pyson import Eval @@ -106,6 +107,9 @@ class EmployeeCostPrice(ModelSQL, ModelView): ] self._order.insert(0, ('date', 'DESC')) + def default_cost_price(self): + return Decimal(0) + def default_date(self): date_obj = Pool().get('ir.date') return date_obj.today() diff --git a/work.py b/work.py index aad40a43ea..735865903e 100644 --- a/work.py +++ b/work.py @@ -42,6 +42,7 @@ class Work(ModelSQL, ModelView): digits=(16, Eval('currency_digits', 2)), states={ 'invisible': Eval('type') != 'task', + 'required': Eval('type') == 'task', }, depends=['type', 'currency_digits']) revenue = fields.Function(fields.Numeric('Revenue', digits=(16, Eval('currency_digits', 2)),