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
|
||||
import re
|
||||
import os
|
||||
import ConfigParser
|
||||
import configparser
|
||||
|
||||
MODULE = 'production_package'
|
||||
PREFIX = 'nantic'
|
||||
|
@ -14,7 +14,7 @@ MODULE2PREFIX = {}
|
|||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
config = configparser.ConfigParser()
|
||||
config.readfp(open('tryton.cfg'))
|
||||
info = dict(config.items('tryton'))
|
||||
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
|
||||
|
||||
__all__ = ['Package', 'Move', 'Production', 'ShipmentOut']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class Package:
|
||||
class Package(metaclass=PoolMeta):
|
||||
__name__ = 'stock.package'
|
||||
|
||||
@classmethod
|
||||
|
@ -23,7 +22,7 @@ class Package:
|
|||
cls.moves.add_remove.append(value)
|
||||
|
||||
|
||||
class Move:
|
||||
class Move(metaclass=PoolMeta):
|
||||
__name__ = 'stock.move'
|
||||
|
||||
@classmethod
|
||||
|
@ -36,7 +35,7 @@ class Move:
|
|||
})
|
||||
|
||||
|
||||
class Production:
|
||||
class Production(metaclass=PoolMeta):
|
||||
__name__ = 'production'
|
||||
|
||||
@classmethod
|
||||
|
@ -49,7 +48,7 @@ class Production:
|
|||
})
|
||||
|
||||
|
||||
class ShipmentOut:
|
||||
class ShipmentOut(metaclass=PoolMeta):
|
||||
__name__ = 'stock.shipment.out'
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -130,7 +130,7 @@ Create an Inventory::
|
|||
>>> inventory.save()
|
||||
>>> Inventory.confirm([inventory.id], config.context)
|
||||
>>> inventory.state
|
||||
u'done'
|
||||
'done'
|
||||
|
||||
Make a production and pack it's outputs::
|
||||
|
||||
|
|
Loading…
Reference in New Issue