[tryton-debian-vcs] tryton-modules-timesheet branch debian updated. debian/3.4.1-1-3-gd8b6a44

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Apr 23 16:07:47 UTC 2015


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

commit d8b6a443b74616a49dc306f7ba3b058e3e146d56
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Apr 23 17:00:10 2015 +0200

    Merging upstream version 3.6.0.

diff --git a/CHANGELOG b/CHANGELOG
index 0fadc5b..bca10c5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
-Version 3.4.1 - 2015-02-17
+Version 3.6.0 - 2015-04-20
 * Bug fixes (see mercurial logs for details)
+* Add support for PyPy
+* Use TimeDelta field
 
 Version 3.4.0 - 2014-10-20
 * Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 1e0fb7c..e2ee87c 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_timesheet
-Version: 3.4.1
+Version: 3.6.0
 Summary: Tryton module with timesheets
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
 Description: trytond_timesheet
         =================
         
@@ -65,4 +65,6 @@ Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Office/Business
diff --git a/__init__.py b/__init__.py
index d5d56ac..d5e503a 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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.pool import Pool
 from .work import *
diff --git a/line.py b/line.py
index d24160b..f9a0e15 100644
--- a/line.py
+++ b/line.py
@@ -1,15 +1,18 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 __future__ import division
+import datetime
+
 from sql import Literal
 from sql.aggregate import Max, Sum
-from sql.conditionals import Coalesce
 from sql.functions import Extract
 
 from trytond.model import ModelView, ModelSQL, fields
 from trytond.wizard import Wizard, StateView, StateAction, Button
-from trytond.pyson import Eval, PYSONEncoder, Date, Get
+from trytond.pyson import Eval, PYSONEncoder, Date
 from trytond.transaction import Transaction
 from trytond.pool import Pool
+from trytond import backend
 
 __all__ = ['Line', 'EnterLinesStart', 'EnterLines',
     'HoursEmployee',
@@ -20,14 +23,17 @@ __all__ = ['Line', 'EnterLinesStart', 'EnterLines',
 class Line(ModelSQL, ModelView):
     'Timesheet Line'
     __name__ = 'timesheet.line'
+    company = fields.Many2One('company.company', 'Company', required=True)
     employee = fields.Many2One('company.employee', 'Employee', required=True,
         select=True, domain=[
-            ('company', '=', Eval('context', {}).get('company', -1)),
-            ])
+            ('company', '=', Eval('company', -1)),
+            ],
+        depends=['company'])
     date = fields.Date('Date', required=True, select=True)
-    hours = fields.Float('Hours', digits=(16, 2), required=True)
+    duration = fields.TimeDelta('Duration', 'company_work_time', required=True)
     work = fields.Many2One('timesheet.work', 'Work',
         required=True, select=True, domain=[
+            ('company', '=', Eval('company', -1)),
             ('timesheet_available', '=', True),
             ['OR',
                 ('timesheet_start_date', '=', None),
@@ -38,17 +44,56 @@ class Line(ModelSQL, ModelView):
                 ('timesheet_end_date', '>=', Eval('date')),
                 ],
             ],
-        depends=['date'])
+        depends=['date', 'company'])
     description = fields.Char('Description')
 
     @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'),
-            ]
+        cls._error_messages.update({
+                'duration_positive': (
+                    'Duration of line "%(line)s" must be positive.'),
+                })
+
+    @classmethod
+    def __register__(cls, module_name):
+        TableHandler = backend.get('TableHandler')
+        cursor = Transaction().cursor
+        table = TableHandler(cursor, cls, module_name)
+        sql_table = cls.__table__()
+        pool = Pool()
+        Work = pool.get('timesheet.work')
+        work = Work.__table__()
+
+        created_company = not table.column_exist('company')
+
+        super(Line, cls).__register__(module_name)
+
+        table = TableHandler(cursor, cls, module_name)
+
+        # Migration from 3.4: new company field
+        if created_company:
+            # Don't use FROM because SQLite nor MySQL support it.
+            cursor.execute(*sql_table.update(
+                    [sql_table.company], [work.select(work.company,
+                            where=work.id == sql_table.work)]))
+        # Migration from 3.4: change hours into timedelta duration
+        if table.column_exist('hours'):
+            table.drop_constraint('check_move_hours_pos')
+            cursor.execute(*sql_table.select(
+                    sql_table.id, sql_table.hours))
+            for id_, hours in cursor.fetchall():
+                duration = datetime.timedelta(hours=hours)
+                cursor.execute(*sql_table.update(
+                        [sql_table.duration],
+                        [duration],
+                        where=sql_table.id == id_))
+            table.drop_column('hours')
+
+    @staticmethod
+    def default_company():
+        return Transaction().context.get('company')
 
     @staticmethod
     def default_employee():
@@ -76,6 +121,22 @@ class Line(ModelSQL, ModelView):
         employee = Employee(Transaction().context['employee'])
         return value + " (" + employee.rec_name + ")"
 
+    @classmethod
+    def validate(cls, lines):
+        super(Line, cls).validate(lines)
+        for line in lines:
+            line.check_duration()
+
+    def check_duration(self):
+        if self.duration < datetime.timedelta():
+            self.raise_user_error('duration_positive', {
+                    'line': self.rec_name,
+                    })
+
+    @property
+    def hours(self):
+        return self.duration.total_seconds() / 60 / 60
+
 
 class EnterLinesStart(ModelView):
     'Enter Lines'
@@ -127,7 +188,7 @@ class HoursEmployee(ModelSQL, ModelView):
     'Hours per Employee'
     __name__ = 'timesheet.hours_employee'
     employee = fields.Many2One('company.employee', 'Employee', select=True)
-    hours = fields.Float('Hours', digits=(16, 2))
+    duration = fields.TimeDelta('Duration', 'company_work_time')
 
     @staticmethod
     def table_query():
@@ -146,7 +207,7 @@ class HoursEmployee(ModelSQL, ModelView):
             Max(line.write_uid).as_('write_uid'),
             Max(line.write_date).as_('write_date'),
             line.employee,
-            Sum(Coalesce(line.hours, 0)).as_('hours'),
+            Sum(line.duration).as_('duration'),
             where=where,
             group_by=line.employee)
 
@@ -185,7 +246,7 @@ class HoursEmployeeWeekly(ModelSQL, ModelView):
     year = fields.Char('Year', select=True)
     week = fields.Integer('Week', select=True)
     employee = fields.Many2One('company.employee', 'Employee', select=True)
-    hours = fields.Float('Hours', digits=(16, 2), select=True)
+    duration = fields.TimeDelta('Duration', 'company_work_time')
 
     @classmethod
     def __setup__(cls):
@@ -213,7 +274,7 @@ class HoursEmployeeWeekly(ModelSQL, ModelView):
             year_column,
             week_column,
             line.employee,
-            Sum(Coalesce(line.hours, 0)).as_('hours'),
+            Sum(line.duration).as_('duration'),
             group_by=(year_column, week_column, line.employee))
 
 
@@ -223,7 +284,7 @@ class HoursEmployeeMonthly(ModelSQL, ModelView):
     year = fields.Char('Year', select=True)
     month = fields.Integer('Month', select=True)
     employee = fields.Many2One('company.employee', 'Employee', select=True)
-    hours = fields.Float('Hours', digits=(16, 2), select=True)
+    duration = fields.TimeDelta('Duration', 'company_work_time')
 
     @classmethod
     def __setup__(cls):
@@ -251,5 +312,5 @@ class HoursEmployeeMonthly(ModelSQL, ModelView):
             year_column,
             month_column,
             line.employee,
-            Sum(Coalesce(line.hours, 0)).as_('hours'),
+            Sum(line.duration).as_('duration'),
             group_by=(year_column, month_column, line.employee))
diff --git a/line.xml b/line.xml
index 4530afb..c032277 100644
--- a/line.xml
+++ b/line.xml
@@ -35,7 +35,8 @@ 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', 'in', Eval('active_ids'))]</field>
+            <field name="domain"
+                eval="[('work', 'in', Eval('active_ids'))]" pyson="1"/>
         </record>
         <record model="ir.action.act_window.view"
             id="act_line_form_work_view1">
@@ -61,7 +62,9 @@ this repository contains the full copyright notices and license terms. -->
             <field name="default_p" eval="True"/>
         </record>
         <record model="ir.rule" id="rule_line1">
-            <field name="domain">[('employee', '=', user.employee.id if user.employee else None)]</field>
+            <field name="domain"
+                eval="[('employee', '=', Eval('user', {}).get('employee', None))]"
+                pyson="1"/>
             <field name="rule_group" ref="rule_group_line"/>
         </record>
         <record model="ir.rule.group" id="rule_group_line_admin">
@@ -121,7 +124,9 @@ this repository contains the full copyright notices and license terms. -->
             <field name="default_p" eval="True"/>
         </record>
         <record model="ir.rule" id="rule_hours_employee1">
-            <field name="domain">[('employee', '=', user.employee.id if user.employee else None)]</field>
+            <field name="domain"
+                eval="[('employee', '=', Eval('user', {}).get('employee', None))]"
+                pyson="1"/>
             <field name="rule_group" ref="rule_group_hours_employee"/>
         </record>
         <record model="ir.rule.group" id="rule_group_hours_employee_admin">
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index ff4e76d..a112aa0 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -3,13 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "Часовете трябва да са положителни числа"
-
-msgctxt "error:timesheet.work:"
-msgid ""
-"Every work must be in the same company as it's parent work but \"%(child)s\""
-" and \"%(parent)s\" are in different companies."
+msgid "Duration of line \"%(line)s\" must be positive."
 msgstr ""
 
 msgctxt "error:timesheet.work:"
@@ -26,14 +20,15 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Създадено от"
 
+#, fuzzy
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Продължителност"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Служител"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Часове"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -70,14 +65,15 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Създадено от"
 
+#, fuzzy
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Продължителност"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Служител"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Часове"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -110,14 +106,15 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Създадено от"
 
+#, fuzzy
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Продължителност"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Служител"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Часове"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -142,6 +139,11 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Година"
 
+#, fuzzy
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Фирма"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Създадено на"
@@ -158,14 +160,15 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Описание"
 
+#, fuzzy
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Продължителност"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Служител"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Часове"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -218,9 +221,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Създадено от"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Часове от график"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr ""
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -283,9 +286,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "До дата"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Общо време за изпълнение на тази задача"
+msgstr ""
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index 9a70f66..3eed7e5 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -3,16 +3,8 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "El camp Hores ha de ser positiu."
-
-msgctxt "error:timesheet.work:"
-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 ""
-"Tot treball ha d'estar a la mateixa empresa que el seu pare, però "
-"\"%(child)s\" i \"%(parent)s\" estan a empreses diferents."
+msgid "Duration of line \"%(line)s\" must be positive."
+msgstr "El temps de la línia \"%(line)s\" ha de ser positiu."
 
 msgctxt "error:timesheet.work:"
 msgid ""
@@ -30,14 +22,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Usuari creació"
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Temps"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Empleat"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Hores"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -64,7 +56,7 @@ msgstr "ID"
 
 msgctxt "field:timesheet.hours_employee.open.start,start_date:"
 msgid "Start Date"
-msgstr "Data inici"
+msgstr "Data inicial"
 
 msgctxt "field:timesheet.hours_employee_monthly,create_date:"
 msgid "Create Date"
@@ -74,14 +66,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Usuari creació"
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Temps"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Empleat"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Hores"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -114,14 +106,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Usuari creació"
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Temps"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Empleat"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Hores"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -146,6 +138,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Any"
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Empresa"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Data creació"
@@ -162,14 +158,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Descripció"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Temps"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Empleat"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Hores"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -222,9 +218,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Usuari creació"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Hores del full de treball"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr "Temps del full de treball"
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -256,7 +252,7 @@ msgstr "Disponible en fulls de treball"
 
 msgctxt "field:timesheet.work,timesheet_end_date:"
 msgid "Timesheet End"
-msgstr "Final de full de treball"
+msgstr "Final del full de treball"
 
 msgctxt "field:timesheet.work,timesheet_lines:"
 msgid "Timesheet Lines"
@@ -264,7 +260,7 @@ msgstr "Línies del full de treball"
 
 msgctxt "field:timesheet.work,timesheet_start_date:"
 msgid "Timesheet Start"
-msgstr "Començament de full de treball"
+msgstr "Inici del full de treball"
 
 msgctxt "field:timesheet.work,write_date:"
 msgid "Write Date"
@@ -286,9 +282,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Fins a la data"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Temps total empleat en aquest treball."
+msgstr "Temps total dedicat en aquest treball."
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
@@ -439,8 +435,8 @@ msgid "Hours per Employee"
 msgstr "Hores per empleat"
 
 msgctxt "view:timesheet.hours_employee:"
-msgid "Hours"
-msgstr "Hores"
+msgid "Duration"
+msgstr "Temps"
 
 msgctxt "view:timesheet.hours_employee:"
 msgid "Hours per Employee"
@@ -459,8 +455,8 @@ msgid "Enter Timesheet"
 msgstr "Afegeix full de treball"
 
 msgctxt "view:timesheet.line:"
-msgid "Hours"
-msgstr "Hores"
+msgid "Duration"
+msgstr "Temps"
 
 msgctxt "view:timesheet.line:"
 msgid "Timesheet Line"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index eadd0af..eed1cb1 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -3,13 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr ""
-
-msgctxt "error:timesheet.work:"
-msgid ""
-"Every work must be in the same company as it's parent work but \"%(child)s\""
-" and \"%(parent)s\" are in different companies."
+msgid "Duration of line \"%(line)s\" must be positive."
 msgstr ""
 
 msgctxt "error:timesheet.work:"
@@ -26,12 +20,12 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr ""
 
-msgctxt "field:timesheet.hours_employee,employee:"
-msgid "Employee"
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
 msgstr ""
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
+msgctxt "field:timesheet.hours_employee,employee:"
+msgid "Employee"
 msgstr ""
 
 msgctxt "field:timesheet.hours_employee,id:"
@@ -70,12 +64,12 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr ""
 
-msgctxt "field:timesheet.hours_employee_monthly,employee:"
-msgid "Employee"
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
 msgstr ""
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
+msgctxt "field:timesheet.hours_employee_monthly,employee:"
+msgid "Employee"
 msgstr ""
 
 msgctxt "field:timesheet.hours_employee_monthly,id:"
@@ -110,12 +104,12 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr ""
 
-msgctxt "field:timesheet.hours_employee_weekly,employee:"
-msgid "Employee"
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
 msgstr ""
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
+msgctxt "field:timesheet.hours_employee_weekly,employee:"
+msgid "Employee"
 msgstr ""
 
 msgctxt "field:timesheet.hours_employee_weekly,id:"
@@ -142,6 +136,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr ""
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr ""
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr ""
@@ -158,12 +156,12 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr ""
 
-msgctxt "field:timesheet.line,employee:"
-msgid "Employee"
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
 msgstr ""
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
+msgctxt "field:timesheet.line,employee:"
+msgid "Employee"
 msgstr ""
 
 msgctxt "field:timesheet.line,id:"
@@ -218,8 +216,8 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr ""
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
 msgstr ""
 
 msgctxt "field:timesheet.work,id:"
@@ -282,7 +280,7 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr ""
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
 msgstr ""
 
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 56bfecb..3a8a61b 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -3,17 +3,8 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "Feld Stunden muss einen positiven Wert haben"
-
-msgctxt "error:timesheet.work:"
-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 ""
-"Das Unternehmen einer Tätigkeit muss dasselbe wie das der übergeordneten "
-"Tätigkeit sein, aber \"%(child)s\" und \"%(parent)s\" sind unterschiedlichen"
-" Unternehmen zugeordnet."
+msgid "Duration of line \"%(line)s\" must be positive."
+msgstr "Zeitdauer von Zeile \"%(line)s\" muss positiv sein"
 
 msgctxt "error:timesheet.work:"
 msgid ""
@@ -32,14 +23,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Erstellt durch"
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Dauer"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Mitarbeiter"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Stunden"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -76,14 +67,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Erstellt durch"
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Dauer"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Mitarbeiter"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Stunden"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -116,14 +107,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Erstellt durch"
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Dauer"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Mitarbeiter"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Stunden"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -148,6 +139,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Jahr"
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Unternehmen"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Erstellungsdatum"
@@ -164,14 +159,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Beschreibung"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Dauer"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Mitarbeiter"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Stunden"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -224,9 +219,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Erstellt durch"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Stunden"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr "Zeiterfassung Dauer"
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -288,9 +283,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Bis Datum"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Gesamtzeit für diese Tätigkeit"
+msgstr "Die gesamte Zeit, die für diese Aufgabe verwendet wurde"
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
@@ -441,8 +436,8 @@ msgid "Hours per Employee"
 msgstr "Stunden pro Mitarbeiter"
 
 msgctxt "view:timesheet.hours_employee:"
-msgid "Hours"
-msgstr "Stunden"
+msgid "Duration"
+msgstr "Dauer"
 
 msgctxt "view:timesheet.hours_employee:"
 msgid "Hours per Employee"
@@ -461,8 +456,8 @@ msgid "Enter Timesheet"
 msgstr "Zur Zeiterfassung"
 
 msgctxt "view:timesheet.line:"
-msgid "Hours"
-msgstr "Stunden"
+msgid "Duration"
+msgstr "Dauer"
 
 msgctxt "view:timesheet.line:"
 msgid "Timesheet Line"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index fd928fe..e8ba860 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -3,16 +3,8 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "El campo «Horas» debe ser positivo."
-
-msgctxt "error:timesheet.work:"
-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 ""
-"Todo trabajo debe estar en la misma empresa que su padre, pero «%(child)s» y"
-" «%(parent)s» están en empresas diferentes."
+msgid "Duration of line \"%(line)s\" must be positive."
+msgstr "La duración de la línea «%(line)s» debe ser positiva."
 
 msgctxt "error:timesheet.work:"
 msgid ""
@@ -30,14 +22,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Usuario creación"
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -64,7 +56,7 @@ msgstr "ID"
 
 msgctxt "field:timesheet.hours_employee.open.start,start_date:"
 msgid "Start Date"
-msgstr "Fecha inicio"
+msgstr "Fecha inicial"
 
 msgctxt "field:timesheet.hours_employee_monthly,create_date:"
 msgid "Create Date"
@@ -74,14 +66,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Usuario creación"
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -114,14 +106,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Usuario creación"
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -146,6 +138,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Año"
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Empresa"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Fecha creación"
@@ -162,14 +158,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Descripción"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -222,9 +218,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Usuario creación"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Horas del parte de trabajo"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr "Duración de parte de trabajo"
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -286,9 +282,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Hasta la fecha"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Tiempo total empleado en este trabajo."
+msgstr "Tiempo total empleado en este trabajo"
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
@@ -439,8 +435,8 @@ msgid "Hours per Employee"
 msgstr "Horas por empleado"
 
 msgctxt "view:timesheet.hours_employee:"
-msgid "Hours"
-msgstr "Horas"
+msgid "Duration"
+msgstr "Duración"
 
 msgctxt "view:timesheet.hours_employee:"
 msgid "Hours per Employee"
@@ -459,8 +455,8 @@ msgid "Enter Timesheet"
 msgstr "Ingrese parte de trabajo"
 
 msgctxt "view:timesheet.line:"
-msgid "Hours"
-msgstr "Horas"
+msgid "Duration"
+msgstr "Duración"
 
 msgctxt "view:timesheet.line:"
 msgid "Timesheet Line"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index f02f067..212fe78 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -3,16 +3,8 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "El campo horas debe ser positivo"
-
-msgctxt "error:timesheet.work:"
-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 ""
-"Cada trabajo debe estar en la misma compañía que su trabajo padre pero "
-"\"%(child)s\" y \"%(parent)s\" están en diferentes compañias."
+msgid "Duration of line \"%(line)s\" must be positive."
+msgstr "Duración de línea \"%(linea)s\" debe ser positivo."
 
 msgctxt "error:timesheet.work:"
 msgid ""
@@ -30,14 +22,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Creado por Usuario"
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -74,14 +66,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Creado por Usuario"
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -114,14 +106,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Creado por Usuario"
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -146,6 +138,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Año"
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Compañía"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Fecha de Creación"
@@ -162,14 +158,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Descripción"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -222,9 +218,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Creado por Usuario"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Horas de Registro de Tiempo"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr "Duración de Registro de Tiempo"
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -286,9 +282,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "A la Fecha"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Tiempo total utilizado en este trabajo"
+msgstr "Tiempo total gastado"
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
@@ -439,8 +435,8 @@ msgid "Hours per Employee"
 msgstr "Horas por Empleado"
 
 msgctxt "view:timesheet.hours_employee:"
-msgid "Hours"
-msgstr "Horas"
+msgid "Duration"
+msgstr "Duración"
 
 msgctxt "view:timesheet.hours_employee:"
 msgid "Hours per Employee"
@@ -459,8 +455,8 @@ msgid "Enter Timesheet"
 msgstr "Ingresar Registro de Tiempo"
 
 msgctxt "view:timesheet.line:"
-msgid "Hours"
-msgstr "Horas"
+msgid "Duration"
+msgstr "Duración"
 
 msgctxt "view:timesheet.line:"
 msgid "Timesheet Line"
diff --git a/locale/es_EC.po b/locale/es_EC.po
index 23d9cd3..61478c1 100644
--- a/locale/es_EC.po
+++ b/locale/es_EC.po
@@ -3,16 +3,8 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "El campo \"Horas\" debe ser positivo"
-
-msgctxt "error:timesheet.work:"
-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 ""
-"Todo trabajo debe estar en la misma empresa que su trabajo padre pero "
-"\"%(child)s\" y \"%(parent)s\" están en diferentes empresas."
+msgid "Duration of line \"%(line)s\" must be positive."
+msgstr "Duración de la línea \"%(line)s\" debe ser positiva."
 
 msgctxt "error:timesheet.work:"
 msgid ""
@@ -30,14 +22,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Creado por Usuario"
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -74,14 +66,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Creado por Usuario"
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -114,14 +106,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Creado por Usuario"
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -146,6 +138,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Año"
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Empresa"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Fecha de Creación"
@@ -162,14 +158,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Descripción"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Duración"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -222,9 +218,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Creado por Usuario"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Horas de Parte de Trabajo"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr "Duración de parte de trabajo"
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -286,13 +282,13 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Hasta la Fecha"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Tiempo total empleado en esta actividad"
+msgstr "Tiempo total empleado en este trabajo"
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
-msgstr "Permite completar partes de trabajo con esta trabajo"
+msgstr "Permite completar partes de trabajo con este trabajo"
 
 msgctxt "model:ir.action,name:act_hours_employee_form"
 msgid "Hours per Employee"
@@ -439,8 +435,8 @@ msgid "Hours per Employee"
 msgstr "Horas por Empleado"
 
 msgctxt "view:timesheet.hours_employee:"
-msgid "Hours"
-msgstr "Horas"
+msgid "Duration"
+msgstr "Duración"
 
 msgctxt "view:timesheet.hours_employee:"
 msgid "Hours per Employee"
@@ -459,8 +455,8 @@ msgid "Enter Timesheet"
 msgstr "Ingresar Parte de Trabajo"
 
 msgctxt "view:timesheet.line:"
-msgid "Hours"
-msgstr "Horas"
+msgid "Duration"
+msgstr "Duración"
 
 msgctxt "view:timesheet.line:"
 msgid "Timesheet Line"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index f915484..67d51c5 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -3,24 +3,16 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "El campo \"Horas\" debe ser positivo."
-
-msgctxt "error:timesheet.work:"
-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 ""
-"Todo trabajo debe estar en la misma empresa que su padre, pero \"%(child)s\""
-" y \"%(parent)s\" están en empresas diferentes."
+msgid "Duration of line \"%(line)s\" must be positive."
+msgstr "El tiempo de la línea \"%(line)s\" debe ser positivo."
 
 msgctxt "error:timesheet.work:"
 msgid ""
 "You can not unset \"Available on timesheets\" for work \"%s\" because it "
 "already has  timesheets."
 msgstr ""
-"No puede deshabilitar \"Disponible en hojas de trabajo\" \"%s\" porque ya "
-"tiene hojas de trabajo."
+"No puede deshabilitar \"Disponible en partes de trabajo\" \"%s\" porque ya "
+"tiene partes de trabajo."
 
 msgctxt "field:timesheet.hours_employee,create_date:"
 msgid "Create Date"
@@ -30,14 +22,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Usuario creación"
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Tiempo"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -74,14 +66,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Usuario creación"
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Tiempo"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -114,14 +106,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Usuario creación"
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Tiempo"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -146,6 +138,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Año"
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Empresa"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Fecha creación"
@@ -162,14 +158,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Descripción"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Tiempo"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Empleado"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Horas"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -222,9 +218,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Usuario creación"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Horas parte de trabajo"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr "Tiempo del parte de trabajo"
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -286,9 +282,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Hasta la fecha"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Tiempo total empleado en este trabajo."
+msgstr "Tiempo total dedicado en este trabajo."
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
@@ -439,8 +435,8 @@ msgid "Hours per Employee"
 msgstr "Horas por empleado"
 
 msgctxt "view:timesheet.hours_employee:"
-msgid "Hours"
-msgstr "Horas"
+msgid "Duration"
+msgstr "Tiempo"
 
 msgctxt "view:timesheet.hours_employee:"
 msgid "Hours per Employee"
@@ -459,8 +455,8 @@ msgid "Enter Timesheet"
 msgstr "Añadir parte de trabajo"
 
 msgctxt "view:timesheet.line:"
-msgid "Hours"
-msgstr "Horas"
+msgid "Duration"
+msgstr "Tiempo"
 
 msgctxt "view:timesheet.line:"
 msgid "Timesheet Line"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index dfaa33a..b3d8429 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -3,16 +3,8 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "Le champ Heures doit être positif"
-
-msgctxt "error:timesheet.work:"
-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 ""
-"Chaque travail doit être dans la même société que son parent mais « "
-"%(child)s » et « %(parent)s » ont des sociétés différentes."
+msgid "Duration of line \"%(line)s\" must be positive."
+msgstr "La durée de la ligne « %(line)s » doit être positive."
 
 msgctxt "error:timesheet.work:"
 msgid ""
@@ -30,14 +22,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Créé par"
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Durée"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Employé"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Heures"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -74,14 +66,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Créé par"
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Durée"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Employé"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Heures"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -114,14 +106,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Créé par"
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Durée"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Employé"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Heures"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -146,6 +138,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Année"
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Société"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Date de création"
@@ -162,14 +158,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Description"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Durée"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Employé"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Heures"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -222,9 +218,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Créé par"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Heures de présence"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr "Durée de feuille de présence"
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -286,7 +282,7 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Date de fin"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
 msgstr "Temps total passé sur ce travail"
 
@@ -439,8 +435,8 @@ msgid "Hours per Employee"
 msgstr "Heures par employé"
 
 msgctxt "view:timesheet.hours_employee:"
-msgid "Hours"
-msgstr "Heures"
+msgid "Duration"
+msgstr "Durée"
 
 msgctxt "view:timesheet.hours_employee:"
 msgid "Hours per Employee"
@@ -459,8 +455,8 @@ msgid "Enter Timesheet"
 msgstr "Entrer feuille de présence"
 
 msgctxt "view:timesheet.line:"
-msgid "Hours"
-msgstr "Heures"
+msgid "Duration"
+msgstr "Durée"
 
 msgctxt "view:timesheet.line:"
 msgid "Timesheet Line"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index a233f65..65473bd 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -3,13 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "Het veld uren moet positief zijn"
-
-msgctxt "error:timesheet.work:"
-msgid ""
-"Every work must be in the same company as it's parent work but \"%(child)s\""
-" and \"%(parent)s\" are in different companies."
+msgid "Duration of line \"%(line)s\" must be positive."
 msgstr ""
 
 msgctxt "error:timesheet.work:"
@@ -26,14 +20,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr ""
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr ""
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Werknemer"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Uren"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr ""
@@ -72,14 +66,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr ""
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr ""
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Werknemer"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Uren"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr ""
@@ -112,14 +106,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr ""
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr ""
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Werknemer"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Uren"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr ""
@@ -144,6 +138,11 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Jaar"
 
+#, fuzzy
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Bedrijf"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr ""
@@ -160,14 +159,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Specificatie"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr ""
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Werknemer"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Uren"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr ""
@@ -222,9 +221,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr ""
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Tijdregistratie uren"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr ""
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -289,9 +288,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Tot datum"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Tijd besteed aan dit werk"
+msgstr ""
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index b58a027..d3a4bf5 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -3,16 +3,8 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "Количество часов должно быть положительным"
-
-msgctxt "error:timesheet.work:"
-msgid ""
-"Every work must be in the same company as it's parent work but \"%(child)s\""
-" and \"%(parent)s\" are in different companies."
+msgid "Duration of line \"%(line)s\" must be positive."
 msgstr ""
-"Каждая работа должна быть в той же организации, что и её предок, но "
-"\"%(child)s\" и \"%(parent)s\" принадлежат разным организациям."
 
 msgctxt "error:timesheet.work:"
 msgid ""
@@ -28,14 +20,15 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Создано пользователем"
 
+#, fuzzy
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Продолжительность"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Сотрудник"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Часы"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -72,14 +65,15 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Создано пользователем"
 
+#, fuzzy
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Продолжительность"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Сотрудник"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Часы"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -112,14 +106,15 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Создано пользователем"
 
+#, fuzzy
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Продолжительность"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Сотрудник"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Часы"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -144,6 +139,11 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Год"
 
+#, fuzzy
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Учет.орг."
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Дата создания"
@@ -160,14 +160,15 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Описание"
 
+#, fuzzy
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Продолжительность"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Сотрудник"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Часы"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -220,9 +221,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Создано пользователем"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Часы табеля"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr ""
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -284,9 +285,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Конечная дата"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Общее время потраченное на эту работу"
+msgstr ""
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index d0ad5f2..63a5894 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -3,16 +3,8 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:timesheet.line:"
-msgid "Hours field must be positive"
-msgstr "Vrednost polja \"Ure\" mora biti pozitivna"
-
-msgctxt "error:timesheet.work:"
-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 isti družbi kot njena matična dejavnost, vendar "
-"sta \"%(child)s\" in \"%(parent)s\" v različnih družbah."
+msgid "Duration of line \"%(line)s\" must be positive."
+msgstr "Trajanje na postavki \"%(line)s\" mora biti nenegativno."
 
 msgctxt "error:timesheet.work:"
 msgid ""
@@ -30,14 +22,14 @@ msgctxt "field:timesheet.hours_employee,create_uid:"
 msgid "Create User"
 msgstr "Izdelal"
 
+msgctxt "field:timesheet.hours_employee,duration:"
+msgid "Duration"
+msgstr "Trajanje"
+
 msgctxt "field:timesheet.hours_employee,employee:"
 msgid "Employee"
 msgstr "Zaposlenec"
 
-msgctxt "field:timesheet.hours_employee,hours:"
-msgid "Hours"
-msgstr "Ure"
-
 msgctxt "field:timesheet.hours_employee,id:"
 msgid "ID"
 msgstr "ID"
@@ -74,14 +66,14 @@ msgctxt "field:timesheet.hours_employee_monthly,create_uid:"
 msgid "Create User"
 msgstr "Izdelal"
 
+msgctxt "field:timesheet.hours_employee_monthly,duration:"
+msgid "Duration"
+msgstr "Trajanje"
+
 msgctxt "field:timesheet.hours_employee_monthly,employee:"
 msgid "Employee"
 msgstr "Zaposlenec"
 
-msgctxt "field:timesheet.hours_employee_monthly,hours:"
-msgid "Hours"
-msgstr "Ure"
-
 msgctxt "field:timesheet.hours_employee_monthly,id:"
 msgid "ID"
 msgstr "ID"
@@ -114,14 +106,14 @@ msgctxt "field:timesheet.hours_employee_weekly,create_uid:"
 msgid "Create User"
 msgstr "Izdelal"
 
+msgctxt "field:timesheet.hours_employee_weekly,duration:"
+msgid "Duration"
+msgstr "Trajanje"
+
 msgctxt "field:timesheet.hours_employee_weekly,employee:"
 msgid "Employee"
 msgstr "Zaposlenec"
 
-msgctxt "field:timesheet.hours_employee_weekly,hours:"
-msgid "Hours"
-msgstr "Ure"
-
 msgctxt "field:timesheet.hours_employee_weekly,id:"
 msgid "ID"
 msgstr "ID"
@@ -146,6 +138,10 @@ msgctxt "field:timesheet.hours_employee_weekly,year:"
 msgid "Year"
 msgstr "Leto"
 
+msgctxt "field:timesheet.line,company:"
+msgid "Company"
+msgstr "Družba"
+
 msgctxt "field:timesheet.line,create_date:"
 msgid "Create Date"
 msgstr "Izdelano"
@@ -162,14 +158,14 @@ msgctxt "field:timesheet.line,description:"
 msgid "Description"
 msgstr "Opis"
 
+msgctxt "field:timesheet.line,duration:"
+msgid "Duration"
+msgstr "Trajanje"
+
 msgctxt "field:timesheet.line,employee:"
 msgid "Employee"
 msgstr "Zaposlenec"
 
-msgctxt "field:timesheet.line,hours:"
-msgid "Hours"
-msgstr "Ure"
-
 msgctxt "field:timesheet.line,id:"
 msgid "ID"
 msgstr "ID"
@@ -222,9 +218,9 @@ msgctxt "field:timesheet.work,create_uid:"
 msgid "Create User"
 msgstr "Izdelal"
 
-msgctxt "field:timesheet.work,hours:"
-msgid "Timesheet Hours"
-msgstr "Ure prisotnosti"
+msgctxt "field:timesheet.work,duration:"
+msgid "Timesheet Duration"
+msgstr "Trajanje"
 
 msgctxt "field:timesheet.work,id:"
 msgid "ID"
@@ -286,9 +282,9 @@ msgctxt "field:timesheet.work.open.start,to_date:"
 msgid "To Date"
 msgstr "Do"
 
-msgctxt "help:timesheet.work,hours:"
+msgctxt "help:timesheet.work,duration:"
 msgid "Total time spent on this work"
-msgstr "Skupni porabljen čas na dejavnosti"
+msgstr "Skupen porabljen čas na tej nalogi"
 
 msgctxt "help:timesheet.work,timesheet_available:"
 msgid "Allow to fill in timesheets with this work"
@@ -439,8 +435,8 @@ msgid "Hours per Employee"
 msgstr "Ure po zaposlencu"
 
 msgctxt "view:timesheet.hours_employee:"
-msgid "Hours"
-msgstr "Ure"
+msgid "Duration"
+msgstr "Trajanje"
 
 msgctxt "view:timesheet.hours_employee:"
 msgid "Hours per Employee"
@@ -459,8 +455,8 @@ msgid "Enter Timesheet"
 msgstr "Vnos prisotnosti"
 
 msgctxt "view:timesheet.line:"
-msgid "Hours"
-msgstr "Ure"
+msgid "Duration"
+msgstr "Trajanje"
 
 msgctxt "view:timesheet.line:"
 msgid "Timesheet Line"
diff --git a/setup.py b/setup.py
index f537bea..4052345 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 #!/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.
+# 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 setuptools import setup
 import re
@@ -86,6 +86,8 @@ setup(name=name,
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
         'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: Implementation :: CPython',
+        'Programming Language :: Python :: Implementation :: PyPy',
         'Topic :: Office/Business',
         ],
     license='GPL-3',
diff --git a/tests/__init__.py b/tests/__init__.py
index 11bca20..2a3f7cb 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 .test_timesheet import suite
 
diff --git a/tests/test_timesheet.py b/tests/test_timesheet.py
index fb76d8e..97963b4 100644
--- a/tests/test_timesheet.py
+++ b/tests/test_timesheet.py
@@ -1,23 +1,13 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 unittest
 import trytond.tests.test_tryton
-from trytond.tests.test_tryton import test_view, test_depends
+from trytond.tests.test_tryton import ModuleTestCase
 
 
-class TimesheetTestCase(unittest.TestCase):
+class TimesheetTestCase(ModuleTestCase):
     'Test Timesheet module'
-
-    def setUp(self):
-        trytond.tests.test_tryton.install_module('timesheet')
-
-    def test0005views(self):
-        'Test views'
-        test_view('timesheet')
-
-    def test0006depends(self):
-        'Test depends'
-        test_depends()
+    module = 'timesheet'
 
 
 def suite():
diff --git a/tryton.cfg b/tryton.cfg
index 330c53a..13c3bbc 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.4.1
+version=3.6.0
 depends:
     company
     company_work_time
diff --git a/trytond_timesheet.egg-info/PKG-INFO b/trytond_timesheet.egg-info/PKG-INFO
index adc3a3c..0815907 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.4.1
+Version: 3.6.0
 Summary: Tryton module with timesheets
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
 Description: trytond_timesheet
         =================
         
@@ -65,4 +65,6 @@ Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Office/Business
diff --git a/trytond_timesheet.egg-info/requires.txt b/trytond_timesheet.egg-info/requires.txt
index c699d82..a603c96 100644
--- a/trytond_timesheet.egg-info/requires.txt
+++ b/trytond_timesheet.egg-info/requires.txt
@@ -1,4 +1,4 @@
 python-sql
-trytond_company >= 3.4, < 3.5
-trytond_company_work_time >= 3.4, < 3.5
-trytond >= 3.4, < 3.5
\ No newline at end of file
+trytond_company >= 3.6, < 3.7
+trytond_company_work_time >= 3.6, < 3.7
+trytond >= 3.6, < 3.7
\ No newline at end of file
diff --git a/view/hours_employee_graph.xml b/view/hours_employee_graph.xml
index c9ca574..324a228 100644
--- a/view/hours_employee_graph.xml
+++ b/view/hours_employee_graph.xml
@@ -6,7 +6,6 @@ this repository contains the full copyright notices and license terms. -->
         <field name="employee"/>
     </x>
     <y>
-        <field name="hours" widget="float_time"
-            float_time="company_work_time"/>
+        <field name="duration" timedelta="company_work_time"/>
     </y>
 </graph>
diff --git a/view/hours_employee_monthly_tree.xml b/view/hours_employee_monthly_tree.xml
index b2350ed..a881e1a 100644
--- a/view/hours_employee_monthly_tree.xml
+++ b/view/hours_employee_monthly_tree.xml
@@ -5,5 +5,5 @@ this repository contains the full copyright notices and license terms. -->
     <field name="year"/>
     <field name="month"/>
     <field name="employee"/>
-    <field name="hours" widget="float_time" float_time="company_work_time"/>
+    <field name="duration"/>
 </tree>
diff --git a/view/hours_employee_tree.xml b/view/hours_employee_tree.xml
index 6df2f8c..30701cc 100644
--- a/view/hours_employee_tree.xml
+++ b/view/hours_employee_tree.xml
@@ -3,6 +3,5 @@
 this repository contains the full copyright notices and license terms. -->
 <tree string="Hours per Employee">
     <field name="employee"/>
-    <field name="hours" widget="float_time" float_time="company_work_time"
-        sum="Hours"/>
+    <field name="duration" sum="Duration"/>
 </tree>
diff --git a/view/hours_employee_weekly_tree.xml b/view/hours_employee_weekly_tree.xml
index d0335f2..c8f2356 100644
--- a/view/hours_employee_weekly_tree.xml
+++ b/view/hours_employee_weekly_tree.xml
@@ -5,5 +5,5 @@ this repository contains the full copyright notices and license terms. -->
     <field name="year"/>
     <field name="week"/>
     <field name="employee"/>
-    <field name="hours" widget="float_time" float_time="company_work_time"/>
+    <field name="duration"/>
 </tree>
diff --git a/view/line_form.xml b/view/line_form.xml
index b2e2383..3e0df19 100644
--- a/view/line_form.xml
+++ b/view/line_form.xml
@@ -3,11 +3,13 @@
 this repository contains the full copyright notices and license terms. -->
 <form string="Timesheet Line">
     <label name="employee"/>
-    <field name="employee" colspan="3"/>
+    <field name="employee"/>
+    <label name="company"/>
+    <field name="company"/>
     <label name="date"/>
     <field name="date"/>
-    <label name="hours"/>
-    <field name="hours" widget="float_time" float_time="company_work_time"/>
+    <label name="duration"/>
+    <field name="duration"/>
     <label name="work"/>
     <field name="work"/>
     <label name="description"/>
diff --git a/view/line_tree.xml b/view/line_tree.xml
index 09ce21a..e9f6b61 100644
--- a/view/line_tree.xml
+++ b/view/line_tree.xml
@@ -2,10 +2,10 @@
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
 <tree string="Timesheet Lines" editable="bottom">
+    <field name="company"/>
     <field name="employee"/>
     <field name="date"/>
-    <field name="hours" widget="float_time" float_time="company_work_time"
-        sum="Hours"/>
+    <field name="duration" sum="Duration"/>
     <field name="work" width="300"/>
     <field name="description"/>
 </tree>
diff --git a/view/work_graph.xml b/view/work_graph.xml
index c3531d0..0e598ba 100644
--- a/view/work_graph.xml
+++ b/view/work_graph.xml
@@ -6,7 +6,6 @@ this repository contains the full copyright notices and license terms. -->
         <field name="name"/>
     </x>
     <y>
-        <field name="hours" widget="float_time"
-            float_time="company_work_time"/>
+        <field name="duration" timedelta="company_work_time"/>
     </y>
 </graph>
diff --git a/view/work_tree2.xml b/view/work_tree2.xml
index 41ff7ea..81e9d02 100644
--- a/view/work_tree2.xml
+++ b/view/work_tree2.xml
@@ -3,5 +3,5 @@
 this repository contains the full copyright notices and license terms. -->
 <tree string="Works">
     <field name="name"/>
-    <field name="hours" widget="float_time" float_time="company_work_time"/>
+    <field name="duration"/>
 </tree>
diff --git a/work.py b/work.py
index 0300d96..a1109c9 100644
--- a/work.py
+++ b/work.py
@@ -1,5 +1,9 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 __future__ import division
+
+import datetime
+
 from sql import Literal
 from sql.aggregate import Sum
 
@@ -19,12 +23,21 @@ class Work(ModelSQL, ModelView):
     name = fields.Char('Name', required=True)
     active = fields.Boolean('Active')
     parent = fields.Many2One('timesheet.work', 'Parent', left="left",
-            right="right", select=True, ondelete="RESTRICT")
+            right="right", select=True, ondelete="RESTRICT",
+        domain=[
+            ('company', '=', Eval('company', -1)),
+            ],
+        depends=['company'])
     left = fields.Integer('Left', required=True, select=True)
     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),
-            help="Total time spent on this work"), 'get_hours')
+    children = fields.One2Many('timesheet.work', 'parent', 'Children',
+        domain=[
+            ('company', '=', Eval('company', -1)),
+            ],
+        depends=['company'])
+    duration = fields.Function(fields.TimeDelta('Timesheet Duration',
+            'company_work_time', help="Total time spent on this work"),
+        'get_duration')
     timesheet_available = fields.Boolean('Available on timesheets',
         help="Allow to fill in timesheets with this work")
     timesheet_start_date = fields.Date('Timesheet Start',
@@ -51,9 +64,6 @@ class Work(ModelSQL, ModelView):
     def __setup__(cls):
         super(Work, cls).__setup__()
         cls._error_messages.update({
-                'invalid_parent_company': ('Every work must be in the same '
-                    'company as it\'s parent work but "%(child)s" and '
-                    '"%(parent)s" are in different companies.'),
                 'change_timesheet_available': ('You can not unset "Available '
                     'on timesheets" for work "%s" because it already has  '
                     'timesheets.'),
@@ -83,20 +93,9 @@ class Work(ModelSQL, ModelView):
     def validate(cls, works):
         super(Work, cls).validate(works)
         cls.check_recursion(works, rec_name='name')
-        for work in works:
-            work.check_parent_company()
-
-    def check_parent_company(self):
-        if not self.parent:
-            return
-        if self.parent.company != self.company:
-            self.raise_user_error('invalid_parent_company', {
-                    'child': self.rec_name,
-                    'parent': self.parent.rec_name,
-                    })
 
     @classmethod
-    def get_hours(cls, works, name):
+    def get_duration(cls, works, name):
         pool = Pool()
         Line = pool.get('timesheet.line')
         transaction = Transaction()
@@ -107,7 +106,7 @@ class Work(ModelSQL, ModelView):
         table_c = cls.__table__()
         line = Line.__table__()
         ids = [w.id for w in works]
-        hours = dict.fromkeys(ids, 0)
+        durations = dict.fromkeys(ids, None)
         where = Literal(True)
         if context.get('from_date'):
             where &= line.date >= context['from_date']
@@ -121,11 +120,15 @@ class Work(ModelSQL, ModelView):
                     condition=(table_c.left >= table_w.left)
                     & (table_c.right <= table_w.right)
                     ).join(line, 'LEFT', condition=line.work == table_c.id
-                    ).select(table_w.id, Sum(line.hours),
+                    ).select(table_w.id, Sum(line.duration),
                     where=red_sql & where,
                     group_by=table_w.id))
-            hours.update(dict(cursor.fetchall()))
-        return hours
+            for work_id, duration in cursor.fetchall():
+                # SQLite uses float for SUM
+                if duration and not isinstance(duration, datetime.timedelta):
+                    duration = datetime.timedelta(seconds=duration)
+                durations[work_id] = duration
+        return durations
 
     def get_rec_name(self, name):
         if self.parent:
@@ -187,9 +190,15 @@ class Work(ModelSQL, ModelView):
 
     @classmethod
     def search_global(cls, text):
-        for id_, rec_name, icon in super(Work, cls).search_global(text):
+        for record, rec_name, icon in super(Work, cls).search_global(text):
             icon = icon or 'tryton-clock'
-            yield id_, rec_name, icon
+            yield record, rec_name, icon
+
+    @property
+    def hours(self):
+        if not self.duration:
+            return 0
+        return self.duration.total_seconds() / 60 / 60
 
 
 class OpenWorkStart(ModelView):
diff --git a/work.xml b/work.xml
index e357047..0ba7859 100644
--- a/work.xml
+++ b/work.xml
@@ -25,7 +25,7 @@ this repository contains the full copyright notices and license terms. -->
         <record model="ir.action.act_window" id="act_work_tree">
             <field name="name">Works</field>
             <field name="res_model">timesheet.work</field>
-            <field name="domain">[('parent', '=', None)]</field>
+            <field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
         </record>
         <record model="ir.action.act_window.view"
             id="act_work_tree_view1">
@@ -71,7 +71,7 @@ this repository contains the full copyright notices and license terms. -->
         <record model="ir.action.act_window" id="act_work_tree2">
             <field name="name">Works</field>
             <field name="res_model">timesheet.work</field>
-            <field name="domain">[('parent', '=', None)]</field>
+            <field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
         </record>
         <record model="ir.action.act_window.view"
             id="act_work_tree2_view1">
@@ -88,7 +88,9 @@ this repository contains the full copyright notices and license terms. -->
         <record model="ir.action.act_window" id="act_work_form2">
             <field name="name">Hours per Work</field>
             <field name="res_model">timesheet.work</field>
-            <field name="domain">[('parent', '=', Get(Eval('timesheet.act_work_tree2', {}), 'id', None))]</field>
+            <field name="domain"
+                eval="[('parent', '=', Get(Eval('timesheet.act_work_tree2', {}), 'id', None))]"
+                pyson="1"/>
         </record>
         <record model="ir.action.act_window.view"
             id="act_work_form2_view1">
@@ -129,7 +131,8 @@ this repository contains the full copyright notices and license terms. -->
         <record model="ir.action.act_window" id="act_work_form3">
             <field name="name">Hours per Work</field>
             <field name="res_model">timesheet.work</field>
-            <field name="domain">[('parent', 'in', Eval('active_ids'))]</field>
+            <field name="domain"
+                eval="[('parent', 'in', Eval('active_ids'))]" pyson="1"/>
         </record>
         <record model="ir.action.act_window.view"
             id="act_work_form3_view1">
@@ -169,7 +172,9 @@ this repository contains the full copyright notices and license terms. -->
             <field name="default_p" eval="True"/>
         </record>
         <record model="ir.rule" id="rule_work1">
-            <field name="domain">[('company', '=', user.company.id if user.company else None)]</field>
+            <field name="domain"
+                eval="[('company', '=', Eval('user', {}).get('company', None))]"
+                pyson="1"/>
             <field name="rule_group" ref="rule_group_work"/>
         </record>
         <record model="ir.rule.group" id="rule_group_work_admin">
-- 
tryton-modules-timesheet



More information about the tryton-debian-vcs mailing list