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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
erp5
Commits
292f9791
Commit
292f9791
authored
Apr 22, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_configurator_standard: check coding style
parent
b508e53d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
36 deletions
+75
-36
bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_afterConfiguration.py
...ator_standard/BusinessConfiguration_afterConfiguration.py
+4
-7
bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_setupEmployeesNumber.py
...or_standard/BusinessConfiguration_setupEmployeesNumber.py
+2
-3
bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/ERP5Site_getTranslationMessageInConfiguratorUIAsPOT.py
...rd/ERP5Site_getTranslationMessageInConfiguratorUIAsPOT.py
+3
-3
bt5/erp5_configurator_standard/TestTemplateItem/portal_components/test.erp5.testStandardConfigurationWorkflow.py
...components/test.erp5.testStandardConfigurationWorkflow.py
+4
-3
bt5/erp5_configurator_standard/TestTemplateItem/portal_components/test.erp5.testStandardConfigurationWorkflow.xml
...omponents/test.erp5.testStandardConfigurationWorkflow.xml
+62
-19
bt5/erp5_configurator_standard/bt/skip_coding_style_test
bt5/erp5_configurator_standard/bt/skip_coding_style_test
+0
-1
No files found.
bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_afterConfiguration.py
View file @
292f9791
""" This script will be called to apply the customization. """
""" This script will be called to apply the customization. """
from
AccessControl
import
getSecurityManager
from
Products.ERP5Type.Log
import
log
from
Products.ERP5Type.Log
import
log
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
portal_preferences
=
portal
.
portal_preferences
portal_preferences
=
portal
.
portal_preferences
business_template
=
context
.
getSpecialiseValue
()
business_template
=
context
.
getSpecialiseValue
()
N_
=
context
.
Base_translateString
isTransitionPossible
=
portal
.
portal_workflow
.
isTransitionPossible
if
business_template
is
not
None
:
if
business_template
is
not
None
:
# update role settings for modules which exists already
# update role settings for modules which exists already
...
@@ -29,12 +26,12 @@ if business_template is not None:
...
@@ -29,12 +26,12 @@ if business_template is not None:
if
obj
.
getPortalType
()
in
(
'Person'
,
'Organisation'
):
if
obj
.
getPortalType
()
in
(
'Person'
,
'Organisation'
):
for
period
in
obj
.
contentValues
(
filter
=
{
'portal_type'
:
'Accounting Period'
}):
for
period
in
obj
.
contentValues
(
filter
=
{
'portal_type'
:
'Accounting Period'
}):
period
.
updateLocalRolesOnSecurityGroups
()
period
.
updateLocalRolesOnSecurityGroups
()
print
"
\
t
Open (Accounting Period): "
,
period
.
getRelativeUrl
()
print
"
\
t
Open (Accounting Period): "
,
period
.
getRelativeUrl
()
for
assignment
in
obj
.
contentValues
(
filter
=
{
'portal_type'
:
'Assignment'
}):
for
assignment
in
obj
.
contentValues
(
filter
=
{
'portal_type'
:
'Assignment'
}):
assignment
.
updateLocalRolesOnSecurityGroups
()
assignment
.
updateLocalRolesOnSecurityGroups
()
print
"
\
t
Open (assignment): "
,
assignment
.
getRelativeUrl
()
print
"
\
t
Open (assignment): "
,
assignment
.
getRelativeUrl
()
for
gadget
in
context
.
portal_gadgets
.
objectValues
():
for
gadget
in
context
.
portal_gadgets
.
objectValues
():
if
gadget
.
getValidationState
()
==
'invisible'
:
if
gadget
.
getValidationState
()
==
'invisible'
:
...
...
bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_setupEmployeesNumber.py
View file @
292f9791
configuration_save_url
=
kw
.
get
(
'configuration_save_url'
,
None
)
company_employees_number
=
kw
.
get
(
'company_employees_number'
,
1
)
company_employees_number
=
kw
.
get
(
'company_employees_number'
,
1
)
next_transition
=
context
.
getNextTransition
().
getRelativeUrl
()
next_transition
=
context
.
getNextTransition
().
getRelativeUrl
()
...
@@ -6,9 +5,9 @@ if company_employees_number>1:
...
@@ -6,9 +5,9 @@ if company_employees_number>1:
# mark next transition as multiple
# mark next transition as multiple
context
.
setMultiEntryTransition
(
next_transition
,
company_employees_number
)
context
.
setMultiEntryTransition
(
next_transition
,
company_employees_number
)
else
:
else
:
# explicitly reset next transition as not multiple because
# explicitly reset next transition as not multiple because
# we may have already set it as multiple
# we may have already set it as multiple
context
.
setMultiEntryTransition
(
next_transition
,
0
)
context
.
setMultiEntryTransition
(
next_transition
,
0
)
# store globally
# store globally
context
.
setGlobalConfigurationAttr
(
company_employees_number
=
company_employees_number
)
context
.
setGlobalConfigurationAttr
(
company_employees_number
=
company_employees_number
)
bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/ERP5Site_getTranslationMessageInConfiguratorUIAsPOT.py
View file @
292f9791
...
@@ -125,13 +125,13 @@ for row in context.ConfigurationTemplate_readOOCalcFile('standard_currency_list.
...
@@ -125,13 +125,13 @@ for row in context.ConfigurationTemplate_readOOCalcFile('standard_currency_list.
#
#
# Output
# Output
#
#
def
format
(
string
):
def
format
Text
(
string
):
line_list
=
string
.
split
(
'
\
n
'
)
line_list
=
string
.
split
(
'
\
n
'
)
length
=
len
(
line_list
)
length
=
len
(
line_list
)
if
length
==
1
:
if
length
==
1
:
return
'"%s"'
%
string
return
'"%s"'
%
string
else
:
else
:
return
'
\
n
'
.
join
([
'""'
]
+
[
format
(
i
)
for
i
in
line_list
])
return
'
\
n
'
.
join
([
'""'
]
+
[
format
Text
(
i
)
for
i
in
line_list
])
MESSAGE_TEMPLATE
=
'''
\
MESSAGE_TEMPLATE
=
'''
\
...
@@ -145,7 +145,7 @@ for message in message_list:
...
@@ -145,7 +145,7 @@ for message in message_list:
comment_list
=
message_dict
[
message
]
comment_list
=
message_dict
[
message
]
comment_list
.
sort
()
comment_list
.
sort
()
comment
=
'
\
n
'
.
join
([(
'#: %s'
%
i
)
for
i
in
comment_list
])
comment
=
'
\
n
'
.
join
([(
'#: %s'
%
i
)
for
i
in
comment_list
])
print
MESSAGE_TEMPLATE
%
(
comment
,
format
(
message
))
print
MESSAGE_TEMPLATE
%
(
comment
,
format
Text
(
message
))
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/plain'
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/plain'
)
...
...
bt5/erp5_configurator_standard/TestTemplateItem/portal_components/test.erp5.testStandardConfigurationWorkflow.py
View file @
292f9791
...
@@ -35,7 +35,7 @@ from Products.ERP5Type.tests.Sequence import SequenceList
...
@@ -35,7 +35,7 @@ from Products.ERP5Type.tests.Sequence import SequenceList
from
Products.ERP5Type.tests.runUnitTest
import
tests_home
from
Products.ERP5Type.tests.runUnitTest
import
tests_home
from
Products.ERP5Type.tests.utils
import
FileUpload
from
Products.ERP5Type.tests.utils
import
FileUpload
from
erp5.component.module.ConfiguratorTestMixin
import
\
from
erp5.component.module.ConfiguratorTestMixin
import
\
TestLiveConfiguratorWorkflowMixin
TestLiveConfiguratorWorkflowMixin
class
StandardConfigurationMixin
(
TestLiveConfiguratorWorkflowMixin
):
class
StandardConfigurationMixin
(
TestLiveConfiguratorWorkflowMixin
):
"""
"""
...
@@ -556,7 +556,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
...
@@ -556,7 +556,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
"""
"""
# XXX FIXME (Lucas): this is not possible yet, because the Account does not have
# XXX FIXME (Lucas): this is not possible yet, because the Account does not have
# the id set like that, we probably gonna use reference.
# the id set like that, we probably gonna use reference.
return
"""
account_id_list = [
account_id_list = [
'capital', 'profit_loss', 'equipments',
'capital', 'profit_loss', 'equipments',
'inventories', 'bank', 'receivable',
'inventories', 'bank', 'receivable',
...
@@ -566,6 +566,8 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
...
@@ -566,6 +566,8 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
account = self.portal.account_module._getOb(account_id)
account = self.portal.account_module._getOb(account_id)
self.assertNotEquals(account, None,
self.assertNotEquals(account, None,
"%s account is not Found." % account_id)
"%s account is not Found." % account_id)
"""
return
def
stepCheckSolver
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
def
stepCheckSolver
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
"""
...
@@ -945,7 +947,6 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
...
@@ -945,7 +947,6 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
'Business Process'
)
'Business Process'
)
self
.
assertEqual
(
len
(
business_process_list
),
1
)
self
.
assertEqual
(
len
(
business_process_list
),
1
)
business_process
=
business_process_list
[
0
]
destination_decision
=
portal
.
portal_catalog
.
getResultValue
(
destination_decision
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Person'
,
portal_type
=
'Person'
,
reference
=
self
.
sales_manager_reference
)
reference
=
self
.
sales_manager_reference
)
...
...
bt5/erp5_configurator_standard/TestTemplateItem/portal_components/test.erp5.testStandardConfigurationWorkflow.xml
View file @
292f9791
...
@@ -6,10 +6,22 @@
...
@@ -6,10 +6,22 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testStandardConfigurationWorkflow
</string>
</value>
<value>
<string>
testStandardConfigurationWorkflow
</string>
</value>
</item>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testStandardConfigurationWorkflow
</string>
</value>
<value>
<string>
test.erp5.testStandardConfigurationWorkflow
</string>
</value>
...
@@ -24,6 +36,18 @@
...
@@ -24,6 +36,18 @@
<none/>
<none/>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<item>
<key>
<string>
version
</string>
</key>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
<value>
<string>
erp5
</string>
</value>
...
@@ -31,13 +55,28 @@
...
@@ -31,13 +55,28 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -50,7 +89,7 @@
...
@@ -50,7 +89,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -59,26 +98,30 @@
...
@@ -59,26 +98,30 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
bt5/erp5_configurator_standard/bt/skip_coding_style_test
deleted
100644 → 0
View file @
b508e53d
1
\ No newline at end of file
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