diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..05648f2 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +build: + image: python:all + environment: + - POSTGRESQL_URI=postgresql://postgres@127.0.0.1:5432/ + - MYSQL_URI=mysql://root@127.0.0.1:3306/ + commands: + - pip install tox + - tox -e "{py27,py33,py34,py35}-{sqlite,postgresql}" --skip-missing-interpreters + services: + - postgres diff --git a/README b/README.md similarity index 76% rename from README rename to README.md index e4af776..d1cee73 100644 --- a/README +++ b/README.md @@ -3,6 +3,8 @@ This Module runs with the Tryton application platform. This module is developed and tested over a Tryton server and core modules. +[![Build Status](https://drone.io/bitbucket.org/datalife_sco/trytond-stock_product_category_location/status.png)](https://drone.io/bitbucket.org/datalife_sco/trytond-stock_product_category_location/latest) + Installing ---------- diff --git a/location.py b/location.py index eb09ad5..9618c55 100644 --- a/location.py +++ b/location.py @@ -104,9 +104,12 @@ class Location: states={ 'invisible': Not(Equal(Eval('type'), 'storage'))}, context={'current_location': Eval('id')}) + wh_categories = fields.One2Many('stock.product.category.location', 'warehouse', + 'Categories', states={'invisible': Not(Equal(Eval('type'), 'warehouse'))}, + context={'current_location': Eval('id')}) @classmethod def view_attributes(cls): return super(Location, cls).view_attributes() + [ ('//page[@id="categories"]', 'states', { - 'invisible': Eval('type') != 'storage'})] + 'invisible': ~Eval('type').in_(['warehouse', 'storage'])})] diff --git a/tests/scenario_stock_product_category_location.rst b/tests/scenario_stock_product_category_location.rst index 8969738..75433dc 100644 --- a/tests/scenario_stock_product_category_location.rst +++ b/tests/scenario_stock_product_category_location.rst @@ -13,10 +13,10 @@ Create database:: Install team_timesheet Module:: - >>> Module = Model.get('ir.module.module') + >>> Module = Model.get('ir.module') >>> module, = Module.find([('name', '=', 'stock_product_category_location')]) >>> module.click('install') - >>> Wizard('ir.module.module.install_upgrade').execute('upgrade') + >>> Wizard('ir.module.install_upgrade').execute('upgrade') Check default for warehouse field while allow new category to a location:: diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..3dda9ab --- /dev/null +++ b/tox.ini @@ -0,0 +1,17 @@ +[tox] +envlist = {py27,py33,py34,py35}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql} + +[testenv] +commands = {envpython} setup.py test +deps = + {py27,py33,py34,py35}-postgresql: psycopg2 >= 2.5 + pypy-postgresql: psycopg2cffi >= 2.5 + mysql: MySQL-python +setenv = + sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} + postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} + mysql: TRYTOND_DATABASE_URI={env:MYSQL_URI:mysql://} + sqlite: DB_NAME={env:SQLITE_NAME::memory:} + postgresql: DB_NAME={env:POSTGRESQL_NAME:test} + mysql: DB_NAME={env:MYSQL_NAME:test} +install_command = pip install --pre --find-links https://trydevpi.tryton.org/ {opts} {packages} diff --git a/tryton.cfg b/tryton.cfg index 4c2517f..a90e566 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=3.6.1 +version=3.8.1 depends: ir res diff --git a/view/location_form.xml b/view/location_form.xml index c8ac1d8..5f9c40b 100644 --- a/view/location_form.xml +++ b/view/location_form.xml @@ -7,6 +7,8 @@ + \ No newline at end of file