mirror of
https://github.com/NaN-tic/trytond-stock_lot_attribute.git
synced 2023-12-14 04:03:02 +01:00
update to 4.7
This commit is contained in:
parent
e52b2390be
commit
bc82edbe52
43
setup.py
43
setup.py
|
@ -4,7 +4,11 @@
|
|||
from setuptools import setup
|
||||
import re
|
||||
import os
|
||||
import ConfigParser
|
||||
import io
|
||||
try:
|
||||
from configparser import ConfigParser
|
||||
except ImportError:
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
MODULE = 'stock_lot_attribute'
|
||||
PREFIX = 'nantic'
|
||||
|
@ -12,7 +16,9 @@ MODULE2PREFIX = {}
|
|||
|
||||
|
||||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
return io.open(
|
||||
os.path.join(os.path.dirname(__file__), fname),
|
||||
'r', encoding='utf-8').read()
|
||||
|
||||
|
||||
def get_require_version(name):
|
||||
|
@ -24,7 +30,7 @@ def get_require_version(name):
|
|||
major_version, minor_version + 1)
|
||||
return require
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
config = ConfigParser()
|
||||
config.readfp(open('tryton.cfg'))
|
||||
info = dict(config.items('tryton'))
|
||||
for key in ('depends', 'extras_depend', 'xml'):
|
||||
|
@ -38,14 +44,26 @@ minor_version = int(minor_version)
|
|||
|
||||
requires = []
|
||||
for dep in info.get('depends', []):
|
||||
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
|
||||
if not re.match(r'(ir|res)(\W|$)', dep):
|
||||
prefix = MODULE2PREFIX.get(dep, 'trytond')
|
||||
requires.append('%s_%s >= %s.%s, < %s.%s' %
|
||||
(prefix, dep, major_version, minor_version,
|
||||
major_version, minor_version + 1))
|
||||
requires.append(get_require_version('%s_%s' % (prefix, dep)))
|
||||
requires.append(get_require_version('trytond'))
|
||||
|
||||
tests_require = [get_require_version('proteus')]
|
||||
tests_require = [
|
||||
get_require_version('proteus'),
|
||||
]
|
||||
|
||||
series = '%s.%s' % (major_version, minor_version)
|
||||
if minor_version % 2:
|
||||
branch = 'default'
|
||||
else:
|
||||
branch = series
|
||||
|
||||
dependency_links = []
|
||||
|
||||
if minor_version % 2:
|
||||
# Add development index for testing with proteus
|
||||
dependency_links.append('https://trydevpi.tryton.org/')
|
||||
|
||||
setup(name='%s_%s' % (PREFIX, MODULE),
|
||||
version=version,
|
||||
|
@ -82,12 +100,17 @@ setup(name='%s_%s' % (PREFIX, MODULE),
|
|||
'Natural Language :: Russian',
|
||||
'Natural Language :: Spanish',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: Implementation :: CPython',
|
||||
'Programming Language :: Python :: Implementation :: PyPy',
|
||||
'Topic :: Office/Business',
|
||||
],
|
||||
license='GPL-3',
|
||||
install_requires=requires,
|
||||
dependency_links=dependency_links,
|
||||
zip_safe=False,
|
||||
entry_points="""
|
||||
[trytond.modules]
|
||||
|
@ -96,4 +119,6 @@ setup(name='%s_%s' % (PREFIX, MODULE),
|
|||
test_suite='tests',
|
||||
test_loader='trytond.test_loader:Loader',
|
||||
tests_require=tests_require,
|
||||
use_2to3=True,
|
||||
convert_2to3_doctests=[],
|
||||
)
|
||||
|
|
5
stock.py
5
stock.py
|
@ -4,7 +4,6 @@ from trytond.model import ModelSQL, ModelView, DictSchemaMixin, fields
|
|||
from trytond.pool import PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
|
||||
__metaclass__ = PoolMeta
|
||||
__all__ = ['LotAttributeSet', 'LotAttribute', 'LotAttributeAttributeSet',
|
||||
'Template', 'Lot']
|
||||
|
||||
|
@ -36,11 +35,15 @@ class LotAttributeAttributeSet(ModelSQL):
|
|||
|
||||
class Template:
|
||||
__name__ = 'product.template'
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
lot_attribute_set = fields.Many2One('stock.lot.attribute.set', 'Lot Set')
|
||||
|
||||
|
||||
class Lot:
|
||||
__name__ = 'stock.lot'
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
attributes = fields.Dict('stock.lot.attribute', 'Attributes',
|
||||
domain=[
|
||||
('sets', '=', Eval('attribute_set', -1)),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=4.1.0
|
||||
version=4.7.0
|
||||
depends:
|
||||
stock_lot
|
||||
xml:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<form string="Attribute">
|
||||
<form>
|
||||
<label name="name"/>
|
||||
<field name="name"/>
|
||||
<label name="string"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="Attributes">
|
||||
<tree>
|
||||
<field name="name" expand="1"/>
|
||||
<field name="string" expand="1"/>
|
||||
<field name="type_"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<form string="Attribute Set">
|
||||
<form>
|
||||
<label name="name"/>
|
||||
<field name="name"/>
|
||||
<newline/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="Attribute Sets">
|
||||
<tree>
|
||||
<field name="name" expand="1"/>
|
||||
</tree>
|
||||
|
|
Loading…
Reference in a new issue