[tryton-debian-vcs] tryton-modules-timesheet branch upstream updated. upstream/3.0.0-1-g613c4de
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:11:43 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-timesheet.git;a=commitdiff;h=upstream/3.0.0-1-g613c4de
commit 613c4de293994b539e5611510fb8795b05ae0dca
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 14:24:07 2014 +0200
Adding upstream version 3.2.0.
diff --git a/CHANGELOG b/CHANGELOG
index 9dc6baf..15a178e 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 9192c97..5134c09 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2013 Cédric Krier.
+Copyright (C) 2008-2014 Cédric Krier.
Copyright (C) 2008-2013 Bertrand Chenal.
-Copyright (C) 2008-2013 B2CK SPRL.
+Copyright (C) 2008-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 0b5f2eb..069fe6f 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_timesheet
Prerequisites
-------------
- * Python 2.6 or later (http://www.python.org/)
+ * Python 2.7 or later (http://www.python.org/)
* python-sql (http://code.google.com/p/python-sql/)
* trytond (http://www.tryton.org/)
* trytond_company (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 2569955..e013c00 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,12 +1,10 @@
include INSTALL
include README
-include TODO
include COPYRIGHT
include CHANGELOG
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 c597dcd..0d4f2de 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_timesheet
-Version: 3.0.0
+Version: 3.2.0
Summary: Tryton module with timesheets
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_timesheet
=================
@@ -43,6 +43,7 @@ Description: trytond_timesheet
http://www.tryton.org/
+Keywords: tryton timesheet
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/line.py b/line.py
index f310df6..d24160b 100644
--- a/line.py
+++ b/line.py
@@ -44,6 +44,7 @@ class Line(ModelSQL, ModelView):
@classmethod
def __setup__(cls):
super(Line, cls).__setup__()
+ cls._order.insert(0, ('date', 'DESC'))
cls._sql_constraints += [
('check_move_hours_pos',
'CHECK(hours >= 0.0)', 'Hours field must be positive'),
diff --git a/line.xml b/line.xml
index 425ceda..4530afb 100644
--- a/line.xml
+++ b/line.xml
@@ -35,7 +35,7 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.action.act_window" id="act_line_form_work">
<field name="name">Timesheet Lines</field>
<field name="res_model">timesheet.line</field>
- <field name="domain">[('work', '=', Eval('id'))]</field>
+ <field name="domain">[('work', 'in', Eval('active_ids'))]</field>
</record>
<record model="ir.action.act_window.view"
id="act_line_form_work_view1">
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index 18f4123..ff4e76d 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -254,9 +254,10 @@ msgctxt "field:timesheet.work,timesheet_end_date:"
msgid "Timesheet End"
msgstr ""
+#, fuzzy
msgctxt "field:timesheet.work,timesheet_lines:"
-msgid ""
-msgstr ""
+msgid "Timesheet Lines"
+msgstr "Редове от график"
msgctxt "field:timesheet.work,timesheet_start_date:"
msgid "Timesheet Start"
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index dbc9343..9a70f66 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:timesheet.line:"
msgid "Hours field must be positive"
-msgstr "El camp d'hores ha de ser positiu"
+msgstr "El camp Hores ha de ser positiu."
msgctxt "error:timesheet.work:"
msgid ""
@@ -258,10 +258,9 @@ msgctxt "field:timesheet.work,timesheet_end_date:"
msgid "Timesheet End"
msgstr "Final de full de treball"
-#, fuzzy
msgctxt "field:timesheet.work,timesheet_lines:"
-msgid ""
-msgstr ""
+msgid "Timesheet Lines"
+msgstr "Línies del full de treball"
msgctxt "field:timesheet.work,timesheet_start_date:"
msgid "Timesheet Start"
@@ -289,7 +288,7 @@ msgstr "Fins a la data"
msgctxt "help:timesheet.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:timesheet.work,timesheet_available:"
msgid "Allow to fill in timesheets with this work"
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 9249bd1..0e1a942 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -260,8 +260,8 @@ msgid "Timesheet End"
msgstr "Zeiterfassung Ende"
msgctxt "field:timesheet.work,timesheet_lines:"
-msgid ""
-msgstr ""
+msgid "Timesheet Lines"
+msgstr "Zeitpositionen"
msgctxt "field:timesheet.work,timesheet_start_date:"
msgid "Timesheet Start"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 20a4d52..fd928fe 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -259,8 +259,8 @@ msgid "Timesheet End"
msgstr "Fin de parte de trabajo"
msgctxt "field:timesheet.work,timesheet_lines:"
-msgid ""
-msgstr ""
+msgid "Timesheet Lines"
+msgstr "Líneas del parte de trabajo"
msgctxt "field:timesheet.work,timesheet_start_date:"
msgid "Timesheet Start"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index d0a70dc..f02f067 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -48,7 +48,7 @@ msgstr "Nombre"
msgctxt "field:timesheet.hours_employee,write_date:"
msgid "Write Date"
-msgstr "Modificado por Usuario"
+msgstr "Fecha de Modificación"
msgctxt "field:timesheet.hours_employee,write_uid:"
msgid "Write User"
@@ -96,7 +96,7 @@ msgstr "Nombre"
msgctxt "field:timesheet.hours_employee_monthly,write_date:"
msgid "Write Date"
-msgstr "Modificado por Usuario"
+msgstr "Fecha de Modificación"
msgctxt "field:timesheet.hours_employee_monthly,write_uid:"
msgid "Write User"
@@ -136,7 +136,7 @@ msgstr "Semana"
msgctxt "field:timesheet.hours_employee_weekly,write_date:"
msgid "Write Date"
-msgstr "Modificado por Usuario"
+msgstr "Fecha de Modificación"
msgctxt "field:timesheet.hours_employee_weekly,write_uid:"
msgid "Write User"
@@ -184,7 +184,7 @@ msgstr "Trabajo"
msgctxt "field:timesheet.line,write_date:"
msgid "Write Date"
-msgstr "Modificado por Usuario"
+msgstr "Fecha de Modificación"
msgctxt "field:timesheet.line,write_uid:"
msgid "Write User"
@@ -268,7 +268,7 @@ msgstr "Inicio de Registro de Tiempo"
msgctxt "field:timesheet.work,write_date:"
msgid "Write Date"
-msgstr "Modificado por Usuario"
+msgstr "Fecha de Modificación"
msgctxt "field:timesheet.work,write_uid:"
msgid "Write User"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index aabd8b2..f915484 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -259,8 +259,8 @@ msgid "Timesheet End"
msgstr "Fin de parte de trabajo"
msgctxt "field:timesheet.work,timesheet_lines:"
-msgid ""
-msgstr ""
+msgid "Timesheet Lines"
+msgstr "Líneas de parte de trabajo"
msgctxt "field:timesheet.work,timesheet_start_date:"
msgid "Timesheet Start"
@@ -400,7 +400,7 @@ msgstr "Horas por trabajo"
msgctxt "model:res.group,name:group_timesheet_admin"
msgid "Timesheet Administration"
-msgstr "Administración de parte de trabajo"
+msgstr "Administración de partes de trabajo"
msgctxt "model:timesheet.hours_employee,name:"
msgid "Hours per Employee"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index d05dbb9..ba9a2ff 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -259,8 +259,8 @@ msgid "Timesheet End"
msgstr "Fin de feuille de présence"
msgctxt "field:timesheet.work,timesheet_lines:"
-msgid ""
-msgstr ""
+msgid "Timesheet Lines"
+msgstr "Lignes de feuille de présence"
msgctxt "field:timesheet.work,timesheet_start_date:"
msgid "Timesheet Start"
@@ -400,7 +400,7 @@ msgstr "Heures par travail"
msgctxt "model:res.group,name:group_timesheet_admin"
msgid "Timesheet Administration"
-msgstr "Administration feuille de présence"
+msgstr "Administration des feuilles de présence"
msgctxt "model:timesheet.hours_employee,name:"
msgid "Hours per Employee"
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index 588e1c5..bb1a355 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -11,8 +11,8 @@ msgid ""
"Every work must be in the same company as it's parent work but \"%(child)s\""
" and \"%(parent)s\" are in different companies."
msgstr ""
-"Vsaka dejavnost mora biti v istem podjetju kot njena matična dejavnost, "
-"vendar sta \"%(child)s\" in \"%(parent)s\" v različnih podjetjih."
+"Vsaka dejavnost mora biti v isti družbi kot njena matična dejavnost, vendar "
+"sta \"%(child)s\" in \"%(parent)s\" v različnih družbah."
msgctxt "error:timesheet.work:"
msgid ""
@@ -212,7 +212,7 @@ msgstr "Poddejavnosti"
msgctxt "field:timesheet.work,company:"
msgid "Company"
-msgstr "Podjetje"
+msgstr "Družba"
msgctxt "field:timesheet.work,create_date:"
msgid "Create Date"
diff --git a/setup.py b/setup.py
index 3aa56a3..f537bea 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_timesheet'
+
+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 = ['python-sql']
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_timesheet',
- version=info.get('version', '0.0.1'),
+setup(name=name,
+ version=version,
description='Tryton module with timesheets',
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 timesheet',
package_dir={'trytond.modules.timesheet': '.'},
packages=[
'trytond.modules.timesheet',
@@ -67,7 +85,6 @@ setup(name='trytond_timesheet',
'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_timesheet.py b/tests/test_timesheet.py
index 8c53cad..fb76d8e 100644
--- a/tests/test_timesheet.py
+++ b/tests/test_timesheet.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 TimesheetTestCase(unittest.TestCase):
- '''
- Test Timesheet module.
- '''
+ 'Test Timesheet module'
def setUp(self):
trytond.tests.test_tryton.install_module('timesheet')
def test0005views(self):
- '''
- Test views.
- '''
+ 'Test views'
test_view('timesheet')
def test0006depends(self):
- '''
- Test depends.
- '''
+ 'Test depends'
test_depends()
@@ -40,6 +25,3 @@ def suite():
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
TimesheetTestCase))
return suite
-
-if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index 2c85ffe..ddf5700 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.0.0
+version=3.2.0
depends:
company
company_work_time
diff --git a/trytond_timesheet.egg-info/PKG-INFO b/trytond_timesheet.egg-info/PKG-INFO
index c9e184c..d72bcc4 100644
--- a/trytond_timesheet.egg-info/PKG-INFO
+++ b/trytond_timesheet.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-timesheet
-Version: 3.0.0
+Version: 3.2.0
Summary: Tryton module with timesheets
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_timesheet
=================
@@ -43,6 +43,7 @@ Description: trytond_timesheet
http://www.tryton.org/
+Keywords: tryton timesheet
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_timesheet.egg-info/requires.txt b/trytond_timesheet.egg-info/requires.txt
index d103351..a575e5e 100644
--- a/trytond_timesheet.egg-info/requires.txt
+++ b/trytond_timesheet.egg-info/requires.txt
@@ -1,4 +1,4 @@
python-sql
-trytond_company >= 3.0, < 3.1
-trytond_company_work_time >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_company >= 3.2, < 3.3
+trytond_company_work_time >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
diff --git a/work.py b/work.py
index fd08005..af9c0c4 100644
--- a/work.py
+++ b/work.py
@@ -24,10 +24,6 @@ class Work(ModelSQL, ModelView):
right = fields.Integer('Right', required=True, select=True)
children = fields.One2Many('timesheet.work', 'parent', 'Children')
hours = fields.Function(fields.Float('Timesheet Hours', digits=(16, 2),
- states={
- 'invisible': ~Eval('timesheet_available'),
- },
- depends=['timesheet_available'],
help="Total time spent on this work"), 'get_hours')
timesheet_available = fields.Boolean('Available on timesheets',
help="Allow to fill in timesheets with this work")
@@ -164,28 +160,39 @@ class Work(ModelSQL, ModelView):
return super(Work, cls).copy(works, default=default)
@classmethod
- def write(cls, works, vals):
+ def write(cls, *args):
pool = Pool()
Lines = pool.get('timesheet.line')
- childs = None
- if not vals.get('timesheet_available', True):
- in_max = Transaction().cursor.IN_MAX
- for i in range(0, len(works), in_max):
- sub_ids = [w.id for w in works[i:i + in_max]]
- lines = Lines.search([('work', 'in', sub_ids)], limit=1)
- if lines:
- cls.raise_user_error('change_timesheet_available',
- lines[0].work.rec_name)
- if not vals.get('active', True):
- childs = cls.search([
- ('parent', 'child_of', [w.id for w in works]),
- ])
- super(Work, cls).write(works, vals)
+
+ actions = iter(args)
+ childs = []
+ for works, values in zip(actions, actions):
+ if not values.get('timesheet_available', True):
+ in_max = Transaction().cursor.IN_MAX
+ for i in range(0, len(works), in_max):
+ sub_ids = [w.id for w in works[i:i + in_max]]
+ lines = Lines.search([('work', 'in', sub_ids)], limit=1)
+ if lines:
+ cls.raise_user_error('change_timesheet_available',
+ lines[0].work.rec_name)
+ if not values.get('active', True):
+ childs += cls.search([
+ ('parent', 'child_of', [w.id for w in works]),
+ ])
+
+ super(Work, cls).write(*args)
+
if childs:
cls.write(childs, {
'active': False,
})
+ @classmethod
+ def search_global(cls, text):
+ for id_, rec_name, icon in super(Work, cls).search_global(text):
+ icon = icon or 'tryton-clock'
+ yield id_, rec_name, icon
+
class OpenWorkStart(ModelView):
'Open Work'
--
tryton-modules-timesheet
More information about the tryton-debian-vcs
mailing list