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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Papa Tamsir Kane
erp5
Commits
3fe08558
Commit
3fe08558
authored
May 16, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_dummy_movement: cleanup
parent
487dc812
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
28 deletions
+10
-28
bt5/erp5_dummy_movement/DocumentTemplateItem/DummyMovement.py
...erp5_dummy_movement/DocumentTemplateItem/DummyMovement.py
+9
-27
bt5/erp5_dummy_movement/bt/revision
bt5/erp5_dummy_movement/bt/revision
+1
-1
No files found.
bt5/erp5_dummy_movement/DocumentTemplateItem/DummyMovement.py
View file @
3fe08558
...
...
@@ -27,11 +27,12 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5.Document.Movement
import
Movement
class
DummyMovement
(
Movement
):
"""Dummy Movement for testing purposes."""
meta_type
=
'ERP5 Dummy Movement'
...
...
@@ -57,33 +58,15 @@ class DummyMovement(Movement):
"""Our dummy movement are always accountable."""
return
getattr
(
self
,
'is_accountable'
,
1
)
def
_getPropertyDirectlyOrFromDummyDelivery
(
self
,
property
,
default
=
None
):
"""Returns property from delivery, in case if in Dummy Delivery, or movement"""
if
self
.
getParentValue
().
getPortalType
()
==
'Dummy Delivery'
:
return
self
.
getParentValue
().
getSimulationState
()
return
getattr
(
self
,
property
,
default
)
# In order to make tests work with dummy movements that are not contained in
# dummy deliveries, we must borrow a few methods from DummyDelivery.
def
getSimulationState
(
self
):
return
self
.
_getPropertyDirectlyOrFromDummyDelivery
(
'simulation_state'
,
'draft'
)
def
setSimulationState
(
self
,
state
):
"""Directly sets a simulation state if not in Dummy Delivery."""
if
self
.
getParentValue
().
getPortalType
()
!=
'Dummy Delivery'
:
self
.
simulation_state
=
state
else
:
raise
ValueError
def
getCausalityState
(
self
):
return
self
.
_getPropertyDirectlyOrFromDummyDelivery
(
'causality_state'
,
'draft'
)
def
setCausalityState
(
self
,
state
):
"""Directly sets a causality state."""
if
self
.
getParentValue
().
getPortalType
()
!=
'Dummy Delivery'
:
self
.
simulation_state
=
state
else
:
raise
ValueError
from
erp5.document.DummyDelivery
import
DummyDelivery
parent
=
self
.
getParentValue
()
if
isinstance
(
parent
,
DummyDelivery
):
self
=
parent
return
DummyDelivery
.
getSimulationState
.
im_func
(
self
)
def
getDeliveryValue
(
self
):
"""
...
...
@@ -103,6 +86,5 @@ class DummyMovement(Movement):
# return self, to have minimum support of getDeliveryValue
return
self
def
hasCellContent
(
self
):
return
False
bt5/erp5_dummy_movement/bt/revision
View file @
3fe08558
20
\ No newline at end of file
21
\ 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