[tryton-debian-vcs] tryton-modules-project branch upstream updated. upstream/3.0.2-1-g6004154
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:09:07 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.git;a=commitdiff;h=upstream/3.0.2-1-g6004154
commit 600415488c0f5ea122ab62022203610de6051d69
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 14:22:46 2014 +0200
Adding upstream version 3.2.0.
diff --git a/CHANGELOG b/CHANGELOG
index 3981baf..f2ff99e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,4 @@
-Version 3.0.2 - 2014-03-22
-* Bug fixes (see mercurial logs for details)
-
-Version 3.0.1 - 2013-12-04
+Version 3.2.0 - 2014-04-21
* Bug fixes (see mercurial logs for details)
Version 3.0.0 - 2013-10-21
diff --git a/INSTALL b/INSTALL
index 95510b8..5eb2860 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_project
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_timesheet (http://www.tryton.org/)
* trytond_party (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 732a76e..8d5ff8a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,5 @@
include INSTALL
include README
-include TODO
include COPYRIGHT
include CHANGELOG
include LICENSE
diff --git a/PKG-INFO b/PKG-INFO
index 0b982c4..ff3d846 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_project
-Version: 3.0.2
+Version: 3.2.0
Summary: Tryton module with 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
===============
@@ -43,6 +43,7 @@ Description: trytond_project
http://www.tryton.org/
+Keywords: tryton project
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/locale/ca_ES.po b/locale/ca_ES.po
index 25bfcd4..26bf138 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -112,15 +112,15 @@ msgstr "Línies de full de treball"
msgctxt "help:project.work,effort:"
msgid "Estimated Effort for this work"
-msgstr "L'esforç estimat per a aquest treball"
+msgstr "L'esforç estimat per a aquest treball."
msgctxt "help:project.work,hours:"
msgid "Total time spent on this work"
-msgstr "Temps total empleat en aquest treball"
+msgstr "Temps total empleat en aquest treball."
msgctxt "help:project.work,total_effort:"
msgid "Estimated total effort for this work and the sub-works"
-msgstr "Esforç total estimat per a aquest treball i les seves subactivitats"
+msgstr "Esforç total estimat per a aquest treball i les seves subactivitats."
msgctxt "model:ir.action,name:act_open_child_work"
msgid "Tasks"
@@ -180,7 +180,7 @@ msgstr "Projecte i tasca"
msgctxt "model:res.group,name:group_project_admin"
msgid "Project Administration"
-msgstr "Administració de projecte"
+msgstr "Administració de projectes"
msgctxt "selection:project.work,state:"
msgid "Done"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 0ca41fd..36e4cea 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -88,7 +88,7 @@ msgstr "Disponibilidad en los registros de tiempos"
msgctxt "field:project.work,total_effort:"
msgid "Total Effort"
-msgstr "Esfuerzo total"
+msgstr "Esfuerzo tTotal"
msgctxt "field:project.work,type:"
msgid "Type"
@@ -172,7 +172,7 @@ msgstr "Actividades"
msgctxt "model:ir.ui.menu,name:menu_work_tree"
msgid "Works Efforts"
-msgstr "Tareas"
+msgstr "Actividades"
msgctxt "model:project.work,name:"
msgid "Work Effort"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index 6114e70..b81cf21 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -180,7 +180,7 @@ msgstr "Proyecto y tarea"
msgctxt "model:res.group,name:group_project_admin"
msgid "Project Administration"
-msgstr "Administración de proyecto"
+msgstr "Administración de proyectos"
msgctxt "selection:project.work,state:"
msgid "Done"
@@ -188,7 +188,7 @@ msgstr "Realizado"
msgctxt "selection:project.work,state:"
msgid "Opened"
-msgstr "Abierta"
+msgstr "Abierto"
msgctxt "selection:project.work,type:"
msgid "Project"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index d4b2e7c..ab2fa87 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -180,7 +180,7 @@ msgstr "Effort de travail"
msgctxt "model:res.group,name:group_project_admin"
msgid "Project Administration"
-msgstr "Administrion de projets"
+msgstr "Administration des projets"
msgctxt "selection:project.work,state:"
msgid "Done"
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index fe5df19..cba525b 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -36,7 +36,7 @@ msgstr "Opomba"
msgctxt "field:project.work,company:"
msgid "Company"
-msgstr "Podjetje"
+msgstr "Družba"
msgctxt "field:project.work,create_date:"
msgid "Create Date"
@@ -64,7 +64,7 @@ msgstr "Matičnia dejavnost"
msgctxt "field:project.work,party:"
msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
msgctxt "field:project.work,party_address:"
msgid "Contact Address"
diff --git a/setup.py b/setup.py
index 30c0354..edabcc0 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'
+
+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',
- version=info.get('version', '0.0.1'),
+setup(name=name,
+ version=version,
description='Tryton module with 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',
package_dir={'trytond.modules.project': '.'},
packages=[
'trytond.modules.project',
@@ -67,7 +85,6 @@ setup(name='trytond_project',
'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.py b/tests/test_project.py
index b341780..0414da4 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -1,45 +1,112 @@
-#!/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
+from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
+from trytond.transaction import Transaction
class ProjectTestCase(unittest.TestCase):
- '''
- Test Project module.
- '''
+ 'Test Project module'
def setUp(self):
trytond.tests.test_tryton.install_module('project')
+ self.timesheet_work = POOL.get('timesheet.work')
+ self.project_work = POOL.get('project.work')
+ self.company = POOL.get('company.company')
def test0005views(self):
- '''
- Test views.
- '''
+ 'Test views'
test_view('project')
def test0006depends(self):
- '''
- Test depends.
- '''
+ 'Test depends'
test_depends()
+ def test0010sum_tree(self):
+ 'Test sum_tree'
+ with Transaction().start(DB_NAME, USER, context=CONTEXT):
+ company, = self.company.search([
+ ('rec_name', '=', 'Dunder Mifflin'),
+ ])
+
+ t_work_1, = self.timesheet_work.create([{
+ 'name': 'Work 1',
+ 'company': company.id,
+ }])
+ p_work_1, = self.project_work.create([{
+ 'work': t_work_1.id,
+ 'effort': 1,
+ }])
+
+ t_work_1_1, = self.timesheet_work.create([{
+ 'name': 'Work 1 1',
+ 'company': company.id,
+ 'parent': t_work_1.id,
+ }])
+ p_work_1_1, = self.project_work.create([{
+ 'work': t_work_1_1.id,
+ 'effort': 1,
+ }])
+
+ t_work_1_2, = self.timesheet_work.create([{
+ 'name': 'Work 1 1',
+ 'company': company.id,
+ 'parent': t_work_1.id,
+ }])
+ p_work_1_2, = self.project_work.create([{
+ 'work': t_work_1_2.id,
+ 'effort': 1,
+ }])
+
+ t_work_1_1_1, = self.timesheet_work.create([{
+ 'name': 'Work 1 1 1',
+ 'company': company.id,
+ 'parent': t_work_1_1.id,
+ }])
+ p_work_1_1_1, = self.project_work.create([{
+ 'work': t_work_1_1_1.id,
+ 'effort': 1,
+ }])
+
+ t_work_1_1_2, = self.timesheet_work.create([{
+ 'name': 'Work 1 1 2',
+ 'company': company.id,
+ 'parent': t_work_1_1.id,
+ }])
+ p_work_1_1_2, = self.project_work.create([{
+ 'work': t_work_1_1_2.id,
+ 'effort': 1,
+ }])
+
+ t_work_1_1_3, = self.timesheet_work.create([{
+ 'name': 'Work 1 1 2',
+ 'company': company.id,
+ 'parent': t_work_1_1.id,
+ }])
+ p_work_1_1_3, = self.project_work.create([{
+ 'work': t_work_1_1_3.id,
+ 'effort': 1,
+ }])
+
+ for work, total_effort in (
+ (p_work_1, 6),
+ (p_work_1_1, 4),
+ (p_work_1_2, 1),
+ (p_work_1_1_1, 1),
+ (p_work_1_1_2, 1),
+ (p_work_1_1_3, 1),
+ ):
+ self.assertEqual(work.total_effort, total_effort)
+
def suite():
suite = trytond.tests.test_tryton.suite()
+ from trytond.modules.company.tests import test_company
+ for test in test_company.suite():
+ if test not in suite:
+ suite.addTest(test)
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
ProjectTestCase))
return suite
-
-if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index 5e64596..1dd774e 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.0.2
+version=3.2.0
depends:
company_work_time
ir
diff --git a/trytond_project.egg-info/PKG-INFO b/trytond_project.egg-info/PKG-INFO
index 61274ad..0322b92 100644
--- a/trytond_project.egg-info/PKG-INFO
+++ b/trytond_project.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-project
-Version: 3.0.2
+Version: 3.2.0
Summary: Tryton module with 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
===============
@@ -43,6 +43,7 @@ Description: trytond_project
http://www.tryton.org/
+Keywords: tryton project
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.egg-info/requires.txt b/trytond_project.egg-info/requires.txt
index 1f7466c..90529bf 100644
--- a/trytond_project.egg-info/requires.txt
+++ b/trytond_project.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_company_work_time >= 3.0, < 3.1
-trytond_party >= 3.0, < 3.1
-trytond_timesheet >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_company_work_time >= 3.2, < 3.3
+trytond_party >= 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 ca16599..513cdd0 100644
--- a/work.py
+++ b/work.py
@@ -22,8 +22,7 @@ class Work(ModelSQL, ModelView):
('task', 'Task')
],
'Type', required=True, select=True)
- company = fields.Function(fields.Many2One('company.company', 'Company',
- on_change_with=['work']),
+ company = fields.Function(fields.Many2One('company.company', 'Company'),
'on_change_with_company', searcher='search_comany')
party = fields.Many2One('party.party', 'Party',
states={
@@ -35,13 +34,9 @@ class Work(ModelSQL, ModelView):
'invisible': Eval('type') != 'project',
}, depends=['party', 'type'])
timesheet_available = fields.Function(
- fields.Boolean('Available on timesheets', on_change_with=['work']),
+ fields.Boolean('Available on timesheets'),
'on_change_with_timesheet_available')
hours = fields.Function(fields.Float('Timesheet Hours', digits=(16, 2),
- states={
- 'invisible': ~Eval('timesheet_available'),
- },
- depends=['timesheet_available'], on_change_with=['work'],
help="Total time spent on this work"), 'on_change_with_hours')
effort = fields.Float("Effort",
states={
@@ -153,7 +148,7 @@ class Work(ModelSQL, ModelView):
return self.work.active
@classmethod
- def set_active(self, works, name, value):
+ def set_active(cls, works, name, value):
pool = Pool()
Work = pool.get('timesheet.work')
@@ -165,6 +160,7 @@ class Work(ModelSQL, ModelView):
def search_active(cls, name, clause):
return [('work.active',) + tuple(clause[1:])]
+ @fields.depends('work')
def on_change_with_company(self, name=None):
return self.work.company.id if self.work else None
@@ -172,9 +168,11 @@ class Work(ModelSQL, ModelView):
def search_comany(cls, name, clause):
return [('work.company',) + tuple(clause[1:])]
+ @fields.depends('work')
def on_change_with_timesheet_available(self, name=None):
return self.work.timesheet_available if self.work else None
+ @fields.depends('work')
def on_change_with_hours(self, name=None):
return self.work.hours if self.work else None
@@ -341,3 +339,9 @@ class Work(ModelSQL, ModelView):
super(Work, cls).delete(project_works)
TimesheetWork.delete(timesheet_works)
+
+ @classmethod
+ def search_global(cls, text):
+ for id_, rec_name, icon in super(Work, cls).search_global(text):
+ icon = icon or 'tryton-project'
+ yield id_, rec_name, icon
diff --git a/work.xml b/work.xml
index 36657f8..80174cc 100644
--- a/work.xml
+++ b/work.xml
@@ -133,7 +133,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">Tasks</field>
<field name="res_model">project.work</field>
<field name="context"></field>
- <field name="domain">[('parent', '=', Eval('active_id')), ('type', '=', 'task')]</field>
+ <field name="domain">[('parent', 'in', Eval('active_ids')), ('type', '=', 'task')]</field>
</record>
<record model="ir.action.keyword"
id="act_open_project_work_keyword1">
--
tryton-modules-project
More information about the tryton-debian-vcs
mailing list