[tryton-debian-vcs] tryton-modules-stock branch upstream updated. upstream/4.0.3-1-g4b7108f

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Nov 8 09:32:50 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.3-1-g4b7108f

commit 4b7108fbe41db2c5567b438243edb16efa43901d
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Nov 8 09:21:54 2016 +0100

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

diff --git a/CHANGELOG b/CHANGELOG
index 8bc82f4..a985d29 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.0.4 - 2016-11-06
+* Bug fixes (see mercurial logs for details)
+
 Version 4.0.3 - 2016-09-03
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 6e527d3..4eaf904 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_stock
-Version: 4.0.3
+Version: 4.0.4
 Summary: Tryton module for stock and inventory
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/move.py b/move.py
index 6dec253..83de17f 100644
--- a/move.py
+++ b/move.py
@@ -5,6 +5,7 @@ import operator
 from decimal import Decimal
 from functools import partial
 from collections import OrderedDict, defaultdict
+from itertools import groupby
 
 from sql import Literal, Union, Column, Null
 from sql.aggregate import Sum
@@ -514,19 +515,21 @@ class Move(Workflow, ModelSQL, ModelView):
     @classmethod
     def check_period_closed(cls, moves):
         Period = Pool().get('stock.period')
-        periods = Period.search([
-                ('state', '=', 'closed'),
-                ], order=[('date', 'DESC')], limit=1)
-        if periods:
-            period, = periods
-            for move in moves:
-                date = (move.effective_date if move.effective_date
-                    else move.planned_date)
-                if date and date < period.date:
-                    cls.raise_user_error('period_closed', {
-                            'move': move.rec_name,
-                            'period': period.rec_name,
-                            })
+        for company, moves in groupby(moves, lambda m: m.company):
+            periods = Period.search([
+                    ('state', '=', 'closed'),
+                    ('company', '=', company.id),
+                    ], order=[('date', 'DESC')], limit=1)
+            if periods:
+                period, = periods
+                for move in moves:
+                    date = (move.effective_date if move.effective_date
+                        else move.planned_date)
+                    if date and date < period.date:
+                        cls.raise_user_error('period_closed', {
+                                'move': move.rec_name,
+                                'period': period.rec_name,
+                                })
 
     def get_rec_name(self, name):
         return ("%s%s %s"
diff --git a/tryton.cfg b/tryton.cfg
index 4223d52..64ac800 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.0.3
+version=4.0.4
 depends:
     company
     currency
diff --git a/trytond_stock.egg-info/PKG-INFO b/trytond_stock.egg-info/PKG-INFO
index db7a4dc..f8e9675 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.3
+Version: 4.0.4
 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