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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
41e70249
Commit
41e70249
authored
Aug 09, 2018
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: bypass type-based method in proxy roles script
parent
7d81dea4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py
...erp5_corporate_identity/Base_getTemplateProxyParameter.py
+26
-3
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py
View file @
41e70249
...
...
@@ -26,6 +26,29 @@ def err(my_value):
#return "XXX No " + my_value + " defined."
return
""
def
getCoordinateText
(
obj
):
# This prevent obj.getCoordinateText to use a type-based method like
# Telephone_asText, this is required because the proxy roles privileges of
# this script are not propagated to the type-based method.
output
=
[]
country
=
obj
.
getTelephoneCountry
()
area
=
obj
.
getTelephoneArea
()
city
=
obj
.
getTelephoneCity
()
number
=
obj
.
getTelephoneNumber
()
extension
=
obj
.
getTelephoneExtension
()
if
country
:
output
.
append
(
"+"
+
country
+
"(0)"
)
if
area
:
output
.
append
(
area
)
if
city
:
output
.
append
(
city
)
if
number
:
output
.
append
(
number
)
output
=
"-"
.
join
(
output
)
if
extension
:
output
+=
"/"
+
extension
return
output
def
populateProductDictFromCategoryList
(
my_category_list
):
result_list
=
[]
for
category
in
my_category_list
:
...
...
@@ -95,7 +118,7 @@ def populatePersonDict(my_person_list):
output_dict
[
"country"
]
=
err
(
"country"
)
output_dict
[
"codification"
]
=
err
(
"country code"
)
if
person_default_telephone
is
not
None
:
output_dict
[
"phone"
]
=
person_default_telephone
.
getCoordinateText
(
)
or
err
(
"phone"
)
output_dict
[
"phone"
]
=
getCoordinateText
(
person_default_telephone
)
or
err
(
"phone"
)
else
:
output_dict
[
"phone"
]
=
err
(
"phone"
)
if
person_default_mail
is
not
None
:
...
...
@@ -152,11 +175,11 @@ def populateOrganisationDict(my_organisation_list):
output_dict
[
"country"
]
=
err
(
"country"
)
output_dict
[
"codification"
]
=
err
(
"country code"
)
if
organisation_phone
is
not
None
:
output_dict
[
"phone"
]
=
organisation_phone
.
getDefaultTelephoneCoordinateText
(
)
or
err
(
"phone"
)
output_dict
[
"phone"
]
=
getCoordinateText
(
organisation_phone
)
or
err
(
"phone"
)
else
:
output_dict
[
"phone"
]
=
err
(
"phone"
)
if
organisation_fax
is
not
None
:
output_dict
[
"fax"
]
=
organisation_fax
.
getCoordinateText
(
)
or
err
(
"fax"
)
output_dict
[
"fax"
]
=
getCoordinateText
(
organisation_fax
)
or
err
(
"fax"
)
else
:
output_dict
[
"fax"
]
=
err
(
"fax"
)
if
len
(
organisation_link_list
)
==
1
:
...
...
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