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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
8d66c734
Commit
8d66c734
authored
Nov 09, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: search trade condition matching source/destination project
parent
5ea3a776
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_applySaleTradeCondition.py
...tal_skins/erp5_trade/SaleOrder_applySaleTradeCondition.py
+10
-2
No files found.
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_applySaleTradeCondition.py
View file @
8d66c734
...
@@ -9,8 +9,8 @@ trade_condition_list = order.getSpecialiseValueList(
...
@@ -9,8 +9,8 @@ trade_condition_list = order.getSpecialiseValueList(
portal_type
=
trade_condition_portal_type
)
portal_type
=
trade_condition_portal_type
)
tested_base_category_list
=
[
]
tested_base_category_list
=
[
]
for
base_category
in
(
'source_section'
,
'source'
,
for
base_category
in
(
'source_section'
,
'source'
,
'source_project'
,
'destination_section'
,
'destination'
,
):
'destination_section'
,
'destination'
,
'destination_project'
):
if
context
.
getProperty
(
base_category
):
if
context
.
getProperty
(
base_category
):
tested_base_category_list
.
append
(
base_category
)
tested_base_category_list
.
append
(
base_category
)
...
@@ -24,6 +24,12 @@ else:
...
@@ -24,6 +24,12 @@ else:
def
rank_method
(
trade_condition
):
def
rank_method
(
trade_condition
):
rank
=
0
rank
=
0
destination_project
=
trade_condition
.
getDestinationProject
()
if
destination_project
:
if
destination_project
==
context
.
getDestinationProject
():
rank
+=
10
else
:
rank
-=
2
destination_section
=
trade_condition
.
getDestinationSection
()
destination_section
=
trade_condition
.
getDestinationSection
()
if
destination_section
:
if
destination_section
:
if
destination_section
==
context
.
getDestinationSection
():
if
destination_section
==
context
.
getDestinationSection
():
...
@@ -36,6 +42,8 @@ def rank_method(trade_condition):
...
@@ -36,6 +42,8 @@ def rank_method(trade_condition):
rank
+=
10
rank
+=
10
else
:
else
:
rank
-=
2
rank
-=
2
if
trade_condition
.
getSourceProject
():
rank
+=
1
if
trade_condition
.
getSourceSection
():
if
trade_condition
.
getSourceSection
():
rank
+=
1
rank
+=
1
if
trade_condition
.
getSource
():
if
trade_condition
.
getSource
():
...
...
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