Commit fb4305ac authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_core: keep line price

parent fe231746
......@@ -211,6 +211,7 @@ class Inventory(Delivery):
movement.getInventoriatedQuantity() not in (None, ''):
movement_quantity = movement.getInventoriatedQuantity()
price = movement.getPrice()
# construct key to retrieve inventory into dict
getter_list = [x['getter'] for x in inventory_calculation_dict['first_level']]
key_list = []
......@@ -262,6 +263,7 @@ class Inventory(Delivery):
# before insert but not before delete
if diff_quantity != 0:
kwd['quantity'] = diff_quantity
kwd['inventory_line_price'] = price
category_list = self.getCategoryList()
setter_list = [x['setter'] for x in inventory_calculation_dict['first_level']]
......
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery
def getResourceInternalPriceSortKeyMethod(high_priority_supply_line_list):
def resourceInternalPriceSortKeyMethod(a):
high_priority_supply_line_list_len = len(high_priority_supply_line_list)
......@@ -137,6 +136,9 @@ if specialise_set:
kw['categories'] = kw.get('categories', []) + ['specialise/%s' % x for x in specialise_set]
if resource is not None:
line_price = getattr(context, 'inventory_line_price', None)
if line_price:
return {"price": line_price}
product_line = resource.getProductLine()
if product_line:
kw['categories'] = kw.get('categories', []) + ['product_line/%s' % product_line]
......
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