Commit 3318f376 authored by Xiaowu Zhang's avatar Xiaowu Zhang

OrganisationConfiguratorItem: get organisation id from user input

parent 14a0b7c2
...@@ -60,29 +60,28 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -60,29 +60,28 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject):
""" Setup organisation. """ """ Setup organisation. """
if fixit: if fixit:
portal = self.getPortalObject() portal = self.getPortalObject()
organisation = portal.organisation_module.newContent(portal_type="Organisation") organisation = portal.organisation_module[self.getId()]
if organisation is not None:
org_dict = {'price_currency': 'currency_module/%s' % self.getPriceCurrency(),
'group': self.getGroup(),
'title': self.getTitle(),
'corporate_name': self.getCorporateName(),
'default_address_city': self.getDefaultAddressCity(),
'default_email_text': self.getDefaultEmailText(),
'default_telephone_text': self.getDefaultTelephoneText(),
'default_address_zip_code': self.getDefaultAddressZipCode(),
'default_address_region': self.getDefaultAddressRegion(),
'default_address_street_address': self.getDefaultAddressStreetAddress(),
}
organisation.edit(**org_dict)
org_dict = {'price_currency': 'currency_module/%s' % self.getPriceCurrency(), business_configuration = self.getBusinessConfigurationValue()
'group': self.getGroup(), # store globally organization_id
'title': self.getTitle(), business_configuration.setGlobalConfigurationAttr(organisation_id=organisation.getId())
'corporate_name': self.getCorporateName(),
'default_address_city': self.getDefaultAddressCity(),
'default_email_text': self.getDefaultEmailText(),
'default_telephone_text': self.getDefaultTelephoneText(),
'default_address_zip_code': self.getDefaultAddressZipCode(),
'default_address_region': self.getDefaultAddressRegion(),
'default_address_street_address': self.getDefaultAddressStreetAddress(),
'site':'main', # First customer's organisation is always main site.
}
organisation.edit(**org_dict)
business_configuration = self.getBusinessConfigurationValue() if self.portal_workflow.isTransitionPossible(organisation, 'validate'):
# store globally organization_id organisation.validate(comment=translateString("Validated by Configurator"))
business_configuration.setGlobalConfigurationAttr(organisation_id=organisation.getId())
if self.portal_workflow.isTransitionPossible(organisation, 'validate'): ## add to customer template
organisation.validate(comment=translateString("Validated by Configurator")) self.install(organisation, business_configuration)
return ['Organisation should be update',]
## add to customer template
self.install(organisation, business_configuration)
return ['Organisation should be created',]
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