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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
768d0d18
Commit
768d0d18
authored
Oct 20, 2022
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: add scirpt to remove old movement after upgrade
parent
1a30a4b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
160 additions
and
0 deletions
+160
-0
bt5/erp5_trade/ExtensionTemplateItem/portal_components/extension.erp5.Inventory.py
...emplateItem/portal_components/extension.erp5.Inventory.py
+25
-0
bt5/erp5_trade/ExtensionTemplateItem/portal_components/extension.erp5.Inventory.xml
...mplateItem/portal_components/extension.erp5.Inventory.xml
+106
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_removeOldMovement.xml
...m/portal_skins/erp5_trade/Inventory_removeOldMovement.xml
+28
-0
bt5/erp5_trade/bt/template_extension_id_list
bt5/erp5_trade/bt/template_extension_id_list
+1
-0
No files found.
bt5/erp5_trade/ExtensionTemplateItem/portal_components/extension.erp5.Inventory.py
0 → 100644
View file @
768d0d18
def
removeOldMovement
(
self
):
portal
=
self
.
getPortalObject
()
temp_constructor
=
lambda
self
,
id
,
*
args
,
**
kw
:
self
.
newContent
(
temp_object
=
True
,
portal_type
=
'Movement'
,
id
=
id
,
*
args
,
**
kw
)
catalog_kw
=
dict
(
disable_cache
=
1
,
check_uid
=
0
)
uid_set
=
set
()
for
inventory
in
portal
.
portal_catalog
(
portal_type
=
'Inventory'
,
limit
=
None
,
simulation_state
=
'delivered'
,
sort_on
=
[(
'delivery.start_date'
,
'ascending'
),
(
'uid'
,
'ascending'
)]):
for
line
in
inventory
.
contentValues
(
portal_type
=
'Inventory Line'
):
for
cell
in
line
.
contentValues
(
portal_type
=
'Inventory Cell'
):
uid_set
.
add
(
cell
.
getUid
())
uid_set
.
add
(
line
.
getUid
())
uid_set
.
add
(
inventory
.
getUid
())
to_delete_list
=
[]
for
uid
in
uid_set
:
temp_object
=
temp_constructor
(
self
,
'temp_object'
)
temp_object
.
setUid
(
uid
)
to_delete_list
.
append
(
temp_object
)
self
.
getPortalObject
().
portal_catalog
.
catalogObjectList
(
to_delete_list
[:],
method_id_list
=
[
'z0_uncatalog_stock'
],
**
catalog_kw
)
\ No newline at end of file
bt5/erp5_trade/ExtensionTemplateItem/portal_components/extension.erp5.Inventory.xml
0 → 100644
View file @
768d0d18
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Extension Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
Inventory
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.Inventory
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Extension Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_removeOldMovement.xml
0 → 100644
View file @
768d0d18
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
removeOldMovement
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
Inventory
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Inventory_removeOldMovement
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/bt/template_extension_id_list
0 → 100644
View file @
768d0d18
extension.erp5.Inventory
\ No newline at end of file
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