Migrate to python 3.
This commit is contained in:
parent
3c0d450357
commit
099cf3e7a7
|
@ -4,8 +4,7 @@ from trytond.pool import PoolMeta
|
||||||
__all__ = ['Configuration']
|
__all__ = ['Configuration']
|
||||||
|
|
||||||
|
|
||||||
class Configuration:
|
class Configuration(metaclass=PoolMeta):
|
||||||
__metaclass__ = PoolMeta
|
|
||||||
__name__ = 'production.configuration'
|
__name__ = 'production.configuration'
|
||||||
check_state_operation = fields.Selection([
|
check_state_operation = fields.Selection([
|
||||||
(None, ''),
|
(None, ''),
|
||||||
|
|
|
@ -227,8 +227,7 @@ class OperationTracking(ModelSQL, ModelView):
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
|
|
||||||
class Production:
|
class Production(metaclass=PoolMeta):
|
||||||
__metaclass__ = PoolMeta
|
|
||||||
__name__ = 'production'
|
__name__ = 'production'
|
||||||
|
|
||||||
route = fields.Many2One('production.route', 'Route',
|
route = fields.Many2One('production.route', 'Route',
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -5,10 +5,7 @@ from setuptools import setup
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import io
|
import io
|
||||||
try:
|
from configparser import ConfigParser
|
||||||
from configparser import ConfigParser
|
|
||||||
except ImportError:
|
|
||||||
from ConfigParser import ConfigParser
|
|
||||||
|
|
||||||
MODULE = 'production_operation'
|
MODULE = 'production_operation'
|
||||||
PREFIX = 'nantic'
|
PREFIX = 'nantic'
|
||||||
|
|
|
@ -173,7 +173,7 @@ Create an Inventory::
|
||||||
>>> inventory.save()
|
>>> inventory.save()
|
||||||
>>> Inventory.confirm([inventory.id], config.context)
|
>>> Inventory.confirm([inventory.id], config.context)
|
||||||
>>> inventory.state
|
>>> inventory.state
|
||||||
u'done'
|
'done'
|
||||||
|
|
||||||
Make a production::
|
Make a production::
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ Make a production::
|
||||||
True
|
True
|
||||||
>>> Production.wait([production.id], config.context)
|
>>> Production.wait([production.id], config.context)
|
||||||
>>> production.state
|
>>> production.state
|
||||||
u'waiting'
|
'waiting'
|
||||||
>>> Production.assign_try([production.id], config.context)
|
>>> Production.assign_try([production.id], config.context)
|
||||||
True
|
True
|
||||||
>>> production.reload()
|
>>> production.reload()
|
||||||
|
@ -236,6 +236,6 @@ Make a production::
|
||||||
>>> Operation.done(operations, config.context)
|
>>> Operation.done(operations, config.context)
|
||||||
>>> production.reload()
|
>>> production.reload()
|
||||||
>>> production.state
|
>>> production.state
|
||||||
u'done'
|
'done'
|
||||||
>>> production.cost
|
>>> production.cost
|
||||||
Decimal('100.0000')
|
Decimal('100.0000')
|
||||||
|
|
Loading…
Reference in New Issue