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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
f15bc6b4
Commit
f15bc6b4
authored
Apr 11, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify code
parent
4e6d8e4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
product/ERP5/Extensions/InventoryBrain.py
product/ERP5/Extensions/InventoryBrain.py
+5
-10
No files found.
product/ERP5/Extensions/InventoryBrain.py
View file @
f15bc6b4
...
...
@@ -158,14 +158,11 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
# with the inventory's uid. Then they are their own explanation.
explanation
=
o
if
explanation
is
not
None
:
return
'%s/%s'
%
(
self
.
portal_url
.
getPortalObject
().
absolute_url
(),
explanation
.
getRelativeUrl
())
else
:
return
''
return
explanation
.
absolute_url
()
return
''
elif
resource
is
not
None
:
# A resource is defined, so try to display the movement list
form_
name
=
'Resource_viewMovementHistory'
form_
id
=
'Resource_viewMovementHistory'
query_kw
=
{
'variation_text'
:
self
.
variation_text
,
'selection_name'
:
selection_name
,
...
...
@@ -216,7 +213,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
}
query_kw
.
update
(
query_kw_update
)
return
'%s/%s?%s&reset=1'
%
(
resource
.
absolute_url
(),
form_
name
,
form_
id
,
make_query
(
**
query_kw
)
)
# default case, if it's a movement, return link to the explanation of this
...
...
@@ -225,9 +222,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
if
document
.
isMovement
():
explanation
=
document
.
getExplanationValue
()
if
explanation
is
not
None
:
return
'%s/%s'
%
(
self
.
portal_url
.
getPortalObject
().
absolute_url
(),
explanation
.
getRelativeUrl
())
return
explanation
.
absolute_url
()
return
''
def
getExplanationText
(
self
):
...
...
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