[tryton-debian-vcs] tryton-modules-stock branch upstream updated. upstream/4.0.1-1-gbd5e2bd

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Jul 12 13:06:06 UTC 2016


The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-stock.git;a=commitdiff;h=upstream/4.0.1-1-gbd5e2bd

commit bd5e2bdbb0676cd76fa081fb78bba63c38b7a6cd
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Jul 11 20:33:52 2016 +0200

    Adding upstream version 4.0.2.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index e779da6..cfd3b92 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.0.2 - 2016-07-04
+* Bug fixes (see mercurial logs for details)
+
 Version 4.0.1 - 2016-05-11
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 1f061f8..56abd43 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_stock
-Version: 4.0.1
+Version: 4.0.2
 Summary: Tryton module for stock and inventory
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/location.py b/location.py
index cbfac48..75e86c7 100644
--- a/location.py
+++ b/location.py
@@ -207,10 +207,11 @@ class Location(ModelSQL, ModelView):
 
     def get_warehouse(self, name):
         # Order by descending left to get the first one in the tree
-        locations = self.search([
-                ('parent', 'parent_of', [self.id]),
-                ('type', '=', 'warehouse'),
-                ], order=[('left', 'DESC')])
+        with Transaction().set_context(active_test=False):
+            locations = self.search([
+                    ('parent', 'parent_of', [self.id]),
+                    ('type', '=', 'warehouse'),
+                    ], order=[('left', 'DESC')])
         if locations:
             return locations[0].id
 
diff --git a/shipment.py b/shipment.py
index b9a4d6a..6ef8259 100644
--- a/shipment.py
+++ b/shipment.py
@@ -538,8 +538,15 @@ class ShipmentInReturn(Workflow, ModelSQL, ModelView):
                 & Eval('to_location')),
             },
         domain=[
-            ('from_location', '=', Eval('from_location')),
-            ('to_location', '=', Eval('to_location')),
+            If(Eval('state') == 'draft', [
+                    ('from_location', '=', Eval('from_location')),
+                    ('to_location', '=', Eval('to_location')),
+                    ], [
+                    ('from_location', 'child_of', [Eval('from_location', -1)],
+                        'parent'),
+                    ('to_location', 'child_of', [Eval('to_location', -1)],
+                        'parent'),
+                    ]),
             ('company', '=', Eval('company')),
             ],
         depends=['state', 'from_location', 'to_location', 'company'])
@@ -725,6 +732,13 @@ class ShipmentInReturn(Workflow, ModelSQL, ModelView):
         Move = Pool().get('stock.move')
         Move.draft([m for s in shipments for m in s.moves
                 if m.state != 'staging'])
+        for shipment in shipments:
+            Move.write([m for m in shipment.moves
+                    if m.state != 'done'], {
+                    'from_location': shipment.from_location.id,
+                    'to_location': shipment.to_location.id,
+                    'planned_date': shipment.planned_date,
+                    })
 
     @classmethod
     @ModelView.button
diff --git a/tryton.cfg b/tryton.cfg
index 06a5651..70c37dc 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.0.1
+version=4.0.2
 depends:
     company
     currency
diff --git a/trytond_stock.egg-info/PKG-INFO b/trytond_stock.egg-info/PKG-INFO
index ee8a9e6..4027549 100644
--- a/trytond_stock.egg-info/PKG-INFO
+++ b/trytond_stock.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond-stock
-Version: 4.0.1
+Version: 4.0.2
 Summary: Tryton module for stock and inventory
 Home-page: http://www.tryton.org/
 Author: Tryton
-- 
tryton-modules-stock



More information about the tryton-debian-vcs mailing list