Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
243a4bed
Commit
243a4bed
authored
Nov 23, 2012
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to set a different quantity on an event
parent
b24039c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
product/ERP5/Document/Event.py
product/ERP5/Document/Event.py
+3
-5
product/ERP5/tests/testCRM.py
product/ERP5/tests/testCRM.py
+11
-0
No files found.
product/ERP5/Document/Event.py
View file @
243a4bed
...
@@ -135,12 +135,10 @@ class Event(EmailDocument, Movement, AcknowledgeableMixin):
...
@@ -135,12 +135,10 @@ class Event(EmailDocument, Movement, AcknowledgeableMixin):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getQuantity'
)
'getQuantity'
)
def
getQuantity
(
self
):
def
getQuantity
(
self
,
default
=
1.
):
"""Quantity is by default 1.0 on events.
"""
"""
Quantity is set automatically on Events.
return
self
.
_baseGetQuantity
(
default
)
"""
# Provide opportunity to script this
return
1.
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getExplanationValue'
)
'getExplanationValue'
)
...
...
product/ERP5/tests/testCRM.py
View file @
243a4bed
...
@@ -87,6 +87,17 @@ class TestCRM(BaseTestCRM):
...
@@ -87,6 +87,17 @@ class TestCRM(BaseTestCRM):
'erp5_ingestion'
,
'erp5_ingestion'
,
'erp5_crm'
,)
'erp5_crm'
,)
def
test_Event_getQuantity
(
self
):
event_module
=
self
.
portal
.
event_module
for
portal_type
in
self
.
portal
.
getPortalEventTypeList
():
event
=
event_module
.
newContent
(
portal_type
=
portal_type
)
# quantity on events is 1 by default
self
.
assertEquals
(
1
,
event
.
getQuantity
())
# but it can be overriden
event
.
setQuantity
(
321
)
self
.
assertEquals
(
321
,
event
.
getQuantity
())
def
test_Event_CreateRelatedEvent
(
self
):
def
test_Event_CreateRelatedEvent
(
self
):
# test workflow to create a related event from responded event
# test workflow to create a related event from responded event
event_module
=
self
.
portal
.
event_module
event_module
=
self
.
portal
.
event_module
...
...
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