Migrate to python 3

This commit is contained in:
Albert Cervera i Areny 2018-10-29 01:16:37 +01:00
parent 43f800a3d7
commit 1d04ef5dd6
3 changed files with 7 additions and 8 deletions

View file

@ -4,7 +4,7 @@
from setuptools import setup
import re
import os
import ConfigParser
import configparser
MODULE = 'stock_external_reception_lot'
PREFIX = 'nantic'
@ -24,7 +24,7 @@ def get_require_version(name):
major_version, minor_version + 1)
return require
config = ConfigParser.ConfigParser()
config = configparser.ConfigParser()
config.readfp(open('tryton.cfg'))
info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'):

View file

@ -5,10 +5,9 @@ from trytond.pool import PoolMeta
from trytond.pyson import Eval
__all__ = ['ExternalReceptionLine']
__metaclass__ = PoolMeta
class ExternalReceptionLine:
class ExternalReceptionLine(metaclass=PoolMeta):
__name__ = 'stock.external.reception.line'
lot_number = fields.Char('Lot Number')
lot = fields.Many2One('stock.lot', 'Lot', domain=[

View file

@ -99,7 +99,7 @@ product::
>>> line.product = product
>>> line.lot = lot1
>>> line.lot.number
u'1'
'1'
>>> line.product = product2
>>> line.lot is None
True
@ -110,7 +110,7 @@ product that requires lot::
>>> reception.click('done') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
...
UserError: ('UserError', (u'Lot is required for move of product "Product".', ''))
UserError: ('UserError', ('Lot is required for move of product "Product".', ''))
>>> line, = reception.lines
>>> line.lot = lot2
>>> reception.click('done')
@ -118,12 +118,12 @@ product that requires lot::
>>> shipment.party == reception.party
True
>>> shipment.state
u'done'
'done'
>>> shipment.effective_date == reception.effective_date
True
>>> move, = shipment.moves
>>> move.state
u'done'
'done'
>>> move.product == product2
True
>>> move.lot == lot2