Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
3318f376
Commit
3318f376
authored
Jan 23, 2019
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OrganisationConfiguratorItem: get organisation id from user input
parent
14a0b7c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
23 deletions
+22
-23
product/ERP5Configurator/Document/OrganisationConfiguratorItem.py
...ERP5Configurator/Document/OrganisationConfiguratorItem.py
+22
-23
No files found.
product/ERP5Configurator/Document/OrganisationConfiguratorItem.py
View file @
3318f376
...
...
@@ -60,29 +60,28 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject):
""" Setup organisation. """
if
fixit
:
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
(),
'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
(),
'site'
:
'main'
,
# First customer's organisation is always main site.
}
organisation
.
edit
(
**
org_dict
)
business_configuration
=
self
.
getBusinessConfigurationValue
()
# store globally organization_id
business_configuration
.
setGlobalConfigurationAttr
(
organisation_id
=
organisation
.
getId
())
business_configuration
=
self
.
getBusinessConfigurationValue
()
# store globally organization_id
business_configuration
.
setGlobalConfigurationAttr
(
organisation_id
=
organisation
.
getId
())
if
self
.
portal_workflow
.
isTransitionPossible
(
organisation
,
'validate'
):
organisation
.
validate
(
comment
=
translateString
(
"Validated by Configurator"
))
if
self
.
portal_workflow
.
isTransitionPossible
(
organisation
,
'validate'
):
organisation
.
validate
(
comment
=
translateString
(
"Validated by Configurator"
))
## add to customer template
self
.
install
(
organisation
,
business_configuration
)
return
[
'Organisation should be created'
,]
## add to customer template
self
.
install
(
organisation
,
business_configuration
)
return
[
'Organisation should be update'
,]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment