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
Léo-Paul Géneau
erp5
Commits
92cbee68
Commit
92cbee68
authored
Apr 22, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simulation: specialise tester must not sort before comparing decision and prevision
The order of specialise categories is important.
parent
e5792f39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
product/ERP5/Document/CategoryMembershipEquivalenceTester.py
product/ERP5/Document/CategoryMembershipEquivalenceTester.py
+1
-6
product/ERP5/Document/SpecialiseEquivalenceTester.py
product/ERP5/Document/SpecialiseEquivalenceTester.py
+4
-0
No files found.
product/ERP5/Document/CategoryMembershipEquivalenceTester.py
View file @
92cbee68
...
...
@@ -59,7 +59,7 @@ class CategoryMembershipEquivalenceTester(Predicate, EquivalenceTesterMixin):
# What about using getCategoryMembershipList for Simulation Movements ?
return
movement
.
getAcquiredCategoryMembershipList
(
property
)
def
_compare
(
self
,
prevision_movement
,
decision_movement
):
def
_compare
(
self
,
prevision_movement
,
decision_movement
,
sorted
=
sorted
):
"""
If prevision_movement and decision_movement don't match, it returns a
list : (prevision_value, decision_value, message, mapping)
...
...
@@ -68,11 +68,6 @@ class CategoryMembershipEquivalenceTester(Predicate, EquivalenceTesterMixin):
if
getattr
(
decision_movement
,
'isPropertyRecorded'
,
lambda
x
:
False
)(
tested_property
):
decision_value
=
decision_movement
.
getRecordedProperty
(
tested_property
)
if
not
isinstance
(
decision_value
,
(
list
,
tuple
)):
if
decision_value
is
None
:
decision_value
=
[]
else
:
decision_value
=
[
decision_value
]
else
:
decision_value
=
self
.
_getTestedPropertyValue
(
decision_movement
,
tested_property
)
...
...
product/ERP5/Document/SpecialiseEquivalenceTester.py
View file @
92cbee68
...
...
@@ -43,6 +43,10 @@ class SpecialiseEquivalenceTester(CategoryMembershipEquivalenceTester):
movement_specialise_type
=
()
movement_exclude_specialise_type
=
()
def
_compare
(
self
,
prevision_movement
,
decision_movement
,
sorted
=
lambda
x
:
x
):
return
super
(
SpecialiseEquivalenceTester
,
self
).
_compare
(
prevision_movement
,
decision_movement
,
sorted
)
def
_getTestedPropertyValue
(
self
,
movement
,
property
):
if
movement
.
getPortalType
()
==
'Simulation Movement'
:
return
movement
.
getCategoryMembershipList
(
property
)
...
...
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