Migrate to python 3
This commit is contained in:
parent
9fc5d38c5e
commit
cf9f872377
4
setup.py
4
setup.py
|
@ -4,7 +4,7 @@
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import ConfigParser
|
import configparser
|
||||||
|
|
||||||
MODULE = 'production_package'
|
MODULE = 'production_package'
|
||||||
PREFIX = 'nantic'
|
PREFIX = 'nantic'
|
||||||
|
@ -14,7 +14,7 @@ MODULE2PREFIX = {}
|
||||||
def read(fname):
|
def read(fname):
|
||||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||||
|
|
||||||
config = ConfigParser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.readfp(open('tryton.cfg'))
|
config.readfp(open('tryton.cfg'))
|
||||||
info = dict(config.items('tryton'))
|
info = dict(config.items('tryton'))
|
||||||
for key in ('depends', 'extras_depend', 'xml'):
|
for key in ('depends', 'extras_depend', 'xml'):
|
||||||
|
|
9
stock.py
9
stock.py
|
@ -4,10 +4,9 @@ from trytond.pool import PoolMeta
|
||||||
from trytond.pyson import Eval
|
from trytond.pyson import Eval
|
||||||
|
|
||||||
__all__ = ['Package', 'Move', 'Production', 'ShipmentOut']
|
__all__ = ['Package', 'Move', 'Production', 'ShipmentOut']
|
||||||
__metaclass__ = PoolMeta
|
|
||||||
|
|
||||||
|
|
||||||
class Package:
|
class Package(metaclass=PoolMeta):
|
||||||
__name__ = 'stock.package'
|
__name__ = 'stock.package'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -23,7 +22,7 @@ class Package:
|
||||||
cls.moves.add_remove.append(value)
|
cls.moves.add_remove.append(value)
|
||||||
|
|
||||||
|
|
||||||
class Move:
|
class Move(metaclass=PoolMeta):
|
||||||
__name__ = 'stock.move'
|
__name__ = 'stock.move'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -36,7 +35,7 @@ class Move:
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class Production:
|
class Production(metaclass=PoolMeta):
|
||||||
__name__ = 'production'
|
__name__ = 'production'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -49,7 +48,7 @@ class Production:
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class ShipmentOut:
|
class ShipmentOut(metaclass=PoolMeta):
|
||||||
__name__ = 'stock.shipment.out'
|
__name__ = 'stock.shipment.out'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -130,7 +130,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 and pack it's outputs::
|
Make a production and pack it's outputs::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue