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
e6660089
Commit
e6660089
authored
Feb 20, 2025
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: add `getTotalQuantity` method to offset
parent
203310cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.InventoryOffsetLine.py
...em/portal_components/document.erp5.InventoryOffsetLine.py
+28
-0
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.InventoryOffsetLine.xml
...m/portal_components/document.erp5.InventoryOffsetLine.xml
+4
-1
No files found.
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.InventoryOffsetLine.py
View file @
e6660089
...
...
@@ -55,3 +55,31 @@ class InventoryOffsetLine(DeliveryLine):
,
PropertySheet
.
VariationRange
,
PropertySheet
.
ItemAggregation
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTotalQuantity'
)
def
getTotalQuantity
(
self
):
"""
Returns the quantity if no cell or the total quantity if cells
"""
if
not
self
.
hasCellContent
():
return
self
.
getQuantity
()
else
:
total_quantity
=
0.0
for
cell
in
self
.
getCellValueList
(
base_id
=
'movement'
):
if
cell
.
getQuantity
()
is
not
None
:
total_quantity
+=
cell
.
getQuantity
()
return
total_quantity
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTotalPrice'
)
def
getTotalPrice
(
self
):
"""
Returns the price if no cell or the total price if cells
"""
if
not
self
.
hasCellContent
():
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
()
return
total_price
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.InventoryOffsetLine.xml
View file @
e6660089
...
...
@@ -35,7 +35,10 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
<tuple>
<string>
W: 60, 2: Arguments number differs from overridden \'getTotalQuantity\' method (arguments-differ)
</string>
<string>
W: 74, 2: Arguments number differs from overridden \'getTotalPrice\' method (arguments-differ)
</string>
</tuple>
</value>
</item>
<item>
...
...
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