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
Titouan Soulard
erp5
Commits
bbb51ff1
Commit
bbb51ff1
authored
Jan 21, 2025
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: cleanup, remove useless methods
parent
8a2bf6ac
Pipeline
#39170
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
33 deletions
+4
-33
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.InventoryLine.py
...lateItem/portal_components/document.erp5.InventoryLine.py
+4
-33
No files found.
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.InventoryLine.py
View file @
bbb51ff1
...
...
@@ -32,7 +32,6 @@ from Acquisition import aq_base
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.XMLMatrix
import
XMLMatrix
from
erp5.component.document.Movement
import
Movement
from
erp5.component.document.Amount
import
Amount
class
InventoryLine
(
XMLMatrix
,
Amount
):
...
...
@@ -60,15 +59,6 @@ class InventoryLine(XMLMatrix, Amount):
,
PropertySheet
.
ItemAggregation
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'hasCellContent'
)
def
hasCellContent
(
self
,
base_id
=
"movement"
):
"""
Returns True is the line contains cells.
"""
cell_range
=
XMLMatrix
.
getCellRange
(
self
,
base_id
=
base_id
)
return
(
cell_range
is
not
None
and
len
(
cell_range
)
>
0
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getQuantity'
)
def
getQuantity
(
self
):
...
...
@@ -97,7 +87,7 @@ class InventoryLine(XMLMatrix, Amount):
return
self
.
getInventory
()
else
:
total_quantity
=
0.0
for
cell
in
self
.
getCellValueList
(
base_id
=
'
movement
'
):
for
cell
in
self
.
getCellValueList
(
base_id
=
'
cell
'
):
if
cell
.
getInventory
()
is
not
None
:
total_quantity
+=
cell
.
getInventory
()
return
total_quantity
...
...
@@ -111,26 +101,7 @@ class InventoryLine(XMLMatrix, Amount):
return
self
.
getPrice
()
else
:
total_price
=
0.0
for
cell
in
self
.
getCellValueList
(
base_id
=
'
movement
'
):
if
cell
.
getPrice
()
is
not
None
:
total_price
+=
cell
.
getPrice
()
for
cell
in
self
.
getCellValueList
(
base_id
=
'
cell
'
):
if
cell
.
getPrice
()
is
not
None
and
cell
.
getInventory
()
is
not
None
:
total_price
+=
cell
.
getPrice
()
*
cell
.
getInventory
()
return
total_price
# Inventory cataloging
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getConvertedInventory'
)
def
getConvertedInventory
(
self
):
"""
provides a default inventory value - None since
no inventory was defined.
"""
return
self
.
getInventory
()
# XXX quantity unit is missing
# Required for indexing
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getInventoriatedQuantity'
)
def
getInventoriatedQuantity
(
self
):
"""
Take into account efficiency in converted target quantity
"""
return
Movement
.
getInventoriatedQuantity
(
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