[tryton-debian-vcs] tryton-modules-stock branch upstream-4.0 updated. upstream/4.0.4-1-g45466ea
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Mon Dec 19 18:50:58 UTC 2016
The following commit has been merged in the upstream-4.0 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-stock.git;a=commitdiff;h=upstream/4.0.4-1-g45466ea
commit 45466ea0dd92e4afe0257d7d452007f6e7e4a433
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Mon Dec 19 12:02:37 2016 +0100
Adding upstream version 4.0.5.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index a985d29..1b8178c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.0.5 - 2016-12-17
+* Bug fixes (see mercurial logs for details)
+
Version 4.0.4 - 2016-11-06
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 4eaf904..9872713 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond_stock
-Version: 4.0.4
+Version: 4.0.5
Summary: Tryton module for stock and inventory
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/product.py b/product.py
index 047af08..2cd9149 100644
--- a/product.py
+++ b/product.py
@@ -17,6 +17,7 @@ from trytond.transaction import Transaction
from trytond.pool import Pool, PoolMeta
from trytond.tools import grouped_slice
+from trytond.modules.product import TemplateFunction
from .move import StockMixin
__all__ = ['Template', 'Product',
@@ -189,7 +190,7 @@ class Product(StockMixin, object):
pool = Pool()
Template = pool.get('product.template')
- if hasattr(cls, 'cost_price'):
+ if not isinstance(cls.cost_price, TemplateFunction):
digits = cls.cost_price.digits
write = cls.write
record = lambda p: p
@@ -230,7 +231,7 @@ class Product(StockMixin, object):
context = Transaction().context
- if hasattr(self.__class__, 'cost_price'):
+ if not isinstance(self.__class__.cost_price, TemplateFunction):
product_clause = ('product', '=', self.id)
else:
product_clause = ('product.template', '=', self.template.id)
diff --git a/tests/scenario_stock_average_cost_price.rst b/tests/scenario_stock_average_cost_price.rst
index 7a19b2b..62d9d7f 100644
--- a/tests/scenario_stock_average_cost_price.rst
+++ b/tests/scenario_stock_average_cost_price.rst
@@ -152,6 +152,13 @@ Check Cost Price Average is 175::
>>> product.template.cost_price
Decimal('175.0000')
+Change Cost Price to 125, to force to write recomputed price later::
+
+ >>> product.template.cost_price = Decimal('125.0000')
+ >>> product.template.save()
+ >>> product.template.cost_price
+ Decimal('125.0000')
+
Recompute Cost Price::
>>> recompute = Wizard('product.recompute_cost_price', [product])
diff --git a/tryton.cfg b/tryton.cfg
index 64ac800..4bb381e 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=4.0.4
+version=4.0.5
depends:
company
currency
diff --git a/trytond_stock.egg-info/PKG-INFO b/trytond_stock.egg-info/PKG-INFO
index f8e9675..1725d5e 100644
--- a/trytond_stock.egg-info/PKG-INFO
+++ b/trytond_stock.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond-stock
-Version: 4.0.4
+Version: 4.0.5
Summary: Tryton module for stock and inventory
Home-page: http://www.tryton.org/
Author: Tryton
--
tryton-modules-stock
More information about the tryton-debian-vcs
mailing list