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
3c74ed07
Commit
3c74ed07
authored
Mar 23, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disallow any compensation.
parent
51c8a250
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
product/ERP5/mixin/rule.py
product/ERP5/mixin/rule.py
+11
-4
No files found.
product/ERP5/mixin/rule.py
View file @
3c74ed07
...
...
@@ -33,6 +33,7 @@ from Products.CMFCore.utils import getToolByName
from
Products.ERP5Type
import
Permissions
,
interfaces
from
Products.ERP5Type.Core.Predicate
import
Predicate
from
Products.ERP5.MovementCollectionDiff
import
_getPropertyAndCategoryList
from
pprint
import
pformat
from
zLOG
import
LOG
...
...
@@ -366,11 +367,9 @@ class RuleMixin(Predicate):
movement_collection_diff
.
addDeletableMovement
(
decision_movement
)
else
:
# Compensate non deletable
from
pprint
import
pformat
raise
NotImplementedError
(
'Compensation undesired: decision_movement_list = %s
\
n
%s'
%
(
decision_movement_list
,
pformat
([
q
.
__dict__
for
q
in
decision_movement_list
])))
'Compensation undesired: decision_movement = %s'
%
(
pformat
(
decision_movement
.
__dict__
),
))
new_movement
=
decision_movement
.
asContext
(
quantity
=-
decision_movement
.
getQuantity
())
new_movement
.
setDelivery
(
None
)
...
...
@@ -416,6 +415,10 @@ class RuleMixin(Predicate):
not_completed_movement
=
decision_movement
# Frozen must be compensated
if
not
_compare
(
profit_tester_list
,
prevision_movement
,
decision_movement
):
raise
NotImplementedError
(
'Compensation undesired: prevision_movement = %s decision_movement = %s'
%
(
pformat
(
prevision_movement
.
__dict__
),
pformat
(
decision_movement
.
__dict__
)
))
new_movement
=
decision_movement
.
asContext
(
quantity
=-
decision_movement_quantity
)
new_movement
.
setDelivery
(
None
)
...
...
@@ -434,6 +437,10 @@ class RuleMixin(Predicate):
if
decision_movement
.
isFrozen
():
# Frozen must be compensated
if
not
_compare
(
divergence_tester_list
,
prevision_movement
,
decision_movement
):
raise
NotImplementedError
(
'Compensation undesired: prevision_movement = %s decision_movement = %s'
%
(
pformat
(
prevision_movement
.
__dict__
),
pformat
(
decision_movement
.
__dict__
)
))
new_movement
=
decision_movement
.
asContext
(
quantity
=-
decision_movement_quantity
)
new_movement
.
setDelivery
(
None
)
...
...
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