changeset 01358c0c57d1 in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=01358c0c57d1
description:
        Add product_cost_warehouse module

        issue9312
        review291641002
diffstat:

 exceptions.py |  4 ++++
 product.py    |  9 ++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 532ecf3087f9 -r 01358c0c57d1 exceptions.py
--- a/exceptions.py     Sun Mar 21 12:52:58 2021 +0100
+++ b/exceptions.py     Sun Mar 21 15:49:07 2021 +0100
@@ -8,6 +8,10 @@
     pass
 
 
+class MoveValidationError(ValidationError):
+    pass
+
+
 class LocationValidationError(ValidationError):
     pass
 
diff -r 532ecf3087f9 -r 01358c0c57d1 product.py
--- a/product.py        Sun Mar 21 12:52:58 2021 +0100
+++ b/product.py        Sun Mar 21 15:49:07 2021 +0100
@@ -285,13 +285,16 @@
             ('state', '=', 'done'),
             ]
 
+    @classmethod
+    def _domain_storage_quantity(cls):
+        "Returns the domain for locations to use in cost computation"
+        return [('type', '=', 'storage')]
+
     def _get_storage_quantity(self, date=None):
         pool = Pool()
         Location = pool.get('stock.location')
 
-        locations = Location.search([
-            ('type', '=', 'storage'),
-            ])
+        locations = Location.search(self._domain_storage_quantity())
         if not date:
             date = datetime.date.today()
         location_ids = [l.id for l in locations]

Reply via email to