Fix non applying patch for stock
This commit is contained in:
parent
a3a4a9cfe6
commit
aafa2ce839
|
@ -1,8 +1,6 @@
|
|||
Index: move.py
|
||||
===================================================================
|
||||
|
||||
--- ./modules/stock/move.py
|
||||
+++ ./modules/stock/move.py
|
||||
diff --git a/modules/stock/move.py b/modules/stock/move.py
|
||||
--- a/modules/stock/move.py
|
||||
+++ b/modules/stock/move.py
|
||||
@@ -4,12 +4,15 @@
|
||||
import operator
|
||||
from decimal import Decimal
|
||||
|
@ -476,12 +474,9 @@ Index: move.py
|
|||
+ quantities[key] = Uom.round(quantity, uom.rounding)
|
||||
+
|
||||
+ return quantities
|
||||
|
||||
Index: product.py
|
||||
===================================================================
|
||||
|
||||
--- ./modules/stock/product.py
|
||||
+++ ./modules/stock/product.py
|
||||
diff --git a/modules/stock/product.py b/modules/stock/product.py
|
||||
--- a/modules/stock/product.py
|
||||
+++ b/modules/stock/product.py
|
||||
@@ -2,9 +2,8 @@
|
||||
#this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
|
@ -502,24 +497,10 @@ Index: product.py
|
|||
from trytond.pool import Pool, PoolMeta
|
||||
|
||||
from .move import StockMixin
|
||||
@@ -122,348 +120,52 @@
|
||||
uom of the product.
|
||||
|
||||
The context with keys:
|
||||
- stock_date_end: if set the date of the stock computation.
|
||||
- stock_date_start: if set return the delta of the stock
|
||||
- between the two dates, (ignored if stock_date_end is
|
||||
- missing).
|
||||
- stock_assign: if set compute also the assigned moves as done.
|
||||
- forecast: if set compute the forecast quantity.
|
||||
- stock_destinations: A list of location ids. If set, restrict
|
||||
- the computation to moves from and to those locations.
|
||||
- stock_skip_warehouse: if set, quantities on a warehouse are no
|
||||
- more quantities of all child locations but quantities of
|
||||
- the storage zone.
|
||||
- If product_ids is None all products are used.
|
||||
- If with_childs, it computes also for child locations.
|
||||
- grouping defines how stock moves are grouped.
|
||||
@@ -136,322 +134,40 @@
|
||||
If product_ids is None all products are used.
|
||||
If with_childs, it computes also for child locations.
|
||||
grouping defines how stock moves are grouped.
|
||||
+ stock_skip_warehouse: if set, quantities on a warehouse are no more
|
||||
+ quantities of all child locations but quantities of the storage
|
||||
+ zone.
|
||||
|
@ -854,34 +835,14 @@ Index: product.py
|
|||
+ grouping=grouping, grouping_filter=grouping_filter)
|
||||
+ if query is None:
|
||||
+ return {}
|
||||
+ quantities = Move.compute_quantities(query, location_ids, with_childs,
|
||||
+ res = Move.compute_quantities(query, location_ids, with_childs,
|
||||
+ grouping=grouping, grouping_filter=grouping_filter)
|
||||
|
||||
if wh_to_add:
|
||||
if product_ids is None:
|
||||
product_ids = set((p for s, p in res))
|
||||
for wh, storage in wh_to_add.iteritems():
|
||||
for product in product_ids:
|
||||
- if (storage, product) in res:
|
||||
- res[(wh, product)] = res[(storage, product)]
|
||||
+ if (storage, product) in quantities:
|
||||
+ quantities[(wh, product)] = quantities[
|
||||
+ (storage, product)]
|
||||
if storage in storage_to_remove:
|
||||
- del res[(storage, product)]
|
||||
-
|
||||
- return res
|
||||
+ del quantities[(storage, product)]
|
||||
+ return quantities
|
||||
|
||||
|
||||
class ProductByLocationStart(ModelView):
|
||||
|
||||
Index: tests/test_stock.py
|
||||
===================================================================
|
||||
|
||||
--- ./modules/stock/tests/test_stock.py
|
||||
+++ ./modules/stock/tests/test_stock.py
|
||||
diff --git a/modules/stock/tests/test_stock.py b/modules/stock/tests/test_stock.py
|
||||
--- a/modules/stock/tests/test_stock.py
|
||||
+++ b/modules/stock/tests/test_stock.py
|
||||
@@ -280,6 +280,68 @@
|
||||
else:
|
||||
self.assertEqual(product_reloaded.quantity, quantity)
|
||||
|
@ -959,4 +920,3 @@ Index: tests/test_stock.py
|
|||
|
||||
test_products_by_location()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue