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
Leo Le Bouter
erp5
Commits
6af84365
Commit
6af84365
authored
Feb 13, 2018
by
Xiaowu Zhang
Committed by
Ayush Tiwari
Mar 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: add method to get url parameter
parent
ac01cf72
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
50 deletions
+52
-50
product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.py
...teItem/portal_components/extension.erp5.InventoryBrain.py
+52
-50
No files found.
product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.py
View file @
6af84365
...
...
@@ -173,38 +173,16 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
return
resource
.
reference
resource_reference
=
ComputedAttribute
(
getResourceReference
,
1
)
def
getListItemUrl
(
self
,
cname_id
,
selection_index
,
selection_name
):
"""Returns the URL for column `cname_id`. Used by ListBox
"""
resource
=
self
.
getResourceValue
()
if
cname_id
in
(
'getExplanationText'
,
'getExplanation'
,
):
o
=
self
.
getObject
()
if
o
is
not
None
:
if
not
getattr
(
o
,
'isDelivery'
,
0
):
explanation
=
o
.
getExplanationValue
()
else
:
# Additional inventory movements are catalogged in stock table
# with the inventory's uid. Then they are their own explanation.
explanation
=
o
if
explanation
is
not
None
:
return
explanation
.
absolute_url
()
return
''
elif
resource
is
not
None
:
# A resource is defined, so try to display the movement list
form_id
=
'Resource_viewMovementHistory'
def
getListItemParamDict
(
self
,
cname_id
,
selection_index
,
selection_name
):
query_kw
=
{
'variation_text'
:
self
.
variation_text
,
'selection_name'
:
selection_name
,
'selection_index'
:
selection_index
,
'domain_name'
:
selection_name
,
"node_uid"
:
self
.
node_uid
'node_uid'
:
self
.
node_uid
}
# Add parameters to query_kw
query_kw_update
=
{}
if
cname_id
in
(
'transformed_resource_title'
,
):
return
resource
.
absolute_url
()
elif
cname_id
in
(
'getCurrentInventory'
,
):
if
cname_id
in
(
'getCurrentInventory'
,
):
query_kw_update
=
{
'simulation_state'
:
list
(
self
.
getPortalCurrentInventoryStateList
()
+
\
...
...
@@ -242,6 +220,30 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
list
(
self
.
getPortalReservedInventoryStateList
())
}
query_kw
.
update
(
query_kw_update
)
return
query_kw
def
getListItemUrl
(
self
,
cname_id
,
selection_index
,
selection_name
):
"""Returns the URL for column `cname_id`. Used by ListBox
"""
resource
=
self
.
getResourceValue
()
if
cname_id
in
(
'getExplanationText'
,
'getExplanation'
,
):
o
=
self
.
getObject
()
if
o
is
not
None
:
if
not
getattr
(
o
,
'isDelivery'
,
0
):
explanation
=
o
.
getExplanationValue
()
else
:
# Additional inventory movements are catalogged in stock table
# with the inventory's uid. Then they are their own explanation.
explanation
=
o
if
explanation
is
not
None
:
return
explanation
.
absolute_url
()
return
''
elif
resource
is
not
None
:
if
cname_id
in
(
'transformed_resource_title'
,
):
return
resource
.
absolute_url
()
# A resource is defined, so try to display the movement list
form_id
=
'Resource_viewMovementHistory'
query_kw
=
self
.
getListItemParamDict
(
cname_id
,
selection_index
,
selection_name
)
return
'%s/%s?%s&reset=1'
%
(
resource
.
absolute_url
(),
form_id
,
make_query
(
**
query_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