Integer, Numeric and Float allow None as value
NULL value is None and not False issue2022 review237004
This commit is contained in:
1 parent
1b15a6be59
commit
f46ed3566f
2 files changed
+5
No files matched your search
@@ -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()
|
||||
|
||||
@@ -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)),
|
||||
|
||||
Reference in new issue
Block a user