Change supply_period into Integer

Since version 3.8, Property field can support Integer.

issue5574
review18171002
This commit is contained in:
Cédric Krier committed 2016-06-14 17:17:07 +02:00
1 parent 11d4fcba0c
commit 1434b65663
2 files changed
+6 -7

No files matched your search

+1 -1
View File
@@ -14,4 +14,4 @@ class Product:
'Return the supply period for the product'
pool = Pool()
Configuration = pool.get('production.configuration')
return int(Configuration(1).supply_period or 0)
return Configuration(1).supply_period or 0
+5 -6
View File
@@ -1,7 +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.
import datetime
from decimal import Decimal
from collections import defaultdict
from trytond.model import ModelView, fields
@@ -17,12 +16,12 @@ __all__ = ['Configuration', 'Production',
class Configuration:
__metaclass__ = PoolMeta
__name__ = 'production.configuration'
supply_period = fields.Property(fields.Numeric('Supply Period',
digits=(16, 0), help='In number of days', required=True))
supply_period = fields.Property(fields.Integer('Supply Period',
help='In number of days', required=True))
@staticmethod
def default_supply_period():
return Decimal(0)
@classmethod
def default_supply_period(cls):
return 0
class Production: