[tryton-debian-vcs] tryton-modules-project-plan branch upstream updated. upstream/3.0.0-1-gc118ef7

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:09:18 UTC 2014


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

commit c118ef7645debd00e7bce27bfb4c401608d8c452
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:22:53 2014 +0200

    Adding upstream version 3.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index aa80594..47b3f54 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.2.0 - 2014-04-21
+* Bug fixes (see mercurial logs for details)
+
 Version 3.0.0 - 2013-10-21
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index fa3aaf4..8b958cc 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
 Copyright (C) 2009-2013 Bertrand Chenal.
-Copyright (C) 2009-2013 Cédric Krier.
-Copyright (C) 2009-2013 B2CK SPRL.
+Copyright (C) 2009-2014 Cédric Krier.
+Copyright (C) 2009-2014 B2CK SPRL.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/INSTALL b/INSTALL
index b777896..09ae425 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_project_plan
 Prerequisites
 -------------
 
- * Python 2.6 or later (http://www.python.org/)
+ * Python 2.7 or later (http://www.python.org/)
  * trytond (http://www.tryton.org/)
  * trytond_company (http://www.tryton.org/)
  * trytond_timesheet (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 99c60a7..92420a5 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,12 +1,10 @@
 include INSTALL
 include README
-include TODO
 include CHANGELOG
 include COPYRIGHT
 include LICENSE
 include tryton.cfg
 include *.xml
 include view/*.xml
-include *.odt
 include locale/*.po
 include doc/*
diff --git a/PKG-INFO b/PKG-INFO
index 9da5349..1966583 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_project_plan
-Version: 3.0.0
+Version: 3.2.0
 Summary: Tryton module to add planning capabilities on projects
 Home-page: http://www.tryton.org/
 Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
 Description: trytond_project_plan
         ====================
         
@@ -43,6 +43,7 @@ Description: trytond_project_plan
         
           http://www.tryton.org/
         
+Keywords: tryton project planning
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -63,6 +64,5 @@ Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
diff --git a/allocation.py b/allocation.py
index f39c9c8..cb75df7 100644
--- a/allocation.py
+++ b/allocation.py
@@ -29,12 +29,13 @@ class Allocation(ModelSQL, ModelView):
         return 100
 
     @classmethod
-    def write(cls, allocations, values):
+    def write(cls, *args):
         Work = Pool().get('project.work')
-        super(Allocation, cls).write(allocations, values)
+        super(Allocation, cls).write(*args)
 
         works = Work.search([
-                ('allocations', 'in', [a.id for a in allocations]),
+                ('allocations', 'in',
+                    [a.id for allocations in args[::2] for a in allocations]),
                 ])
 
         for work in works:
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 630d1ad..78254af 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -120,19 +120,19 @@ msgstr "Duración"
 
 msgctxt "field:project.work,early_finish_date:"
 msgid "Early Finish"
-msgstr "Final Temprano"
+msgstr "Finalizar Temprano"
 
 msgctxt "field:project.work,early_finish_time:"
 msgid "Early Finish Time"
-msgstr "Tiempo del Temprano Final"
+msgstr "Tiempo de Finalización Temprana"
 
 msgctxt "field:project.work,early_start_date:"
 msgid "Early Start"
-msgstr "Comienzo Temprano"
+msgstr "Iniciar Temprano"
 
 msgctxt "field:project.work,early_start_time:"
 msgid "Early Start Time"
-msgstr "Tiempo el Temprano Comienzo"
+msgstr "Tiempo de Inicio Temprano"
 
 msgctxt "field:project.work,late_finish_date:"
 msgid "Late Finish"
@@ -152,7 +152,7 @@ msgstr "Tiempo del Tardío Comienzo"
 
 msgctxt "field:project.work,leveling_delay:"
 msgid "Leveling Delay"
-msgstr "Retardo del Escalamiento"
+msgstr "Retardo de Nivel"
 
 msgctxt "field:project.work,predecessors:"
 msgid "Predecessors"
@@ -164,7 +164,7 @@ msgstr "Sucesores"
 
 msgctxt "model:ir.action,name:wizard_leveling"
 msgid "Tasks Leveling"
-msgstr "Escalamiento de Tareas"
+msgstr "Niveles de Tareas"
 
 msgctxt "model:project.allocation,name:"
 msgid "Allocation"
diff --git a/setup.py b/setup.py
index caa2737..cbfe25f 100644
--- a/setup.py
+++ b/setup.py
@@ -11,33 +11,51 @@ import ConfigParser
 def read(fname):
     return open(os.path.join(os.path.dirname(__file__), fname)).read()
 
+
+def get_require_version(name):
+    if minor_version % 2:
+        require = '%s >= %s.%s.dev0, < %s.%s'
+    else:
+        require = '%s >= %s.%s, < %s.%s'
+    require %= (name, major_version, minor_version,
+        major_version, minor_version + 1)
+    return require
+
 config = ConfigParser.ConfigParser()
 config.readfp(open('tryton.cfg'))
 info = dict(config.items('tryton'))
 for key in ('depends', 'extras_depend', 'xml'):
     if key in info:
         info[key] = info[key].strip().splitlines()
-major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
+version = info.get('version', '0.0.1')
+major_version, minor_version, _ = version.split('.', 2)
 major_version = int(major_version)
 minor_version = int(minor_version)
+name = 'trytond_project_plan'
+
+download_url = 'http://downloads.tryton.org/%s.%s/' % (
+    major_version, minor_version)
+if minor_version % 2:
+    version = '%s.%s.dev0' % (major_version, minor_version)
+    download_url = (
+        'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % (
+            name[8:], name, version))
 
 requires = []
 for dep in info.get('depends', []):
     if not re.match(r'(ir|res|webdav)(\W|$)', dep):
-        requires.append('trytond_%s >= %s.%s, < %s.%s' %
-            (dep, major_version, minor_version, major_version,
-                minor_version + 1))
-requires.append('trytond >= %s.%s, < %s.%s' %
-    (major_version, minor_version, major_version, minor_version + 1))
+        requires.append(get_require_version('trytond_%s' % dep))
+requires.append(get_require_version('trytond'))
 
-setup(name='trytond_project_plan',
-    version=info.get('version', '0.0.1'),
+setup(name=name,
+    version=version,
     description='Tryton module to add planning capabilities on projects',
     long_description=read('README'),
     author='Tryton',
+    author_email='issue_tracker at tryton.org',
     url='http://www.tryton.org/',
-    download_url=("http://downloads.tryton.org/" +
-        info.get('version', '0.0.1').rsplit('.', 1)[0] + '/'),
+    download_url=download_url,
+    keywords='tryton project planning',
     package_dir={'trytond.modules.project_plan': '.'},
     packages=[
         'trytond.modules.project_plan',
@@ -67,7 +85,6 @@ setup(name='trytond_project_plan',
         'Natural Language :: Slovenian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
-        'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
         'Topic :: Office/Business',
         ],
diff --git a/tests/test_project_plan.py b/tests/test_project_plan.py
index b1ab311..c740c86 100644
--- a/tests/test_project_plan.py
+++ b/tests/test_project_plan.py
@@ -1,37 +1,22 @@
-#!/usr/bin/env python
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full 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 trytond.tests.test_tryton
 from trytond.tests.test_tryton import test_view, test_depends
 
 
 class ProjectPlanTestCase(unittest.TestCase):
-    '''
-    Test ProjectPlan module.
-    '''
+    'Test ProjectPlan module'
 
     def setUp(self):
         trytond.tests.test_tryton.install_module('project_plan')
 
     def test0005views(self):
-        '''
-        Test views.
-        '''
+        'Test views'
         test_view('project_plan')
 
     def test0006depends(self):
-        '''
-        Test depends.
-        '''
+        'Test depends'
         test_depends()
 
 
@@ -40,6 +25,3 @@ def suite():
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
         ProjectPlanTestCase))
     return suite
-
-if __name__ == '__main__':
-    unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index 07263a1..67977fc 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.0
+version=3.2.0
 depends:
     ir
     company
diff --git a/trytond_project_plan.egg-info/PKG-INFO b/trytond_project_plan.egg-info/PKG-INFO
index 8880099..9d21c35 100644
--- a/trytond_project_plan.egg-info/PKG-INFO
+++ b/trytond_project_plan.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-project-plan
-Version: 3.0.0
+Version: 3.2.0
 Summary: Tryton module to add planning capabilities on projects
 Home-page: http://www.tryton.org/
 Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
 Description: trytond_project_plan
         ====================
         
@@ -43,6 +43,7 @@ Description: trytond_project_plan
         
           http://www.tryton.org/
         
+Keywords: tryton project planning
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -63,6 +64,5 @@ Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
diff --git a/trytond_project_plan.egg-info/requires.txt b/trytond_project_plan.egg-info/requires.txt
index cc7dd7c..1cb83c1 100644
--- a/trytond_project_plan.egg-info/requires.txt
+++ b/trytond_project_plan.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_company >= 3.0, < 3.1
-trytond_project >= 3.0, < 3.1
-trytond_timesheet >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_company >= 3.2, < 3.3
+trytond_project >= 3.2, < 3.3
+trytond_timesheet >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
diff --git a/work.py b/work.py
index 824ccda..f7a065d 100644
--- a/work.py
+++ b/work.py
@@ -109,11 +109,12 @@ class Work:
 
                 total_allocation = 0
                 if not work.allocations:
-                    durations[work.id] = work.effort
+                    durations[work.id] = (work.effort or 0)
                     continue
                 for allocation in work.allocations:
                     total_allocation += allocation.percentage
-                durations[work.id] = work.effort / (total_allocation / 100.0)
+                durations[work.id] = ((work.effort or 0)
+                    / (total_allocation / 100.0))
 
             while leafs:
                 for work_id in leafs:
@@ -536,17 +537,19 @@ class Work:
             self.parent.compute_dates()
 
     @classmethod
-    def write(cls, works, values):
-        super(Work, cls).write(works, values)
-
-        if 'effort' in values:
-            for work in works:
-                work.reset_leveling()
-        fields = ('constraint_start_time', 'constraint_finish_time',
-                  'effort')
-        if reduce(lambda x, y: x or y in values, fields, False):
-            for work in works:
-                work.compute_dates()
+    def write(cls, *args):
+        super(Work, cls).write(*args)
+
+        actions = iter(args)
+        for works, values in zip(actions, actions):
+            if 'effort' in values:
+                for work in works:
+                    work.reset_leveling()
+            fields = ('constraint_start_time', 'constraint_finish_time',
+                      'effort')
+            if reduce(lambda x, y: x or y in values, fields, False):
+                for work in works:
+                    work.compute_dates()
 
     @classmethod
     def create(cls, vlist):
@@ -580,11 +583,14 @@ class PredecessorSuccessor(ModelSQL):
             ondelete='CASCADE', required=True, select=True)
 
     @classmethod
-    def write(cls, pred_succs, values):
+    def write(cls, *args):
         Work = Pool().get('project.work')
-        super(PredecessorSuccessor, cls).write(pred_succs, values)
+        super(PredecessorSuccessor, cls).write(*args)
 
-        works = Work.browse(values.itervalues())
+        work_ids = [v for values in args[1::2]
+            for k, v in values.itervalues()
+            if k in ('predecessor', 'successor')]
+        works = Work.browse(work_ids)
         for work in works:
             work.reset_leveling()
         for work in works:
-- 
tryton-modules-project-plan



More information about the tryton-debian-vcs mailing list