[tryton-debian-vcs] tryton-modules-product-cost-history branch debian updated. debian/2.8.0-3-5-g2c46ecc
git repository hosting
tryton-debian-vcs at m9s.biz
Mon Nov 25 19:35:59 UTC 2013
The following commit has been merged in the debian branch:
http://debian.tryton.org/gitweb/?p=packages/tryton-modules-product-cost-history.git;a=commitdiff;h=debian/2.8.0-3-5-g2c46ecc
commit 2c46ecc6e1ebb07c667b69b1e3f22aae6a7c1f88
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Mon Nov 25 20:30:19 2013 +0100
Releasing debian version 3.0.0-1.
diff --git a/debian/changelog b/debian/changelog
index a182706..900942d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tryton-modules-product-cost-history (3.0.0-1) unstable; urgency=low
+
+ * Merging upstream version 3.0.0.
+ * Updating to standards version 3.9.5, no changes needed.
+ * Changing to buildsystem pybuild.
+ * Adding python-sql to Depends.
+
+ -- Mathias Behrle <mathiasb at m9s.biz> Mon, 25 Nov 2013 17:54:34 +0100
+
tryton-modules-product-cost-history (2.8.0-3) unstable; urgency=low
* Adapting the rules file to work also with git-buildpackage.
commit c69483ea416b7e641f120efa17a74dbbc7994179
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Mon Nov 25 17:44:27 2013 +0100
Adding python-sql to Depends.
diff --git a/debian/control b/debian/control
index ee73a3d..085fca7 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,8 @@ X-Python-Version: >= 2.6
Package: tryton-modules-product-cost-history
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, tryton-server (>= ${version:major}),
- tryton-modules-product (>= ${version:major}), python-pkg-resources
+ tryton-modules-product (>= ${version:major}),
+ python-sql, python-pkg-resources
Description: Tryton Application Platform (Product Cost History Module)
Tryton is a high-level general purpose application platform written in Python
and using PostgreSQL as database engine. It is the core base of a complete
commit b3cfa93953757864f62138519423f111da56d529
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sun Nov 24 19:51:51 2013 +0100
Changing to buildsystem pybuild.
diff --git a/debian/control b/debian/control
index 3ab81e0..ee73a3d 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,8 @@ Section: python
Priority: optional
Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
Uploaders: Mathias Behrle <mathiasb at m9s.biz>
-Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
+Build-Depends:
+ debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools, dh-python
Standards-Version: 3.9.5
Homepage: http://www.tryton.org/
Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-product-cost-history.git
diff --git a/debian/rules b/debian/rules
index 30074ad..5b8c326 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,24 +1,17 @@
#!/usr/bin/make -f
-MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
-PACKAGE_NAME := $(shell python setup.py --name)
-
-%:
- dh ${@} --with python2
+# needed for pbuilder
+export LC_ALL=C.UTF-8
-override_dh_auto_clean:
- dh_auto_clean
+MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
+PACKAGE_NAME := tryton-modules-$(shell python setup.py --name | sed s/^trytond_// | sed s/_/-/g)
+export PYBUILD_DESTDIR_python2=debian/${PACKAGE_NAME}
-override_dh_auto_build:
- mv $(PACKAGE_NAME).egg-info $(PACKAGE_NAME).hen-info
- mv PKG-INFO PKG-INFO.hen
- dh_auto_build
+# Don't run tests for Tryton modules, they try to download dependencies from pypi
+export PYBUILD_DISABLE_python2.7=test
-override_dh_auto_install:
- dh_auto_install
- rm -rf *.egg-info
- mv $(PACKAGE_NAME).hen-info $(PACKAGE_NAME).egg-info
- mv PKG-INFO.hen PKG-INFO
+%:
+ dh ${@} --with python2 --buildsystem=pybuild
override_dh_gencontrol:
dh_gencontrol -- -Vversion:major="$(MAJOR)"
commit a766a0add30f64d5250ca9b218da2ff9c60fac21
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sun Nov 24 19:14:21 2013 +0100
Updating to standards version 3.9.5, no changes needed.
diff --git a/debian/control b/debian/control
index e8e1369..3ab81e0 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
Uploaders: Mathias Behrle <mathiasb at m9s.biz>
Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
-Standards-Version: 3.9.4
+Standards-Version: 3.9.5
Homepage: http://www.tryton.org/
Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-product-cost-history.git
Vcs-Git: git://debian.tryton.org/packages/tryton-modules-product-cost-history.git
commit 54fd2062e2e6dbb950436007b9102ca30e4c7f0b
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sun Nov 24 17:27:31 2013 +0100
Merging upstream version 3.0.0.
diff --git a/CHANGELOG b/CHANGELOG
index 38aa565..f66fd20 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.0 - 2013-10-21
+* Bug fixes (see mercurial logs for details)
+
Version 2.8.0 - 2013-04-22
* Bug fixes (see mercurial logs for details)
diff --git a/INSTALL b/INSTALL
index 70ae5c1..b275167 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,6 +6,7 @@ Prerequisites
* Python 2.6 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
+ * python-sql (http://code.google.com/p/python-sql/)
* trytond_product (http://www.tryton.org/)
Installation
diff --git a/PKG-INFO b/PKG-INFO
index ec2473f..a701ca7 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_product_cost_history
-Version: 2.8.0
+Version: 3.0.0
Summary: Tryton module to historize product cost
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: UNKNOWN
License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
Description: trytond_product_cost_history
============================
@@ -59,6 +59,7 @@ Classifier: Natural Language :: English
Classifier: Natural Language :: French
Classifier: Natural Language :: German
Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.6
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index c7f225b..db222a1 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.product.cost_history,cost_price:"
msgid "Cost Price"
-msgstr "Prix de Revient"
+msgstr "Prix de revient"
msgctxt "field:product.product.cost_history,create_date:"
msgid "Create Date"
@@ -53,7 +53,3 @@ msgstr "Historique du coût du produit"
msgctxt "view:product.product.cost_history:"
msgid "Product Cost History"
msgstr "Historique du coût du produit"
-
-msgctxt "view:product.product.cost_history:"
-msgid "Product Cost History"
-msgstr "Historique du coût du produit"
diff --git a/locale/fr_FR.po b/locale/sl_SI.po
similarity index 71%
copy from locale/fr_FR.po
copy to locale/sl_SI.po
index c7f225b..b5b16dd 100644
--- a/locale/fr_FR.po
+++ b/locale/sl_SI.po
@@ -4,19 +4,19 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.product.cost_history,cost_price:"
msgid "Cost Price"
-msgstr "Prix de Revient"
+msgstr "Nabavna cena"
msgctxt "field:product.product.cost_history,create_date:"
msgid "Create Date"
-msgstr "Date de création"
+msgstr "Ustvarjeno"
msgctxt "field:product.product.cost_history,create_uid:"
msgid "Create User"
-msgstr "Créé par"
+msgstr "Ustvaril"
msgctxt "field:product.product.cost_history,date:"
msgid "Date"
-msgstr "Date"
+msgstr "Datum"
msgctxt "field:product.product.cost_history,id:"
msgid "ID"
@@ -24,36 +24,32 @@ msgstr "ID"
msgctxt "field:product.product.cost_history,rec_name:"
msgid "Name"
-msgstr "Nom"
+msgstr "Ime"
msgctxt "field:product.product.cost_history,template:"
msgid "Product"
-msgstr "Produit"
+msgstr "Izdelek"
msgctxt "field:product.product.cost_history,write_date:"
msgid "Write Date"
-msgstr "Date de mise à jour"
+msgstr "Zapisano"
msgctxt "field:product.product.cost_history,write_uid:"
msgid "Write User"
-msgstr "Mis à jour par"
+msgstr "Zapisal"
msgctxt "model:ir.action,name:act_product_cost_history_form"
msgid "Product Cost History"
-msgstr "Historique du coût du produit"
+msgstr "Zgodovina cen izdelka"
msgctxt "model:ir.action,name:wizard_product_cost_history_open"
msgid "Cost History"
-msgstr "Historique de coût"
+msgstr "Zgodovina cen"
msgctxt "model:product.product.cost_history,name:"
msgid "History of Product Cost"
-msgstr "Historique du coût du produit"
+msgstr "Zgodovina cen izdelka"
msgctxt "view:product.product.cost_history:"
msgid "Product Cost History"
-msgstr "Historique du coût du produit"
-
-msgctxt "view:product.product.cost_history:"
-msgid "Product Cost History"
-msgstr "Historique du coût du produit"
+msgstr "Zgodovina cen izdelka"
diff --git a/product.py b/product.py
index 2886939..489e079 100644
--- a/product.py
+++ b/product.py
@@ -1,5 +1,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.
+from sql import Column
+from sql.aggregate import Max
+from sql.conditionals import Coalesce
+from sql.functions import Trim, Substring
+
from trytond.model import ModelView, ModelSQL, fields
from trytond.wizard import Wizard, StateAction
from trytond.pyson import PYSONEncoder
@@ -22,28 +27,32 @@ class ProductCostHistory(ModelSQL, ModelView):
super(ProductCostHistory, cls).__setup__()
cls._order.insert(0, ('date', 'DESC'))
- @staticmethod
- def table_query():
+ @classmethod
+ def table_query(cls):
pool = Pool()
Property = pool.get('ir.property')
Field = pool.get('ir.model.field')
- return ('SELECT '
- 'MAX(h.__id) AS id, '
- 'MAX(h.create_uid) AS create_uid, '
- 'MAX(h.create_date) AS create_date, '
- 'MAX(h.write_uid) AS write_uid, '
- 'MAX(h.write_date) AS write_date, '
- 'COALESCE(h.write_date, h.create_date) AS date, '
- 'CAST(TRIM(\',\' FROM SUBSTRING(h.res FROM \',.*\')) AS '
- 'INTEGER) AS template, '
- 'CAST(TRIM(\',\' FROM h.value) AS NUMERIC) AS cost_price '
- 'FROM "' + Property._table + '__history" h '
- 'JOIN "' + Field._table + '" f ON (f.id = h.field) '
- 'WHERE f.name = \'cost_price\' '
- 'AND h.res LIKE \'product.template,%%\' '
- 'GROUP BY h.id, COALESCE(h.write_date, h.create_date), h.res, '
- 'h.value',
- [])
+ property_history = Property.__table_history__()
+ field = Field.__table__()
+ return property_history.join(field,
+ condition=field.id == property_history.field
+ ).select(Max(Column(property_history, '__id')).as_('id'),
+ Max(property_history.create_uid).as_('create_uid'),
+ Max(property_history.create_date).as_('create_date'),
+ Max(property_history.write_uid).as_('write_uid'),
+ Max(property_history.write_date).as_('write_date'),
+ Coalesce(property_history.write_date,
+ property_history.create_date).as_('date'),
+ Trim(Substring(property_history.res, ',.*'), 'LEADING', ','
+ ).cast(cls.template.sql_type().base).as_('template'),
+ Trim(property_history.value, 'LEADING', ','
+ ).cast(cls.cost_price.sql_type().base).as_('cost_price'),
+ where=(field.name == 'cost_price')
+ & property_history.res.like('product.template,%'),
+ group_by=(property_history.id,
+ Coalesce(property_history.write_date,
+ property_history.create_date),
+ property_history.res, property_history.value))
class OpenProductCostHistory(Wizard):
diff --git a/setup.py b/setup.py
index d6f0ae7..ca4d9a1 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
major_version = int(major_version)
minor_version = int(minor_version)
-requires = []
+requires = ['python-sql']
for dep in info.get('depends', []):
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
requires.append('trytond_%s >= %s.%s, < %s.%s' %
@@ -63,6 +63,7 @@ setup(name='trytond_product_cost_history',
'Natural Language :: French',
'Natural Language :: German',
'Natural Language :: Russian',
+ 'Natural Language :: Slovenian',
'Natural Language :: Spanish',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
diff --git a/tests/__init__.py b/tests/__init__.py
index a1e1c5f..b651e41 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -2,3 +2,5 @@
#this repository contains the full copyright notices and license terms.
from .test_product_cost_history import suite
+
+__all__ = ['suite']
diff --git a/tryton.cfg b/tryton.cfg
index 72c0e73..9860507 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=2.8.0
+version=3.0.0
depends:
ir
product
diff --git a/trytond_product_cost_history.egg-info/PKG-INFO b/trytond_product_cost_history.egg-info/PKG-INFO
index ce47c6c..7b6670a 100644
--- a/trytond_product_cost_history.egg-info/PKG-INFO
+++ b/trytond_product_cost_history.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-product-cost-history
-Version: 2.8.0
+Version: 3.0.0
Summary: Tryton module to historize product cost
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: UNKNOWN
License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
Description: trytond_product_cost_history
============================
@@ -59,6 +59,7 @@ Classifier: Natural Language :: English
Classifier: Natural Language :: French
Classifier: Natural Language :: German
Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.6
diff --git a/trytond_product_cost_history.egg-info/SOURCES.txt b/trytond_product_cost_history.egg-info/SOURCES.txt
index 21c03af..74eb186 100644
--- a/trytond_product_cost_history.egg-info/SOURCES.txt
+++ b/trytond_product_cost_history.egg-info/SOURCES.txt
@@ -23,6 +23,7 @@ locale/es_ES.po
locale/fr_FR.po
locale/nl_NL.po
locale/ru_RU.po
+locale/sl_SI.po
trytond_product_cost_history.egg-info/PKG-INFO
trytond_product_cost_history.egg-info/SOURCES.txt
trytond_product_cost_history.egg-info/dependency_links.txt
diff --git a/trytond_product_cost_history.egg-info/requires.txt b/trytond_product_cost_history.egg-info/requires.txt
index fd5ae88..a1fea53 100644
--- a/trytond_product_cost_history.egg-info/requires.txt
+++ b/trytond_product_cost_history.egg-info/requires.txt
@@ -1,2 +1,3 @@
-trytond_product >= 2.8, < 2.9
-trytond >= 2.8, < 2.9
\ No newline at end of file
+python-sql
+trytond_product >= 3.0, < 3.1
+trytond >= 3.0, < 3.1
\ No newline at end of file
--
tryton-modules-product-cost-history
More information about the tryton-debian-vcs
mailing list