Commit 28829c5e authored by Nicolas Wavrant's avatar Nicolas Wavrant

fixup! erp5_pdm: support calculation of base_price applying to all items of a same slice

parent fab7b627
......@@ -141,16 +141,9 @@ class SupplyLine(Path, Amount, XMLMatrix):
This method creates a new cell
"""
kwd.setdefault('base_id', 'path')
cell = XMLMatrix.newCell(self, *kw, **kwd)
if kwd['base_id'] == 'path' and self.isBasePricePerSlice():
index = self.index[kwd['base_id']][0][kw[0]]
quantity_step_list = [None] + self.getQuantityStepList() + [None]
min_quantity = quantity_step_list[index]
max_quantity = quantity_step_list[index+1]
cell.setSliceQuantityRange((min_quantity, max_quantity))
return cell
return XMLMatrix.newCell(self, *kw, **kwd)
security.declareProtected(Permissions.ModifyPortalContent, 'newCell')
security.declareProtected(Permissions.ModifyPortalContent, 'updateCellSliceParameterList')
def updateCellSliceParameterList(self, base_id):
quantity_step_list = [None] + self.getQuantityStepList(base_id) + [None]
for cell in self.getCellValueList():
......
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