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
ddd0fe0d
Commit
ddd0fe0d
authored
Jan 23, 2019
by
Xiaowu Zhang
Committed by
Cédric Le Ninivin
May 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OrganisationConfiguratorItem: get organisation id from user input
parent
b4bc25fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
bt5/erp5_configurator/DocumentTemplateItem/portal_components/document.erp5.OrganisationConfiguratorItem.py
..._components/document.erp5.OrganisationConfiguratorItem.py
+21
-22
No files found.
bt5/erp5_configurator/DocumentTemplateItem/portal_components/document.erp5.OrganisationConfiguratorItem.py
View file @
ddd0fe0d
...
...
@@ -61,29 +61,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
)
## add to customer template
self
.
install
(
organisation
,
business_configuration
)
return
[
self
.
_createConstraintMessage
(
'Organisation should be created'
)]
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