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
ee280f94
Commit
ee280f94
authored
Nov 02, 2022
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: complete test
parent
a8d1e22e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
8 deletions
+26
-8
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_calculateInventoryOffset.py
...al_skins/erp5_trade/Inventory_calculateInventoryOffset.py
+4
-0
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventoryModule.py
...teItem/portal_components/test.erp5.testInventoryModule.py
+22
-8
No files found.
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Inventory_calculateInventoryOffset.py
View file @
ee280f94
...
@@ -3,6 +3,10 @@ document = context
...
@@ -3,6 +3,10 @@ document = context
excluded_list
=
[]
excluded_list
=
[]
aggregate_dict
=
{}
aggregate_dict
=
{}
# Make sure class is correct, otherwise we'll create duplicated quantity
if
context
.
portal_types
[
document
.
getPortalType
()].
getTypeClass
()
==
'Inventory'
:
return
inventory_offset_line_list
=
document
.
contentValues
(
portal_type
=
'Inventory Offset Line'
)
inventory_offset_line_list
=
document
.
contentValues
(
portal_type
=
'Inventory Offset Line'
)
if
inventory_offset_line_list
:
if
inventory_offset_line_list
:
document
.
manage_delObjects
(
ids
=
[
x
.
getId
()
for
x
in
inventory_offset_line_list
])
document
.
manage_delObjects
(
ids
=
[
x
.
getId
()
for
x
in
inventory_offset_line_list
])
...
...
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventoryModule.py
View file @
ee280f94
...
@@ -768,29 +768,43 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
...
@@ -768,29 +768,43 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
test_08_upgradeInventoryProcess
(
self
):
def
stepSetInventoryToIndexVersion
(
self
,
sequence
=
None
):
"""
portal
=
self
.
getPortal
()
portal
=
self
.
getPortal
()
inventory
=
portal
.
portal_types
.
Inventory
inventory
=
portal
.
portal_types
.
Inventory
inventory
.
setTypeClass
(
'Inventory'
)
inventory
.
setTypeClass
(
'Inventory'
)
self
.
commit
()
self
.
commit
()
"""
def
stepSetInventoryToNoindexVersion
(
self
,
sequence
=
None
):
portal
=
self
.
getPortal
()
inventory
=
portal
.
portal_types
.
Inventory
inventory
.
setTypeClass
(
'NoIndexStockInventory'
)
self
.
commit
()
@
UnrestrictedMethod
def
stepUpgradeInventory
(
self
,
sequence
=
None
):
portal
=
self
.
getPortal
()
portal
.
inventory_module
.
Inventory_removeOldMovement
()
self
.
tic
()
inventory
=
sequence
.
get
(
'inventory_list'
)[
-
1
]
inventory
.
Inventory_calculateInventoryOffset
()
self
.
tic
()
def
test_08_upgradeInventoryProcess
(
self
):
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
# Test with a simple inventory without cell
# Test with a simple inventory without cell
sequence_string
=
'stepCreateNotVariatedResource
\
sequence_string
=
'stepCreateNotVariatedResource
\
stepCreateOrganisation1
\
stepCreateOrganisation1
\
stepCreateInitialMovements
\
stepCreateInitialMovements
\
stepSetInventoryToIndexVersion
\
stepTic
\
stepTic
\
stepCreateFirstNotVariatedInventory
\
stepCreateFirstNotVariatedInventory
\
stepTic
\
stepTic
\
stepCheckFirstNotVariatedInventory
\
stepCheckFirstNotVariatedInventory
\
step
CreateSecondNotVariatedInventory
\
step
SetInventoryToNoindexVersion
\
stepTic
\
stepTic
\
stepCheckSecondNotVariatedInventory
\
stepUpgradeInventory
\
stepModifySecondNotVariatedInventory
\
stepCheckFirstNotVariatedInventory'
stepTic
\
stepCheckSecondNotVariatedInventoryModified'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
...
...
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