mirror of
https://github.com/NaN-tic/trytond-stock_external_reception_lot.git
synced 2023-12-14 03:22:54 +01:00
Migrate to python 3
This commit is contained in:
parent
43f800a3d7
commit
1d04ef5dd6
3 changed files with 7 additions and 8 deletions
4
setup.py
4
setup.py
|
@ -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'):
|
||||
|
|
3
stock.py
3
stock.py
|
@ -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=[
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue