[tryton-debian-vcs] tryton-modules-company branch debian updated. debian/4.0.1-1-3-g2e5d17a

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


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

commit 2e5d17a60e90c3c80f1f3441f1d00116be0cbe08
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Jul 11 20:16:14 2016 +0200

    Releasing debian version 4.0.2-1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/debian/changelog b/debian/changelog
index 9d4c8ee..0427299 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-modules-company (4.0.2-1) unstable; urgency=medium
+
+  * Updating to Standards-Version: 3.9.8, no changes needed.
+  * Merging upstream version 4.0.2.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Mon, 11 Jul 2016 20:16:14 +0200
+
 tryton-modules-company (4.0.1-1) unstable; urgency=medium
 
   * Updating signing-key.asc with the actual upstream maintainer keys.
commit e5fabe621bd4e56c57f684cfce6905447a17d3ea
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Jul 11 20:16:14 2016 +0200

    Merging upstream version 4.0.2.

diff --git a/CHANGELOG b/CHANGELOG
index 632dbf1..fbdddfa 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.0.2 - 2016-07-05
+* 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 bd1dd5c..c7d4683 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_company
-Version: 4.0.1
+Version: 4.0.2
 Summary: Tryton module with companies and employees
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/cron.py b/cron.py
index 27b4243..7a5aed1 100644
--- a/cron.py
+++ b/cron.py
@@ -1,6 +1,6 @@
 # This file is part of Tryton.  The COPYRIGHT file at the top level of
 # this repository contains the full copyright notices and license terms.
-from trytond.model import ModelSQL, fields
+from trytond.model import ModelSQL, ModelView, fields, dualmethod
 from trytond.pool import Pool, PoolMeta
 from trytond.transaction import Transaction
 
@@ -14,23 +14,26 @@ class Cron:
     companies = fields.Many2Many('ir.cron-company.company', 'cron', 'company',
             'Companies', help='Companies registered for this cron')
 
-    @classmethod
-    def _callback(cls, cron):
+    @dualmethod
+    @ModelView.button
+    def run_once(cls, crons):
         User = Pool().get('res.user')
-        if not cron.companies:
-            return super(Cron, cls)._callback(cron)
-        # TODO replace with context
-        for company in cron.companies:
-            User.write([cron.user], {
-                    'company': company.id,
-                    'main_company': company.id,
-                    })
-            with Transaction().set_context(company=company.id):
-                super(Cron, cls)._callback(cron)
-        User.write([cron.user], {
-                'company': None,
-                'main_company': None,
-                })
+        for cron in crons:
+            if not cron.companies:
+                super(Cron, cls).run_once([cron])
+            else:
+                # TODO replace with context
+                for company in cron.companies:
+                    User.write([cron.user], {
+                            'company': company.id,
+                            'main_company': company.id,
+                            })
+                    with Transaction().set_context(company=company.id):
+                        super(Cron, cls).run_once([cron])
+                User.write([cron.user], {
+                        'company': None,
+                        'main_company': None,
+                        })
 
     @staticmethod
     def default_companies():
diff --git a/tryton.cfg b/tryton.cfg
index 64285cf..7e83183 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.0.1
+version=4.0.2
 depends:
     currency
     ir
diff --git a/trytond_company.egg-info/PKG-INFO b/trytond_company.egg-info/PKG-INFO
index 51e78fe..ddc20af 100644
--- a/trytond_company.egg-info/PKG-INFO
+++ b/trytond_company.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond-company
-Version: 4.0.1
+Version: 4.0.2
 Summary: Tryton module with companies and employees
 Home-page: http://www.tryton.org/
 Author: Tryton
-- 
tryton-modules-company



More information about the tryton-debian-vcs mailing list