[tryton-debian-vcs] tryton-modules-product-cost-history branch upstream updated. upstream/4.2.0-1-g523c03f

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Jun 7 13:34:24 UTC 2017


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

commit 523c03fd9a561bfd9db394045fa3e42a033e02ea
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Jun 7 15:26:48 2017 +0200

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

diff --git a/CHANGELOG b/CHANGELOG
index 7077389..baffdba 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.4.0 - 2017-05-01
+* Bug fixes (see mercurial logs for details)
+
 Version 4.2.0 - 2016-11-28
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index 6f27a5e..fe4df05 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2009-2016 Cédric Krier.
+Copyright (C) 2009-2017 Cédric Krier.
 Copyright (C) 2009-2012 Bertrand Chenal.
-Copyright (C) 2009-2016 B2CK SPRL.
+Copyright (C) 2009-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 6efd6a3..a8f4b99 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_product_cost_history
-Version: 4.2.0
+Version: 4.4.0
 Summary: Tryton module to historize product cost
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/4.2/
+Download-URL: http://downloads.tryton.org/4.4/
 Description: trytond_product_cost_history
         ============================
         
@@ -52,7 +52,7 @@ Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
 Classifier: Intended Audience :: Manufacturing
-Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
 Classifier: Natural Language :: Bulgarian
 Classifier: Natural Language :: Catalan
 Classifier: Natural Language :: Chinese (Simplified)
diff --git a/__init__.py b/__init__.py
index c97aa3e..66114a2 100644
--- a/__init__.py
+++ b/__init__.py
@@ -2,13 +2,12 @@
 # this repository contains the full copyright notices and license terms.
 
 from trytond.pool import Pool
-from .ir import *
 from .product import *
 
 
 def register():
     Pool.register(
-        Property,
+        ProductCostPrice,
         ProductCostHistory,
         module='product_cost_history', type_='model')
     Pool.register(
diff --git a/ir.py b/ir.py
deleted file mode 100644
index 8cdaabe..0000000
--- a/ir.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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 PoolMeta
-
-__all__ = ['Property']
-
-
-class Property:
-    __metaclass__ = PoolMeta
-    __name__ = 'ir.property'
-    _history = True
diff --git a/product.py b/product.py
index 6c811aa..85a318f 100644
--- a/product.py
+++ b/product.py
@@ -3,15 +3,20 @@
 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
-from trytond.pool import Pool
+from trytond.pool import Pool, PoolMeta
 from trytond.transaction import Transaction
 
-__all__ = ['ProductCostHistory', 'OpenProductCostHistory']
+__all__ = ['ProductCostPrice', 'ProductCostHistory', 'OpenProductCostHistory']
+
+
+class ProductCostPrice:
+    __metaclass__ = PoolMeta
+    __name__ = 'product.cost_price'
+    _history = True
 
 
 class ProductCostHistory(ModelSQL, ModelView):
@@ -30,29 +35,20 @@ class ProductCostHistory(ModelSQL, ModelView):
     @classmethod
     def table_query(cls):
         pool = Pool()
-        Property = pool.get('ir.property')
-        Field = pool.get('ir.model.field')
-        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))
+        ProductCostPrice = pool.get('product.cost_price')
+        history = ProductCostPrice.__table_history__()
+        return history.select(Max(Column(history, '__id')).as_('id'),
+            Max(history.create_uid).as_('create_uid'),
+            Max(history.create_date).as_('create_date'),
+            Max(history.write_uid).as_('write_uid'),
+            Max(history.write_date).as_('write_date'),
+            Coalesce(history.write_date,
+                history.create_date).as_('date'),
+            history.template.as_('template'),
+            history.cost_price.as_('cost_price'),
+            group_by=(history.id,
+                Coalesce(history.write_date, history.create_date),
+                history.template, history.cost_price))
 
 
 class OpenProductCostHistory(Wizard):
diff --git a/setup.py b/setup.py
index 1bd42fb..45f466f 100644
--- a/setup.py
+++ b/setup.py
@@ -79,7 +79,7 @@ setup(name=name,
         'Intended Audience :: Financial and Insurance Industry',
         'Intended Audience :: Legal Industry',
         'Intended Audience :: Manufacturing',
-        'License :: OSI Approved :: GNU General Public License (GPL)',
+        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
         'Natural Language :: Bulgarian',
         'Natural Language :: Catalan',
         'Natural Language :: Chinese (Simplified)',
diff --git a/tryton.cfg b/tryton.cfg
index 0626ea1..8333695 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.2.0
+version=4.4.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 42cddbe..6cfc9d6 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: 4.2.0
+Version: 4.4.0
 Summary: Tryton module to historize product cost
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/4.2/
+Download-URL: http://downloads.tryton.org/4.4/
 Description: trytond_product_cost_history
         ============================
         
@@ -52,7 +52,7 @@ Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
 Classifier: Intended Audience :: Manufacturing
-Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
 Classifier: Natural Language :: Bulgarian
 Classifier: Natural Language :: Catalan
 Classifier: Natural Language :: Chinese (Simplified)
diff --git a/trytond_product_cost_history.egg-info/SOURCES.txt b/trytond_product_cost_history.egg-info/SOURCES.txt
index 6c97099..67b1e73 100644
--- a/trytond_product_cost_history.egg-info/SOURCES.txt
+++ b/trytond_product_cost_history.egg-info/SOURCES.txt
@@ -8,7 +8,6 @@ product.xml
 setup.py
 tryton.cfg
 ./__init__.py
-./ir.py
 ./product.py
 ./product.xml
 ./tryton.cfg
diff --git a/trytond_product_cost_history.egg-info/requires.txt b/trytond_product_cost_history.egg-info/requires.txt
index eb32e77..d61b022 100644
--- a/trytond_product_cost_history.egg-info/requires.txt
+++ b/trytond_product_cost_history.egg-info/requires.txt
@@ -1,3 +1,3 @@
 python-sql
-trytond_product >= 4.2, < 4.3
-trytond >= 4.2, < 4.3
+trytond_product >= 4.4, < 4.5
+trytond >= 4.4, < 4.5
-- 
tryton-modules-product-cost-history



More information about the tryton-debian-vcs mailing list