From 1434b656639b9b242b09bb6df1ed3dd36014e4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 14 Jun 2016 17:17:07 +0200 Subject: [PATCH] Change supply_period into Integer Since version 3.8, Property field can support Integer. issue5574 review18171002 --- product.py | 2 +- production.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/product.py b/product.py index 2f31370e60..ef10cecf49 100644 --- a/product.py +++ b/product.py @@ -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 diff --git a/production.py b/production.py index ab39fdd25e..eb09e11460 100644 --- a/production.py +++ b/production.py @@ -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: