[tryton-debian-vcs] tryton-modules-timesheet branch upstream-4.2 updated. upstream/4.2.0-1-gd1c047a

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Sun Jun 11 22:38:58 UTC 2017


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

commit d1c047aaa0ec38fb1648ab980c45957622ca38e2
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Jun 11 23:00:56 2017 +0200

    Adding upstream version 4.2.1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index ca28fdd..94876fc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.2.1 - 2017-06-06
+* Bug fixes (see mercurial logs for details)
+
 Version 4.2.0 - 2016-11-28
 * Bug fixes (see mercurial logs for details)
 * Add read access to any line for all
diff --git a/COPYRIGHT b/COPYRIGHT
index fcc5eeb..5af5413 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2016 Cédric Krier.
+Copyright (C) 2008-2017 Cédric Krier.
 Copyright (C) 2008-2013 Bertrand Chenal.
-Copyright (C) 2008-2016 B2CK SPRL.
+Copyright (C) 2008-2017 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/PKG-INFO b/PKG-INFO
index 52f4d23..2d80c21 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_timesheet
-Version: 4.2.0
+Version: 4.2.1
 Summary: Tryton module with timesheets
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/routes.py b/routes.py
index 98179ff..88e4530 100644
--- a/routes.py
+++ b/routes.py
@@ -33,7 +33,9 @@ def timesheet_works(request, pool, employee):
     employee = Employee(employee)
     with Transaction().set_context(
             company=employee.company.id, employee=employee.id):
-        works = Work.search([])
+        works = Work.search([
+                ('company', '=', employee.company.id),
+                ])
     return [{
             'id': w.id,
             'name': w.rec_name,
@@ -103,8 +105,11 @@ def timesheet(request, pool, line=None):
             if not line:
                 line, = Line.create([request.parsed_data])
             else:
-                line = Line(line)
-                Line.write([line], request.parsed_data)
+                lines = Line.search([('id', '=', line)])
+                if not lines:
+                    return Response(None, 204)
+                line, = lines
+                Line.write(lines, request.parsed_data)
         return {
             'id': line.id,
             'work': line.work.id,
@@ -113,7 +118,12 @@ def timesheet(request, pool, line=None):
             'description': line.description,
             }
     else:
-        with Transaction().set_context(
-                company=line.company.id, employee=line.employee.id):
-            Line.delete([line])
+        with Transaction().set_user(0):
+            lines = Line.search([('id', '=', line)])
+        if lines:
+            line, = lines
+            with Transaction().set_context(
+                    company=line.company.id, employee=line.employee.id):
+                lines = Line.search([('id', '=', line.id)])
+                Line.delete(lines)
         return Response(None, 204)
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..8bfd5a1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,4 @@
 [egg_info]
 tag_build = 
 tag_date = 0
-tag_svn_revision = 0
 
diff --git a/tryton.cfg b/tryton.cfg
index ccada47..69a3ac3 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.2.0
+version=4.2.1
 depends:
     company
     company_work_time
diff --git a/trytond_timesheet.egg-info/PKG-INFO b/trytond_timesheet.egg-info/PKG-INFO
index cfd687c..3348291 100644
--- a/trytond_timesheet.egg-info/PKG-INFO
+++ b/trytond_timesheet.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond-timesheet
-Version: 4.2.0
+Version: 4.2.1
 Summary: Tryton module with timesheets
 Home-page: http://www.tryton.org/
 Author: Tryton
-- 
tryton-modules-timesheet



More information about the tryton-debian-vcs mailing list