Commit ae759e3a by Rafael Monnerat Committed by Alain Takoudjou

slapos_accounting: Ensure the 3 preferences are set

If they are not, it mess up the simulation.
1 parent 39f3220d
...@@ -19,7 +19,7 @@ consumption_specialise_uid_list = [q.getUid() for q in portal.portal_catalog( ...@@ -19,7 +19,7 @@ consumption_specialise_uid_list = [q.getUid() for q in portal.portal_catalog(
select_dict= {'default_aggregate_portal_type': None} select_dict= {'default_aggregate_portal_type': None}
select_kw.update( select_kw.update(
limit=10, # just take a bit limit=100, # just take a bit
portal_type='Sale Packing List Line', portal_type='Sale Packing List Line',
simulation_state='delivered', simulation_state='delivered',
parent_specialise_uid=specialise_uid_list+consumption_specialise_uid_list, parent_specialise_uid=specialise_uid_list+consumption_specialise_uid_list,
...@@ -36,6 +36,15 @@ specialise = portal.portal_preferences.getPreferredAggregatedSaleTradeCondition( ...@@ -36,6 +36,15 @@ specialise = portal.portal_preferences.getPreferredAggregatedSaleTradeCondition(
subscription_request_specialise = portal.portal_preferences.getPreferredAggregatedSubscriptionSaleTradeCondition() subscription_request_specialise = portal.portal_preferences.getPreferredAggregatedSubscriptionSaleTradeCondition()
consumption_specialise = portal.portal_preferences.getPreferredAggregatedConsumptionSaleTradeCondition() consumption_specialise = portal.portal_preferences.getPreferredAggregatedConsumptionSaleTradeCondition()
if specialise is None:
raise ValueError("Preferred Aggregated Sale Trade Condition is not Defined, please check your preferences.")
if subscription_request_specialise is None:
raise ValueError("Preferred Aggregated Subscription Sale Trade Condition is not Defined, please check your preferences.")
if consumption_specialise is None:
raise ValueError("Preferred Aggregated Consumption Sale Trade Condition is not Defined, please check your preferences.")
temp_movement_list = [] temp_movement_list = []
for movement in movement_list: for movement in movement_list:
if movement.getGroupingReference() is not None: if movement.getGroupingReference() is not None:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!