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
Titouan Soulard
erp5
Commits
31000be6
Commit
31000be6
authored
Dec 30, 2024
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: launch offset computing as activity and add action
parent
1b6d7c9f
Pipeline
#38783
failed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
182 additions
and
3 deletions
+182
-3
bt5/erp5_trade/ActionTemplateItem/portal_types/Inventory/compute_offset.xml
...ionTemplateItem/portal_types/Inventory/compute_offset.xml
+96
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_computeOffsetAction.py
.../portal_skins/erp5_trade/Inventory_computeOffsetAction.py
+22
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_computeOffsetAction.xml
...portal_skins/erp5_trade/Inventory_computeOffsetAction.xml
+62
-0
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventoryModule.py
...teItem/portal_components/test.erp5.testInventoryModule.py
+1
-3
bt5/erp5_trade/bt/template_action_path_list
bt5/erp5_trade/bt/template_action_path_list
+1
-0
No files found.
bt5/erp5_trade/ActionTemplateItem/portal_types/Inventory/compute_offset.xml
0 → 100644
View file @
31000be6
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_jio_action
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jio_action
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
compute_offset
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
Add portal content
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
10.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Calculate Inventory Offset
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Inventory_computeOffsetAction
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python: context.getSimulationState() in (\'draft\', \'planned\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_computeOffsetAction.py
0 → 100644
View file @
31000be6
"""
Calls `Inventory_computeOffset` as an activity and execute the right
transitions before and after calling the script.
"""
tag
=
script
.
id
+
"offset_computing"
+
context
.
getPath
()
# Use intermediate workflow state to avoid changes while calculation
# is in process.
context
.
calculate
()
context
.
activate
(
tag
=
tag
,
# Lower priority over many processes
priority
=
3
,
).
Inventory_computeOffset
()
# Switch to calculated state (and allow user to cancel or record)
# when calculation is finished.
context
.
activate
(
after_tag
=
tag
,
).
plan
()
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_computeOffsetAction.xml
0 → 100644
View file @
31000be6
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
Inventory_computeOffsetAction
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventoryModule.py
View file @
31000be6
...
...
@@ -109,9 +109,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
price
=
price
,
)
# XXX: there should be an action for this
inventory_value
.
Inventory_computeOffset
()
inventory_value
.
plan
()
inventory_value
.
Inventory_computeOffsetAction
()
self
.
tic
()
return
inventory_value
...
...
bt5/erp5_trade/bt/template_action_path_list
View file @
31000be6
...
...
@@ -63,6 +63,7 @@ Inventory Report Line | view
Inventory Report Module | view
Inventory Report | calculate_product_stock
Inventory Report | view
Inventory | compute_offset
Inventory | fast_input
Inventory | fast_input_update
Inventory | view
...
...
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