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
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
Boxiang Sun
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):
...
@@ -158,14 +158,11 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
# with the inventory's uid. Then they are their own explanation.
# with the inventory's uid. Then they are their own explanation.
explanation
=
o
explanation
=
o
if
explanation
is
not
None
:
if
explanation
is
not
None
:
return
'%s/%s'
%
(
return
explanation
.
absolute_url
()
self
.
portal_url
.
getPortalObject
().
absolute_url
(),
return
''
explanation
.
getRelativeUrl
())
else
:
return
''
elif
resource
is
not
None
:
elif
resource
is
not
None
:
# A resource is defined, so try to display the movement list
# A resource is defined, so try to display the movement list
form_
name
=
'Resource_viewMovementHistory'
form_
id
=
'Resource_viewMovementHistory'
query_kw
=
{
query_kw
=
{
'variation_text'
:
self
.
variation_text
,
'variation_text'
:
self
.
variation_text
,
'selection_name'
:
selection_name
,
'selection_name'
:
selection_name
,
...
@@ -216,7 +213,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
...
@@ -216,7 +213,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
}
}
query_kw
.
update
(
query_kw_update
)
query_kw
.
update
(
query_kw_update
)
return
'%s/%s?%s&reset=1'
%
(
resource
.
absolute_url
(),
return
'%s/%s?%s&reset=1'
%
(
resource
.
absolute_url
(),
form_
name
,
form_
id
,
make_query
(
**
query_kw
)
)
make_query
(
**
query_kw
)
)
# default case, if it's a movement, return link to the explanation of this
# default case, if it's a movement, return link to the explanation of this
...
@@ -225,9 +222,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
...
@@ -225,9 +222,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
if
document
.
isMovement
():
if
document
.
isMovement
():
explanation
=
document
.
getExplanationValue
()
explanation
=
document
.
getExplanationValue
()
if
explanation
is
not
None
:
if
explanation
is
not
None
:
return
'%s/%s'
%
(
return
explanation
.
absolute_url
()
self
.
portal_url
.
getPortalObject
().
absolute_url
(),
explanation
.
getRelativeUrl
())
return
''
return
''
def
getExplanationText
(
self
):
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