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

OrganisationConfiguratorItem: get organisation id from user input

parent 14a0b7c2
...@@ -60,8 +60,8 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -60,8 +60,8 @@ 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(), org_dict = {'price_currency': 'currency_module/%s' % self.getPriceCurrency(),
'group': self.getGroup(), 'group': self.getGroup(),
'title': self.getTitle(), 'title': self.getTitle(),
...@@ -72,7 +72,6 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -72,7 +72,6 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject):
'default_address_zip_code': self.getDefaultAddressZipCode(), 'default_address_zip_code': self.getDefaultAddressZipCode(),
'default_address_region': self.getDefaultAddressRegion(), 'default_address_region': self.getDefaultAddressRegion(),
'default_address_street_address': self.getDefaultAddressStreetAddress(), 'default_address_street_address': self.getDefaultAddressStreetAddress(),
'site':'main', # First customer's organisation is always main site.
} }
organisation.edit(**org_dict) organisation.edit(**org_dict)
...@@ -85,4 +84,4 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -85,4 +84,4 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject):
## add to customer template ## add to customer template
self.install(organisation, business_configuration) self.install(organisation, business_configuration)
return ['Organisation should be created',] return ['Organisation should be update',]
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