Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
c4ba8b9a
Commit
c4ba8b9a
authored
Nov 10, 2022
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: order Supply Predicate matching
parent
4b65e8d7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Movement_getPriceCalculationOperandDict.py
...pos_accounting/Movement_getPriceCalculationOperandDict.py
+5
-10
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Movement_getPriceCalculationOperandDict.py
View file @
c4ba8b9a
...
@@ -6,11 +6,13 @@ def sort_key_method(e):
...
@@ -6,11 +6,13 @@ def sort_key_method(e):
having source_function only
having source_function only
others
others
"""
"""
return
0
parent
=
e
.
getParentValue
()
parent
=
e
.
getParentValue
()
if
parent
.
getPortalType
().
endswith
(
'Line'
):
if
parent
.
getPortalType
().
endswith
(
'Line'
):
parent
=
parent
.
getParentValue
()
parent
=
parent
.
getParentValue
()
return
0
-
1
*
int
(
parent
.
hasSourceFunction
())
-
2
*
int
(
parent
.
hasGroup
())
minus
=
0
else
:
minus
=
-
0.5
return
0
-
1
*
int
(
parent
.
hasDestination
())
+
minus
def
filter_method
(
currency
,
destination_project
,
group
):
def
filter_method
(
currency
,
destination_project
,
group
):
def
filter_by_source_function_and_group
(
l
):
def
filter_by_source_function_and_group
(
l
):
...
@@ -38,6 +40,7 @@ def filter_method(currency, destination_project, group):
...
@@ -38,6 +40,7 @@ def filter_method(currency, destination_project, group):
#if parent.getGroup() not in (None, group):
#if parent.getGroup() not in (None, group):
# continue
# continue
ret
.
append
(
i
)
ret
.
append
(
i
)
return
ret
return
ret
return
filter_by_source_function_and_group
return
filter_by_source_function_and_group
source
=
context
.
getSourceValue
()
source
=
context
.
getSourceValue
()
...
@@ -47,13 +50,6 @@ else:
...
@@ -47,13 +50,6 @@ else:
group
=
source
.
getGroup
()
group
=
source
.
getGroup
()
kw
[
'filter_method'
]
=
filter_method
(
context
.
getPriceCurrency
(),
context
.
getDestinationProject
(),
group
)
kw
[
'filter_method'
]
=
filter_method
(
context
.
getPriceCurrency
(),
context
.
getDestinationProject
(),
group
)
"""
def filter_couscous(predicate_list):
raise NotImplementedError(predicate_list)
return predicate_list
kw['filter_method'] = filter_couscous
"""
kw
[
'sort_key_method'
]
=
sort_key_method
kw
[
'sort_key_method'
]
=
sort_key_method
resource
=
context
.
getResourceValue
()
resource
=
context
.
getResourceValue
()
...
@@ -63,7 +59,6 @@ if resource is not None:
...
@@ -63,7 +59,6 @@ if resource is not None:
if
product_line
:
if
product_line
:
kw
[
'categories'
]
=
kw
.
get
(
'categories'
,
[])
+
[
'product_line/%s'
%
product_line
]
kw
[
'categories'
]
=
kw
.
get
(
'categories'
,
[])
+
[
'product_line/%s'
%
product_line
]
#raise NotImplementedError(str(kw))
return
resource
.
getPriceCalculationOperandDict
(
return
resource
.
getPriceCalculationOperandDict
(
default
=
default
,
context
=
context
,
**
kw
)
default
=
default
,
context
=
context
,
**
kw
)
...
...
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