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
Sebastien Robin
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 @@
...
@@ -27,11 +27,12 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
##############################################################################
##############################################################################
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5.Document.Movement
import
Movement
from
Products.ERP5.Document.Movement
import
Movement
class
DummyMovement
(
Movement
):
class
DummyMovement
(
Movement
):
"""Dummy Movement for testing purposes."""
"""Dummy Movement for testing purposes."""
meta_type
=
'ERP5 Dummy Movement'
meta_type
=
'ERP5 Dummy Movement'
...
@@ -57,33 +58,15 @@ class DummyMovement(Movement):
...
@@ -57,33 +58,15 @@ class DummyMovement(Movement):
"""Our dummy movement are always accountable."""
"""Our dummy movement are always accountable."""
return
getattr
(
self
,
'is_accountable'
,
1
)
return
getattr
(
self
,
'is_accountable'
,
1
)
def
_getPropertyDirectlyOrFromDummyDelivery
(
self
,
property
,
default
=
None
):
# In order to make tests work with dummy movements that are not contained in
"""Returns property from delivery, in case if in Dummy Delivery, or movement"""
# dummy deliveries, we must borrow a few methods from DummyDelivery.
if
self
.
getParentValue
().
getPortalType
()
==
'Dummy Delivery'
:
return
self
.
getParentValue
().
getSimulationState
()
return
getattr
(
self
,
property
,
default
)
def
getSimulationState
(
self
):
def
getSimulationState
(
self
):
return
self
.
_getPropertyDirectlyOrFromDummyDelivery
(
from
erp5.document.DummyDelivery
import
DummyDelivery
'simulation_state'
,
'draft'
)
parent
=
self
.
getParentValue
()
if
isinstance
(
parent
,
DummyDelivery
):
def
setSimulationState
(
self
,
state
):
self
=
parent
"""Directly sets a simulation state if not in Dummy Delivery."""
return
DummyDelivery
.
getSimulationState
.
im_func
(
self
)
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
def
getDeliveryValue
(
self
):
def
getDeliveryValue
(
self
):
"""
"""
...
@@ -103,6 +86,5 @@ class DummyMovement(Movement):
...
@@ -103,6 +86,5 @@ class DummyMovement(Movement):
# return self, to have minimum support of getDeliveryValue
# return self, to have minimum support of getDeliveryValue
return
self
return
self
def
hasCellContent
(
self
):
def
hasCellContent
(
self
):
return
False
return
False
bt5/erp5_dummy_movement/bt/revision
View file @
3fe08558
20
21
\ No newline at end of file
\ 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