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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
f9bea035
Commit
f9bea035
authored
Apr 21, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crm: pylint on py3
parent
cc392900
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
41 deletions
+7
-41
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/EventModule_getEventDetailedLineList.py
...al_skins/erp5_crm/EventModule_getEventDetailedLineList.py
+1
-5
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getHeadOfTextContent.py
...eItem/portal_skins/erp5_crm/Event_getHeadOfTextContent.py
+5
-2
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Folder_getTicketDetailedEventsLineList.py
..._skins/erp5_crm/Folder_getTicketDetailedEventsLineList.py
+1
-1
bt5/erp5_crm/TestTemplateItem/portal_components/test.erp5.testCrmReports.py
...emplateItem/portal_components/test.erp5.testCrmReports.py
+0
-31
bt5/erp5_crm/TestTemplateItem/portal_components/test.erp5.testEditorField.py
...mplateItem/portal_components/test.erp5.testEditorField.py
+0
-2
No files found.
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/EventModule_getEventDetailedLineList.py
View file @
f9bea035
...
@@ -92,11 +92,7 @@ for r_event in event_list:
...
@@ -92,11 +92,7 @@ for r_event in event_list:
unassigned_dic
[
event
.
getSimulationState
()]
=
unassigned_dic
[
event
.
getSimulationState
()]
+
1
unassigned_dic
[
event
.
getSimulationState
()]
=
unassigned_dic
[
event
.
getSimulationState
()]
+
1
unassigned_dic
[
'total'
]
=
unassigned_dic
[
'total'
]
+
1
unassigned_dic
[
'total'
]
=
unassigned_dic
[
'total'
]
+
1
#Sort the result and add unassigned
#Sort the result and add unassigned
def
comparator
(
x
,
y
):
column_list
.
sort
(
key
=
lambda
x
=
(
x
[
'ticket_type'
],
x
[
'ticket_title'
]))
if
x
[
'ticket_type'
]
==
y
[
'ticket_type'
]:
return
cmp
(
x
[
'ticket_title'
],
y
[
'ticket_title'
])
return
cmp
(
x
[
'ticket_type'
],
y
[
'ticket_type'
])
column_list
.
sort
(
comparator
)
if
unassigned_dic
[
'total'
]
>
0
:
column_list
.
append
(
unassigned_dic
)
if
unassigned_dic
[
'total'
]
>
0
:
column_list
.
append
(
unassigned_dic
)
#fill line_list that is returned to report
#fill line_list that is returned to report
line_list
=
[]
line_list
=
[]
...
...
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getHeadOfTextContent.py
View file @
f9bea035
import
six
text
=
context
.
asText
()
text
=
context
.
asText
()
LENGTH
=
25
LENGTH
=
25
#TODO: Think about the display length of multibyte characters.
# TODO: Think about the display length of multibyte characters.
if
six
.
PY3
:
return
text
[:
LENGTH
]
try
:
try
:
return
unicode
(
text
,
'utf-8'
)[:
LENGTH
].
encode
(
'utf-8'
)
return
six
.
text_type
(
unicode
(
text
,
'utf-8'
)
)[:
LENGTH
].
encode
(
'utf-8'
)
except
UnicodeDecodeError
:
except
UnicodeDecodeError
:
return
text
[:
LENGTH
]
return
text
[:
LENGTH
]
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Folder_getTicketDetailedEventsLineList.py
View file @
f9bea035
...
@@ -49,7 +49,7 @@ for r_ticket in ticket_list:
...
@@ -49,7 +49,7 @@ for r_ticket in ticket_list:
for
r_event_causality
in
event_causality_list
:
for
r_event_causality
in
event_causality_list
:
event_causality
=
r_event_causality
.
getObject
()
event_causality
=
r_event_causality
.
getObject
()
#check that one event it isn't related by causality and follow-up with the same ticket
#check that one event it isn't related by causality and follow-up with the same ticket
if
ticket
.
getUid
()
<>
event_causality
.
getFollowUpUid
():
if
ticket
.
getUid
()
!=
event_causality
.
getFollowUpUid
():
line_list
.
append
(
Object
(
uid
=
'new_'
,
line_list
.
append
(
Object
(
uid
=
'new_'
,
ticket
=
''
,
ticket
=
''
,
type
=
event_causality
.
getTranslatedPortalType
(),
type
=
event_causality
.
getTranslatedPortalType
(),
...
...
bt5/erp5_crm/TestTemplateItem/portal_components/test.erp5.testCrmReports.py
View file @
f9bea035
...
@@ -111,36 +111,17 @@ class CrmTestCase(ERP5ReportTestCase):
...
@@ -111,36 +111,17 @@ class CrmTestCase(ERP5ReportTestCase):
if
simulation_state
==
'assigned'
:
if
simulation_state
==
'assigned'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ticket=self.portal.restrictedTraverse(ev.getFollowUp())
self._doWorkflowAction(ev,'assign_action',
follow_up_ticket_type = ticket.getPortalType(),
follow_up_ticket_title = ticket.getTitle())
"""
elif
simulation_state
==
'planned'
:
elif
simulation_state
==
'planned'
:
ev
.
plan
()
ev
.
plan
()
elif
simulation_state
==
'posted'
:
elif
simulation_state
==
'posted'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.start()
"""
elif
simulation_state
==
'delivered'
:
elif
simulation_state
==
'delivered'
:
ev
.
start
()
ev
.
start
()
ev
.
deliver
()
ev
.
deliver
()
elif
simulation_state
==
'new'
:
elif
simulation_state
==
'new'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.receive()
"""
elif
simulation_state
==
'acknowledged'
:
elif
simulation_state
==
'acknowledged'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ticket=self.portal.restrictedTraverse(ev.getFollowUp())
self._doWorkflowAction(ev,'assign_action',
follow_up_ticket_type = ticket.getPortalType(),
follow_up_ticket_title = ticket.getTitle())
self._doWorkflowAction(ev, 'acknowledge_action')
"""
elif
simulation_state
==
'cancelled'
:
elif
simulation_state
==
'cancelled'
:
ev
.
stop
()
ev
.
stop
()
ev
.
cancel
()
ev
.
cancel
()
...
@@ -148,24 +129,12 @@ class CrmTestCase(ERP5ReportTestCase):
...
@@ -148,24 +129,12 @@ class CrmTestCase(ERP5ReportTestCase):
ev
.
delete
()
ev
.
delete
()
elif
simulation_state
==
'expired'
:
elif
simulation_state
==
'expired'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.receive()
ev.expire()
"""
elif
simulation_state
==
'responded'
:
elif
simulation_state
==
'responded'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.receive()
ev.respond()
"""
elif
simulation_state
==
'started'
:
elif
simulation_state
==
'started'
:
ev
.
start
()
ev
.
start
()
elif
simulation_state
==
'ordered'
:
elif
simulation_state
==
'ordered'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.plan()
ev.order()
"""
elif
simulation_state
==
'stopped'
:
elif
simulation_state
==
'stopped'
:
ev
.
stop
()
ev
.
stop
()
# sanity check
# sanity check
...
...
bt5/erp5_crm/TestTemplateItem/portal_components/test.erp5.testEditorField.py
View file @
f9bea035
...
@@ -162,12 +162,10 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -162,12 +162,10 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional):
if
html_text
.
find
(
match_string1
)
==
-
1
:
if
html_text
.
find
(
match_string1
)
==
-
1
:
print
(
html_text
)
print
(
html_text
)
print
(
match_string1
)
print
(
match_string1
)
import
pdb
;
pdb
.
set_trace
()
return
False
return
False
if
html_text
.
find
(
match_string2
)
==
-
1
:
if
html_text
.
find
(
match_string2
)
==
-
1
:
print
(
html_text
)
print
(
html_text
)
print
(
match_string2
)
print
(
match_string2
)
import
pdb
;
pdb
.
set_trace
()
return
False
return
False
return
True
return
True
...
...
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