[tryton-debian-vcs] tryton-modules-timesheet-cost branch upstream updated. upstream/3.8.0-1-ge3bf4fe
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Thu Jun 2 16:29:29 UTC 2016
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-cost.git;a=commitdiff;h=upstream/3.8.0-1-ge3bf4fe
commit e3bf4feca0b55307a9adbfb9e2204946ae05ab8e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Fri May 27 18:26:25 2016 +0200
Adding upstream version 4.0.0.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index d03aa50..50997be 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+Version 4.0.0 - 2016-05-02
+* Bug fixes (see mercurial logs for details)
+* Add Python3 support
+
Version 3.8.0 - 2015-11-02
* Bug fixes (see mercurial logs for details)
* Store cost price on timesheet line
diff --git a/COPYRIGHT b/COPYRIGHT
index 0634fbe..00cf5e6 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,5 @@
-Copyright (C) 2008-2015 Cédric Krier.
-Copyright (C) 2008-2015 B2CK SPRL.
+Copyright (C) 2008-2016 Cédric Krier.
+Copyright (C) 2008-2016 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 6e743f0..81ee7dd 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_timesheet_cost
-Version: 3.8.0
+Version: 4.0.0
Summary: Tryton module to add cost on timesheet
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.8/
+Download-URL: http://downloads.tryton.org/4.0/
Description: trytond_timesheet_cost
======================
@@ -55,6 +55,7 @@ Classifier: Intended Audience :: Manufacturing
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Natural Language :: Bulgarian
Classifier: Natural Language :: Catalan
+Classifier: Natural Language :: Chinese (Simplified)
Classifier: Natural Language :: Czech
Classifier: Natural Language :: Dutch
Classifier: Natural Language :: English
@@ -68,6 +69,9 @@ Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Office/Business
diff --git a/company.py b/company.py
index 0f6fbd6..1872a0c 100644
--- a/company.py
+++ b/company.py
@@ -9,13 +9,13 @@ from trytond import backend
from trytond.config import config
__all__ = ['Employee', 'EmployeeCostPrice', 'price_digits']
-__metaclass__ = PoolMeta
price_digits = (16, config.getint(
'timesheet_cost', 'price_decimal', default=4))
class Employee:
+ __metaclass__ = PoolMeta
__name__ = 'company.employee'
cost_price = fields.Function(fields.Numeric('Cost Price',
digits=price_digits,
@@ -82,9 +82,8 @@ class EmployeeCostPrice(ModelSQL, ModelView):
@classmethod
def __register__(cls, module_name):
TableHandler = backend.get('TableHandler')
- cursor = Transaction().cursor
super(EmployeeCostPrice, cls).__register__(module_name)
- table = TableHandler(cursor, cls, module_name)
+ table = TableHandler(cls, module_name)
# Migration from 2.8 drop date_cost_price_uniq
table.drop_constraint('date_cost_price_uniq')
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index d062fa0..0c54494 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -52,7 +52,7 @@ msgstr "Променено от"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Фабрична цена"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index 932ca1a..1b565af 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -52,7 +52,7 @@ msgstr "Usuari modificació"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Preu de cost"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 69508ff..a233971 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -52,7 +52,7 @@ msgstr "Usuario modificación"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Precio de costo"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 7a9e3bb..19dd708 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -52,7 +52,7 @@ msgstr "Modificado por Usuario"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Costo"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
diff --git a/locale/es_EC.po b/locale/es_EC.po
index 86d1cac..72c279d 100644
--- a/locale/es_EC.po
+++ b/locale/es_EC.po
@@ -52,7 +52,7 @@ msgstr "Modificado por usuario"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Precio de costo"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index ae3b1f6..4c26aa8 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -52,7 +52,7 @@ msgstr "Usuario modificación"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Precio de coste"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
diff --git a/locale/es_MX.po b/locale/es_MX.po
index 1955367..5393a3a 100644
--- a/locale/es_MX.po
+++ b/locale/es_MX.po
@@ -50,9 +50,10 @@ msgctxt "field:company.employee_cost_price,write_uid:"
msgid "Write User"
msgstr "Usuario modificación"
+#, fuzzy
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Precio de costo"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
@@ -74,6 +75,7 @@ msgctxt "view:company.employee:"
msgid "Cost"
msgstr ""
+#, fuzzy
msgctxt "view:company.employee_cost_price:"
msgid "Cost Prices"
-msgstr ""
+msgstr "Precios de costo"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index 979cf73..46f4b87 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -52,7 +52,7 @@ msgstr "Mis à jour par"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Prix de revient"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
diff --git a/locale/hu_HU.po b/locale/hu_HU.po
index 9d878ca..073bbe7 100644
--- a/locale/hu_HU.po
+++ b/locale/hu_HU.po
@@ -4,76 +4,76 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:company.employee_cost_price:"
msgid "A employee can only have one cost price by date."
-msgstr ""
+msgstr "Egy alkalmazottnak dátumonként egy költség írható be."
msgctxt "field:company.employee,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Költség"
msgctxt "field:company.employee,cost_prices:"
msgid "Cost Prices"
-msgstr ""
+msgstr "Költség"
msgctxt "field:company.employee_cost_price,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Költség"
msgctxt "field:company.employee_cost_price,create_date:"
msgid "Create Date"
-msgstr ""
+msgstr "Létrehozás dátuma"
msgctxt "field:company.employee_cost_price,create_uid:"
msgid "Create User"
-msgstr ""
+msgstr "Által létrehozva"
msgctxt "field:company.employee_cost_price,date:"
msgid "Date"
-msgstr ""
+msgstr "Dátum"
msgctxt "field:company.employee_cost_price,employee:"
msgid "Employee"
-msgstr ""
+msgstr "Alkalmazott"
msgctxt "field:company.employee_cost_price,id:"
msgid "ID"
-msgstr ""
+msgstr "ID"
msgctxt "field:company.employee_cost_price,rec_name:"
msgid "Name"
-msgstr ""
+msgstr "Név"
msgctxt "field:company.employee_cost_price,write_date:"
msgid "Write Date"
-msgstr ""
+msgstr "Módosítás dátuma"
msgctxt "field:company.employee_cost_price,write_uid:"
msgid "Write User"
-msgstr ""
+msgstr "Által módosítva"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Költség"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
-msgstr ""
+msgstr "Alkalmazott költsége per óra "
msgctxt "help:company.employee,cost_prices:"
msgid "List of hourly cost price over time"
-msgstr ""
+msgstr "Lista a költség per óráról"
msgctxt "help:company.employee_cost_price,cost_price:"
msgid "Hourly cost price"
-msgstr ""
+msgstr "Költség per óra"
msgctxt "model:company.employee_cost_price,name:"
msgid "Employee Cost Price"
-msgstr ""
+msgstr "Alkalmazott költsége"
msgctxt "view:company.employee:"
msgid "Cost"
-msgstr ""
+msgstr "Költség"
msgctxt "view:company.employee_cost_price:"
msgid "Cost Prices"
-msgstr ""
+msgstr "Önköltségi ár"
diff --git a/locale/hu_HU.po b/locale/lo_LA.po
similarity index 100%
copy from locale/hu_HU.po
copy to locale/lo_LA.po
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index 974f943..242700f 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -11,9 +11,10 @@ msgctxt "field:company.employee,cost_price:"
msgid "Cost Price"
msgstr "Kostprijs"
+#, fuzzy
msgctxt "field:company.employee,cost_prices:"
msgid "Cost Prices"
-msgstr ""
+msgstr "Kostprijs"
#, fuzzy
msgctxt "field:company.employee_cost_price,cost_price:"
@@ -55,9 +56,10 @@ msgctxt "field:company.employee_cost_price,write_uid:"
msgid "Write User"
msgstr ""
+#, fuzzy
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Kostprijs"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
@@ -79,6 +81,7 @@ msgctxt "view:company.employee:"
msgid "Cost"
msgstr ""
+#, fuzzy
msgctxt "view:company.employee_cost_price:"
msgid "Cost Prices"
-msgstr ""
+msgstr "Kostprijs"
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index 89b80bc..4b0c5b1 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -52,7 +52,7 @@ msgstr "Изменено пользователем"
msgctxt "field:timesheet.line,cost_price:"
msgid "Cost Price"
-msgstr ""
+msgstr "Себестоимость"
msgctxt "help:company.employee,cost_price:"
msgid "Hourly cost price for this Employee"
diff --git a/locale/hu_HU.po b/locale/zh_CN.po
similarity index 100%
copy from locale/hu_HU.po
copy to locale/zh_CN.po
diff --git a/setup.py b/setup.py
index 491a800..77c1b00 100644
--- a/setup.py
+++ b/setup.py
@@ -5,11 +5,17 @@
from setuptools import setup
import re
import os
-import ConfigParser
+import io
+try:
+ from configparser import ConfigParser
+except ImportError:
+ from ConfigParser import ConfigParser
def read(fname):
- return open(os.path.join(os.path.dirname(__file__), fname)).read()
+ return io.open(
+ os.path.join(os.path.dirname(__file__), fname),
+ 'r', encoding='utf-8').read()
def get_require_version(name):
@@ -21,7 +27,7 @@ def get_require_version(name):
major_version, minor_version + 1)
return require
-config = ConfigParser.ConfigParser()
+config = ConfigParser()
config.readfp(open('tryton.cfg'))
info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'):
@@ -43,7 +49,7 @@ if minor_version % 2:
requires = ['python-sql >= 0.4']
for dep in info.get('depends', []):
- if not re.match(r'(ir|res|webdav)(\W|$)', dep):
+ if not re.match(r'(ir|res)(\W|$)', dep):
requires.append(get_require_version('trytond_%s' % dep))
requires.append(get_require_version('trytond'))
@@ -76,6 +82,7 @@ setup(name=name,
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: Bulgarian',
'Natural Language :: Catalan',
+ 'Natural Language :: Chinese (Simplified)',
'Natural Language :: Czech',
'Natural Language :: Dutch',
'Natural Language :: English',
@@ -89,6 +96,9 @@ setup(name=name,
'Natural Language :: Spanish',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Office/Business',
@@ -102,4 +112,5 @@ setup(name=name,
""",
test_suite='tests',
test_loader='trytond.test_loader:Loader',
+ use_2to3=True,
)
diff --git a/tests/__init__.py b/tests/__init__.py
index e593d7f..a8b8a49 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,6 +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.
-from .test_timesheet_cost import suite
+try:
+ from trytond.modules.timesheet_cost.tests.test_timesheet_cost import suite
+except ImportError:
+ from .test_timesheet_cost import suite
__all__ = ['suite']
diff --git a/tests/test_timesheet_cost.py b/tests/test_timesheet_cost.py
index 3f97e5f..2912a0e 100644
--- a/tests/test_timesheet_cost.py
+++ b/tests/test_timesheet_cost.py
@@ -1,31 +1,28 @@
# 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 doctest
import datetime
from decimal import Decimal
import trytond.tests.test_tryton
-from trytond.tests.test_tryton import ModuleTestCase
-from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
-from trytond.transaction import Transaction
+from trytond.tests.test_tryton import ModuleTestCase, with_transaction
+from trytond.pool import Pool
+
+from trytond.modules.company.tests import create_company, set_company
class TimesheetCostTestCase(ModuleTestCase):
'Test TimesheetCost module'
module = 'timesheet_cost'
- def setUp(self):
- super(TimesheetCostTestCase, self).setUp()
- self.party = POOL.get('party.party')
- self.employee = POOL.get('company.employee')
- self.employee_cost_price = POOL.get('company.employee_cost_price')
- self.company = POOL.get('company.company')
- self.work = POOL.get('timesheet.work')
- self.line = POOL.get('timesheet.line')
-
- def test0010compute_cost_price(self):
+ @with_transaction()
+ def test_compute_cost_price(self):
'Test compute_cost_price'
+ pool = Pool()
+ Party = pool.get('party.party')
+ Employee = pool.get('company.employee')
+ EmployeeCostPrice = pool.get('company.employee_cost_price')
+
cost_prices = [
(datetime.date(2011, 1, 1), Decimal(10)),
(datetime.date(2012, 1, 1), Decimal(15)),
@@ -40,17 +37,14 @@ class TimesheetCostTestCase(ModuleTestCase):
(datetime.date(2013, 1, 1), Decimal(20)),
(datetime.date(2013, 6, 1), Decimal(20)),
]
- with Transaction().start(DB_NAME, USER, context=CONTEXT):
- company, = self.company.search([
- ('rec_name', '=', 'Dunder Mifflin'),
- ])
- party = self.party(name='Pam Beesly')
- party.save()
- employee = self.employee(party=party.id,
- company=company)
+ party = Party(name='Pam Beesly')
+ party.save()
+ company = create_company()
+ with set_company(company):
+ employee = Employee(party=party.id, company=company)
employee.save()
for date, cost_price in cost_prices:
- self.employee_cost_price(
+ EmployeeCostPrice(
employee=employee,
date=date,
cost_price=cost_price).save()
@@ -60,10 +54,6 @@ class TimesheetCostTestCase(ModuleTestCase):
def suite():
suite = trytond.tests.test_tryton.suite()
- from trytond.modules.company.tests import test_company
- for test in test_company.suite():
- if test not in suite and not isinstance(test, doctest.DocTestCase):
- suite.addTest(test)
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
TimesheetCostTestCase))
return suite
diff --git a/timesheet.py b/timesheet.py
index 0499ab8..bdbc7b0 100644
--- a/timesheet.py
+++ b/timesheet.py
@@ -10,10 +10,10 @@ from trytond import backend
from .company import price_digits
__all__ = ['TimesheetLine']
-__metaclass__ = PoolMeta
class TimesheetLine:
+ __metaclass__ = PoolMeta
__name__ = 'timesheet.line'
cost_price = fields.Numeric('Cost Price',
@@ -25,9 +25,9 @@ class TimesheetLine:
Employee = pool.get('company.employee')
TableHandler = backend.get('TableHandler')
- cursor = Transaction().cursor
+ cursor = Transaction().connection.cursor()
table = cls.__table__()
- table_h = TableHandler(cursor, cls, module_name)
+ table_h = TableHandler(cls, module_name)
migrate_cost_price = not table_h.column_exist('cost_price')
diff --git a/tryton.cfg b/tryton.cfg
index 3b18022..f688ce6 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.8.0
+version=4.0.0
depends:
ir
company
diff --git a/trytond_timesheet_cost.egg-info/PKG-INFO b/trytond_timesheet_cost.egg-info/PKG-INFO
index ff07695..16d98f2 100644
--- a/trytond_timesheet_cost.egg-info/PKG-INFO
+++ b/trytond_timesheet_cost.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-timesheet-cost
-Version: 3.8.0
+Version: 4.0.0
Summary: Tryton module to add cost on timesheet
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.8/
+Download-URL: http://downloads.tryton.org/4.0/
Description: trytond_timesheet_cost
======================
@@ -55,6 +55,7 @@ Classifier: Intended Audience :: Manufacturing
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Natural Language :: Bulgarian
Classifier: Natural Language :: Catalan
+Classifier: Natural Language :: Chinese (Simplified)
Classifier: Natural Language :: Czech
Classifier: Natural Language :: Dutch
Classifier: Natural Language :: English
@@ -68,6 +69,9 @@ Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Office/Business
diff --git a/trytond_timesheet_cost.egg-info/SOURCES.txt b/trytond_timesheet_cost.egg-info/SOURCES.txt
index 347f93f..e481aec 100644
--- a/trytond_timesheet_cost.egg-info/SOURCES.txt
+++ b/trytond_timesheet_cost.egg-info/SOURCES.txt
@@ -50,11 +50,13 @@ locale/fr_FR.po
locale/hu_HU.po
locale/it_IT.po
locale/ja_JP.po
+locale/lo_LA.po
locale/lt_LT.po
locale/nl_NL.po
locale/pt_BR.po
locale/ru_RU.po
locale/sl_SI.po
+locale/zh_CN.po
trytond_timesheet_cost.egg-info/PKG-INFO
trytond_timesheet_cost.egg-info/SOURCES.txt
trytond_timesheet_cost.egg-info/dependency_links.txt
diff --git a/trytond_timesheet_cost.egg-info/requires.txt b/trytond_timesheet_cost.egg-info/requires.txt
index e99a811..9a3bb9f 100644
--- a/trytond_timesheet_cost.egg-info/requires.txt
+++ b/trytond_timesheet_cost.egg-info/requires.txt
@@ -1,5 +1,5 @@
python-sql >= 0.4
-trytond_company >= 3.8, < 3.9
-trytond_party >= 3.8, < 3.9
-trytond_timesheet >= 3.8, < 3.9
-trytond >= 3.8, < 3.9
\ No newline at end of file
+trytond_company >= 4.0, < 4.1
+trytond_party >= 4.0, < 4.1
+trytond_timesheet >= 4.0, < 4.1
+trytond >= 4.0, < 4.1
\ No newline at end of file
--
tryton-modules-timesheet-cost
More information about the tryton-debian-vcs
mailing list