Commit daa11512 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_base: use price currency and use destination decision to check stock

parent 0884ab1b
......@@ -462,6 +462,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
resource_value=resource_value,
# Hardcoded price for optimization
price=0,
price_currency = supply.getPriceCurrency(),
destination_value=supply.getDestinationValue(),
destination_section_value=supply.getDestinationSectionValue(),
source_value=supply.getSourceValue(),
......@@ -509,7 +510,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
# Prepare history list to work with
history_list = resource_value.Resource_getInventoryHistoryList(
from_date=from_date,
node_uid=supply.getDestinationUidList()
node_uid=supply.getParentValue().getDestinationDecisionUidList()
# XXX This should be bound to a stard and stop date
)
#self.log("history_list len: %s" % len(history_list))
......@@ -542,14 +543,14 @@ class BuilderMixin(XMLObject, Amount, Predicate):
future_inventory_to_date = portal.portal_simulation.getFutureInventory(
to_date=limit_date_list[0],
resource_uid=resource_value.getUid(),
node_uid=supply.getDestinationUidList(),
node_uid=supply.getParentValue().getDestinationDecisionUidList(),
)
# We update history_list to include movements from the initial inventory date
history_list = resource_value.Resource_getInventoryHistoryList(
from_date=limit_date_list[0],
to_date=history_list[0][0],
node_uid=supply.getDestinationUidList()
node_uid=supply.getParentValue().getDestinationDecisionUidList()
) + history_list
next_period_history_list = []
......
......@@ -44,11 +44,11 @@
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:520, 35: Unused variable \'portal_type\' (unused-variable)</string>
<string>W:663, 18: Unused variable \'total_inventory\' (unused-variable)</string>
<string>W:521, 35: Unused variable \'portal_type\' (unused-variable)</string>
<string>W:664, 18: Unused variable \'total_inventory\' (unused-variable)</string>
<string>W:421, 4: Unused variable \'original_min_stock_value\' (unused-variable)</string>
<string>W:422, 4: Unused variable \'original_factor\' (unused-variable)</string>
<string>W:520, 14: Unused variable \'inventory\' (unused-variable)</string>
<string>W:521, 14: Unused variable \'inventory\' (unused-variable)</string>
</tuple>
</value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment