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
Xavier Thompson
erp5
Commits
0d1ee91a
Commit
0d1ee91a
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_pdm]: Migrate Resource_viewMovementHistory listbox's URL columns
parent
f68c139d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
149 additions
and
23 deletions
+149
-23
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewMovementHistory/listbox.xml
...l_skins/erp5_pdm/Resource_viewMovementHistory/listbox.xml
+121
-4
product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.py
...teItem/portal_components/extension.erp5.InventoryBrain.py
+10
-5
product/ERP5Form/ListBox.py
product/ERP5Form/ListBox.py
+18
-14
No files found.
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewMovementHistory/listbox.xml
View file @
0d1ee91a
This diff is collapsed.
Click to expand it.
product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.py
View file @
0d1ee91a
...
@@ -343,15 +343,20 @@ class MovementHistoryListBrain(InventoryListBrain):
...
@@ -343,15 +343,20 @@ class MovementHistoryListBrain(InventoryListBrain):
return
self
.
_convertDateToZone
(
self
.
date_utc
)
return
self
.
_convertDateToZone
(
self
.
date_utc
)
date
=
ComputedAttribute
(
_date
,
1
)
date
=
ComputedAttribute
(
_date
,
1
)
def
getListItem
(
self
,
cname_id
,
selection_index
,
selection_name
):
document
=
self
.
getObject
()
if
document
.
isMovement
():
return
document
.
getExplanationValue
()
def
getListItemParamDict
(
self
,
cname_id
,
selection_index
,
selection_name
):
return
{}
def
getListItemUrl
(
self
,
cname_id
,
selection_index
,
selection_name
):
def
getListItemUrl
(
self
,
cname_id
,
selection_index
,
selection_name
):
"""Returns the URL for column `cname_id`. Used by ListBox
"""Returns the URL for column `cname_id`. Used by ListBox
Here we just want a link to the explanation of movement.
Here we just want a link to the explanation of movement.
"""
"""
document
=
self
.
getObject
()
item
=
self
.
getListItem
(
cname_id
,
selection_index
,
selection_name
)
if
document
.
isMovement
():
if
item
is
not
None
:
explanation
=
document
.
getExplanationValue
()
return
item
.
absolute_url
()
if
explanation
is
not
None
:
return
explanation
.
absolute_url
()
return
''
return
''
def
_debit
(
self
):
def
_debit
(
self
):
...
...
product/ERP5Form/ListBox.py
View file @
0d1ee91a
...
@@ -2344,20 +2344,24 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
...
@@ -2344,20 +2344,24 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
result_dict
[
key
]
=
value
(
selection
=
selection
,
selection_name
=
selection
.
getName
(),
column_id
=
sql
,
index
=
self
.
index
)
result_dict
[
key
]
=
value
(
selection
=
selection
,
selection_name
=
selection
.
getName
(),
column_id
=
sql
,
index
=
self
.
index
)
except
TypeError
:
except
TypeError
:
result_dict
[
key
]
=
value
()
result_dict
[
key
]
=
value
()
if
result_dict
:
if
'jio_key'
not
in
result_dict
:
if
'jio_key'
not
in
result_dict
:
url
=
''
url
=
''
else
:
if
getattr
(
brain
,
'getListItem'
,
None
)
is
not
None
:
try
:
item
=
brain
.
getListItem
(
alias
,
self
.
index
,
selection_name
)
url
=
self
.
getObject
().
getPortalObject
().
restrictedTraverse
(
result_dict
[
'jio_key'
]).
absolute_url
()
if
item
is
not
None
:
except
KeyError
:
url
=
item
.
absolute_url
()
url
=
result_dict
[
'jio_key'
]
else
:
try
:
if
'view_action'
in
result_dict
:
url
=
self
.
getObject
().
getPortalObject
().
restrictedTraverse
(
result_dict
[
'jio_key'
]).
absolute_url
()
url
+=
result_dict
[
'view_action'
]
except
KeyError
:
if
'parameter'
not
in
result_dict
and
getattr
(
brain
,
'getListItemParamDict'
,
None
)
is
not
None
:
url
=
result_dict
[
'jio_key'
]
result_dict
[
'parameter'
]
=
brain
.
getListItemParamDict
(
alias
,
self
.
index
,
selection_name
)
if
'parameter'
in
result_dict
:
if
'view_action'
in
result_dict
:
url
+=
result_dict
[
'view_action'
]
if
'parameter'
not
in
result_dict
and
getattr
(
brain
,
'getListItemParamDict'
,
None
)
is
not
None
:
result_dict
[
'parameter'
]
=
brain
.
getListItemParamDict
(
alias
,
self
.
index
,
selection_name
)
if
'parameter'
in
result_dict
:
url
=
'%s?%s'
%
(
url
,
make_query
(
result_dict
[
'parameter'
]))
url
=
'%s?%s'
%
(
url
,
make_query
(
result_dict
[
'parameter'
]))
# Find an URL method.
# Find an URL method.
...
...
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