Commit 4a31d891 authored by Tatuya Kamada's avatar Tatuya Kamada

revert r30019 Trade Model Line changing until discussion concludes


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30021 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6b0fb0d2
...@@ -201,7 +201,6 @@ class TradeModelLine(Predicate, XMLMatrix, Amount): ...@@ -201,7 +201,6 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
'stop_date': context.getStopDate(), 'stop_date': context.getStopDate(),
'create_line': self.isCreateLine(), 'create_line': self.isCreateLine(),
'trade_phase_list': self.getTradePhaseList(), 'trade_phase_list': self.getTradePhaseList(),
'efficiency': self.getEfficiency(),
} }
common_params.update(property_dict) common_params.update(property_dict)
...@@ -224,7 +223,6 @@ class TradeModelLine(Predicate, XMLMatrix, Amount): ...@@ -224,7 +223,6 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
variation_base_category_list = cell.getVariationBaseCategoryList(), variation_base_category_list = cell.getVariationBaseCategoryList(),
variation_category_list = cell.getVariationCategoryList(), variation_category_list = cell.getVariationCategoryList(),
price = cell.getPrice(), price = cell.getPrice(),
base_quantity = cell.getQuantity(0.0),
quantity = cell.getQuantity(0.0), quantity = cell.getQuantity(0.0),
**common_params **common_params
) )
...@@ -233,7 +231,6 @@ class TradeModelLine(Predicate, XMLMatrix, Amount): ...@@ -233,7 +231,6 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
tmp_movement = newTempSimulationMovement(self.getPortalObject(), tmp_movement = newTempSimulationMovement(self.getPortalObject(),
self_id, self_id,
quantity = self.getQuantity(0.0), quantity = self.getQuantity(0.0),
base_quantity = self.getQuantity(0.0),
price = self.getPrice(), price = self.getPrice(),
**common_params **common_params
) )
...@@ -258,17 +255,10 @@ class TradeModelLine(Predicate, XMLMatrix, Amount): ...@@ -258,17 +255,10 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
# at least one base application is in base contributions and # at least one base application is in base contributions and
# if the movement have no variation category, it's the same as # if the movement have no variation category, it's the same as
# if he have all variation categories # if he have all variation categories
original_quantity = tmp_movement.getQuantity(0.0) quantity = tmp_movement.getQuantity(0.0)
total_price = movement.getTotalPrice()
base_quantity = original_quantity + total_price
quantity = original_quantity + total_price * self.getEfficiency()
modified = 1 modified = 1
rounding_method = self.getRoundingMethod() tmp_movement.setQuantity(quantity + movement.getTotalPrice())
if rounding_method:
roundQuantity = getattr(self, 'TradeModelLine_roundQuantity', None)
if roundQuantity is not None:
quantity = roundQuantity(context, quantity, rounding_method)
tmp_movement.edit(base_quantity=base_quantity, quantity=quantity)
else: else:
# if the quantity is defined, use it # if the quantity is defined, use it
modified = 1 modified = 1
......
...@@ -48,5 +48,5 @@ class TradeModelLine: ...@@ -48,5 +48,5 @@ class TradeModelLine:
) )
_categories = ( _categories = (
'base_application', 'base_contribution', 'trade_phase', 'rounding_method', 'base_application', 'base_contribution', 'trade_phase',
) )
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