Upgrade to 3.2 version and increase version number

This commit is contained in:
Sergi Almacellas Abellana 2014-06-04 13:20:14 +02:00
parent 68797ab25f
commit 5f8c05b246
3 changed files with 8 additions and 22 deletions

View file

@ -10,8 +10,9 @@ class Location(ModelSQL, ModelView):
__name__ = 'stock.location' __name__ = 'stock.location'
warehouse = fields.Function(fields.Many2One('stock.location', 'Warehouse', warehouse = fields.Function(fields.Many2One('stock.location', 'Warehouse',
on_change_with=['parent'], states={
states={'invisible': Not(In(Eval('type'), ['storage', 'view']))}, 'invisible': Not(In(Eval('type'), ['storage', 'view']))
},
depends=['type']), depends=['type']),
'get_warehouse', searcher='search_warehouse') 'get_warehouse', searcher='search_warehouse')
@ -23,6 +24,7 @@ class Location(ModelSQL, ModelView):
'The Storage location must be unique.'), 'The Storage location must be unique.'),
] ]
@fields.depends('parent')
def on_change_with_warehouse(self, name=None): def on_change_with_warehouse(self, name=None):
if (not self.id or self.type not in ('storage', 'view') or if (not self.id or self.type not in ('storage', 'view') or
not self.parent): not self.parent):

View file

@ -1,35 +1,22 @@
#The COPYRIGHT file at the top level of this repository contains the full #The COPYRIGHT file at the top level of this repository contains the full
#copyright notices and license terms. #copyright notices and license terms.
import sys
import os
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
'..', '..', '..', '..', '..', 'trytond')))
if os.path.isdir(DIR):
sys.path.insert(0, os.path.dirname(DIR))
import unittest import unittest
import trytond.tests.test_tryton import trytond.tests.test_tryton
from trytond.tests.test_tryton import test_view, test_depends from trytond.tests.test_tryton import test_view, test_depends
class StockLocationWarehouseTestCase(unittest.TestCase): class StockLocationWarehouseTestCase(unittest.TestCase):
''' 'Test stock_location_warehouse module'
Test stock_location_warehouse module.
'''
def setUp(self): def setUp(self):
trytond.tests.test_tryton.install_module('stock_location_warehouse') trytond.tests.test_tryton.install_module('stock_location_warehouse')
def test0005views(self): def test0005views(self):
''' 'Test views'
Test views.
'''
test_view('stock_location_warehouse') test_view('stock_location_warehouse')
def test0006depends(self): def test0006depends(self):
''' 'Test depends'
Test depends.
'''
test_depends() test_depends()
@ -38,6 +25,3 @@ def suite():
suite.addTests(unittest.TestLoader().loadTestsFromTestCase( suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
StockLocationWarehouseTestCase)) StockLocationWarehouseTestCase))
return suite return suite
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())

View file

@ -1,5 +1,5 @@
[tryton] [tryton]
version=3.0.0 version=3.2.0
depends: depends:
ir ir
stock stock