Commit 67b88f58 authored by Lucas Carvalho's avatar Lucas Carvalho

Added the implementation to create the Solver object and its subobjects.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45004 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e91de331
...@@ -56,6 +56,26 @@ class SolverConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -56,6 +56,26 @@ class SolverConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def build(self, business_configuration): def build(self, business_configuration):
portal = self.getPortalObject() portal = self.getPortalObject()
simulation_rule_solver = portal.ERPSite_getConfiguratorSimulationSolverDict()
raise NotImplemented solver = getattr(portal.portal_solvers, self.getId(), None)
# self.install(rule, business_configuration) if solver is None:
solver_property_dict = \
business_configuration.BusinessConfiguration_getSolverPropertyDict()
property_dict = solver_property_dict.get(self.getId())
argument_dict = {}
for k, v in property_dict.iteritems():
if k not in ("content_list",) and k in self.showDict():
argument_dict[k] = v
solver = portal.portal_solvers.newContent(portal_type="Solver Type",
id=argument_dict.pop('id'))
solver.edit(**argument_dict)
for information_dict in self.content_list:
portal_type = information_dict.pop('portal_type')
id = information_dict.pop('id')
action = solver.newContent(portal_type=portal_type, id=id)
action.edit(**information_dict)
self.install(solver, business_configuration)
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