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
Amer
erp5
Commits
1ca645f1
Commit
1ca645f1
authored
Dec 17, 2018
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: no need to execute one by one
parent
d38fe30a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
10 deletions
+75
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InventoryReportLine_updateTotalAssetPrice.py
...s/erp5_trade/InventoryReportLine_updateTotalAssetPrice.py
+0
-4
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InventoryReport_recordProductStock.py
...al_skins/erp5_trade/InventoryReport_recordProductStock.py
+7
-6
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InventoryReport_updateTotalAssetPrice.py
...skins/erp5_trade/InventoryReport_updateTotalAssetPrice.py
+6
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InventoryReport_updateTotalAssetPrice.xml
...kins/erp5_trade/InventoryReport_updateTotalAssetPrice.xml
+62
-0
No files found.
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InventoryReportLine_updateTotalAssetPrice.py
View file @
1ca645f1
line_total_asset_price
=
context
.
getPortalObject
().
portal_simulation
.
getCurrentInventoryAssetPrice
(
**
kw
)
or
0
context
.
edit
(
total_asset_price
=
context
.
getPortalObject
().
portal_simulation
.
getCurrentInventoryAssetPrice
(
**
kw
)
or
0
)
inventory_report
=
context
.
getParent
()
inventory_report
.
edit
(
total_asset_price
=
inventory_report
.
getTotalAssetPrice
()
+
line_total_asset_price
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InventoryReport_recordProductStock.py
View file @
1ca645f1
...
...
@@ -4,6 +4,7 @@ newContent = context.newContent
section_uid
=
context
.
getDestinationSectionUid
()
node_uid
=
context
.
getDestinationUid
()
valuation_method
=
context
.
getValuationMethod
()
relative_url
=
context
.
getRelativeUrl
()
at_date
=
context
.
getAtDate
()
inventory_list
=
getCurrentInventoryList
(
...
...
@@ -14,8 +15,9 @@ inventory_list = getCurrentInventoryList(
resourceType
=
portal
.
getPortalProductTypeList
(),
at_date
=
at_date
)
after_tag
=
None
line_tag
=
'%s:lineUpdateTotalAssetPrice'
%
relative_url
#only after all calculation are finished then change report state
for
inventory
in
inventory_list
:
inventory_report_line
=
newContent
(
portal_type
=
'Inventory Report Line'
)
inventory_report_line
.
edit
(
...
...
@@ -24,10 +26,8 @@ for inventory in inventory_list:
total_quantity
=
inventory
.
total_quantity
,
total_asset_price
=
0
)
tag
=
'%s-%s'
%
(
inventory_report_line
.
getUid
(),
'InventoryReportLine_updateTotalAssetPrice'
)
inventory_report_line
.
activate
(
after_tag
=
after_tag
,
tag
=
tag
tag
=
line_tag
).
InventoryReportLine_updateTotalAssetPrice
(
section_uid
=
section_uid
,
node_uid
=
node_uid
,
...
...
@@ -37,6 +37,7 @@ for inventory in inventory_list:
at_date
=
at_date
,
is_accountable
=
1
)
after_tag
=
tag
context
.
activate
(
after_tag
=
after_tag
).
record
()
tag
=
'%s:updateTotalAssetPrice'
%
relative_url
context
.
activate
(
after_tag
=
line_tag
,
tag
=
tag
).
InventoryReport_updateTotalAssetPrice
()
context
.
activate
(
after_tag
=
tag
).
record
()
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InventoryReport_updateTotalAssetPrice.py
0 → 100644
View file @
1ca645f1
total_asset_price
=
0
for
inventory_report_line
in
context
.
contentValues
(
portal_type
=
'Inventory Report Line'
):
total_asset_price
+=
inventory_report_line
.
total_asset_price
context
.
edit
(
total_asset_price
=
total_asset_price
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InventoryReport_updateTotalAssetPrice.xml
0 → 100644
View file @
1ca645f1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
InventoryReport_updateTotalAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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