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
96606fea
Commit
96606fea
authored
Jan 23, 2025
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: delete old offset lines when recalculating
parent
869f8cf2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
3 deletions
+80
-3
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_computeOffsetAction.py
.../portal_skins/erp5_trade/Inventory_computeOffsetAction.py
+10
-3
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_deleteOffsetLines.py
...em/portal_skins/erp5_trade/Inventory_deleteOffsetLines.py
+8
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_deleteOffsetLines.xml
...m/portal_skins/erp5_trade/Inventory_deleteOffsetLines.xml
+62
-0
No files found.
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_computeOffsetAction.py
View file @
96606fea
...
...
@@ -3,14 +3,21 @@ Calls `Inventory_computeOffset` as an activity and execute the right
transitions before and after calling the script.
"""
tag
=
script
.
id
+
"offset_computing"
+
context
.
getPath
()
offset_deleting_tag
=
script
.
id
+
"offset_deleting"
+
context
.
getPath
()
offset_computing_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
,
tag
=
offset_deleting_tag
,
priority
=
3
,
).
Inventory_deleteOffsetLines
()
context
.
activate
(
after_tag
=
offset_deleting_tag
,
tag
=
offset_computing_tag
,
# Lower priority over many processes
priority
=
3
,
).
Inventory_computeOffset
()
...
...
@@ -18,5 +25,5 @@ context.activate(
# Switch to calculated state (and allow user to cancel or record)
# when calculation is finished.
context
.
activate
(
after_tag
=
tag
,
after_tag
=
offset_computing_
tag
,
).
plan
()
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_deleteOffsetLines.py
0 → 100644
View file @
96606fea
"""
Deletes all Inventory Offset Lines (and therefore contained cells) for an Inventory.
Meant to be used when recalculating a non-recorded Inventory.
"""
inventory_offset_line_list
=
context
.
contentValues
(
portal_type
=
'Inventory Offset Line'
)
if
inventory_offset_line_list
:
context
.
manage_delObjects
(
ids
=
[
x
.
getId
()
for
x
in
inventory_offset_line_list
])
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_deleteOffsetLines.xml
0 → 100644
View file @
96606fea
<?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_deleteOffsetLines
</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