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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
518fbca5
Commit
518fbca5
authored
Jun 05, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: update test now that we don't have split_and_defer_action
Use the solve divergence action to achieve the same.
parent
f8e22924
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
36 deletions
+46
-36
product/ERP5/tests/testAdvancedInvoicing.py
product/ERP5/tests/testAdvancedInvoicing.py
+4
-0
product/ERP5/tests/testInvoice.py
product/ERP5/tests/testInvoice.py
+14
-12
product/ERP5/tests/testPackingList.py
product/ERP5/tests/testPackingList.py
+10
-11
product/ERP5/tests/testTradeModelLine.py
product/ERP5/tests/testTradeModelLine.py
+18
-13
No files found.
product/ERP5/tests/testAdvancedInvoicing.py
View file @
518fbca5
...
@@ -569,6 +569,8 @@ class TestAdvancedSaleInvoice(TestAdvancedInvoice):
...
@@ -569,6 +569,8 @@ class TestAdvancedSaleInvoice(TestAdvancedInvoice):
stepCheckInvoiceIsDiverged
stepCheckInvoiceIsDiverged
stepSplitAndDeferInvoice
stepSplitAndDeferInvoice
stepTic
stepTic
stepInvoiceBuilderAlarm
stepTic
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsSolved
stepCheckInvoiceIsSolved
...
@@ -822,6 +824,8 @@ class TestAdvancedSaleInvoice(TestAdvancedInvoice):
...
@@ -822,6 +824,8 @@ class TestAdvancedSaleInvoice(TestAdvancedInvoice):
stepTic
stepTic
stepDeliverInvoice
stepDeliverInvoice
stepTic
stepTic
stepInvoiceBuilderAlarm
stepTic
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsSolved
stepCheckInvoiceIsSolved
stepCheckInvoiceSplitted
stepCheckInvoiceSplitted
...
...
product/ERP5/tests/testInvoice.py
View file @
518fbca5
...
@@ -888,19 +888,19 @@ class TestInvoiceMixin(TestPackingListMixin):
...
@@ -888,19 +888,19 @@ class TestInvoiceMixin(TestPackingListMixin):
def
stepSplitAndDeferInvoice
(
self
,
sequence
=
None
,
sequence_list
=
None
,
def
stepSplitAndDeferInvoice
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
**
kw
):
"""
split and defer at the invoice level
"""
invoice
=
sequence
.
get
(
'invoice'
)
invoice
=
sequence
.
get
(
'invoice'
)
kw
=
{
'listbox'
:[
solver_process
=
self
.
portal
.
portal_solver_processes
.
newSolverProcess
(
invoice
)
{
'listbox_key'
:
line
.
getRelativeUrl
(),
quantity_solver_decision
,
=
[
x
for
x
in
solver_process
.
contentValues
()
'choice'
:
'SplitAndDefer'
}
for
line
in
invoice
.
getMovementList
()]}
if
x
.
getCausalityValue
().
getTestedProperty
()
==
'quantity'
]
self
.
portal
.
portal_workflow
.
doActionFor
(
# use Quantity Split Solver.
invoice
,
quantity_solver_decision
.
setSolverValue
(
self
.
portal
.
portal_solvers
[
'Quantity Split Solver'
])
'split_and_defer_action'
,
# configure for Quantity Split Solver.
start_date
=
self
.
datetime
+
15
,
kw
=
{
'delivery_solver'
:
'FIFO Delivery Solver'
,
stop_date
=
self
.
datetime
+
25
,
'start_date'
:
self
.
datetime
+
15
,
**
kw
)
'stop_date'
:
self
.
datetime
+
25
}
quantity_solver_decision
.
updateConfiguration
(
**
kw
)
solver_process
.
buildTargetSolverList
()
solver_process
.
solve
()
def
stepUnifyStartDateWithDecisionInvoice
(
self
,
sequence
=
None
,
def
stepUnifyStartDateWithDecisionInvoice
(
self
,
sequence
=
None
,
sequence_list
=
None
):
sequence_list
=
None
):
...
@@ -3001,6 +3001,8 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3001,6 +3001,8 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepCheckInvoiceIsDiverged
stepCheckInvoiceIsDiverged
stepSplitAndDeferInvoice
stepSplitAndDeferInvoice
stepTic
stepTic
stepInvoiceBuilderAlarm
stepTic
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsSolved
stepCheckInvoiceIsSolved
...
...
product/ERP5/tests/testPackingList.py
View file @
518fbca5
...
@@ -336,19 +336,18 @@ class TestPackingListMixin(TestOrderMixin):
...
@@ -336,19 +336,18 @@ class TestPackingListMixin(TestOrderMixin):
def
stepSplitAndDeferDoNothingPackingList
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
def
stepSplitAndDeferDoNothingPackingList
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
"""
Do the s
plit and defer
action, but choose "do nothing" for divergences
Do the s
olve divrgence
action, but choose "do nothing" for divergences
"""
"""
packing_list
=
sequence
.
get
(
'packing_list'
)
packing_list
=
sequence
.
get
(
'packing_list'
)
kw
=
{
'listbox'
:[
solver_process
=
self
.
portal
.
portal_solver_processes
.
newSolverProcess
(
packing_list
)
{
'listbox_key'
:
line
.
getRelativeUrl
(),
quantity_solver_decision
,
=
[
x
for
x
in
solver_process
.
contentValues
()
'choice'
:
'ignore'
}
for
line
in
packing_list
.
getMovementList
()
if
x
.
getCausalityValue
().
getTestedProperty
()
==
'quantity'
]
if
line
.
isDivergent
()]}
# use no solver
self
.
portal
.
portal_workflow
.
doActionFor
(
quantity_solver_decision
.
setSolverValue
(
None
)
packing_list
,
# and no configure
'split_and_defer_action'
,
quantity_solver_decision
.
updateConfiguration
()
start_date
=
self
.
datetime
+
15
,
solver_process
.
buildTargetSolverList
()
stop_date
=
self
.
datetime
+
25
,
solver_process
.
solve
()
**
kw
)
def
stepCheckPackingListSplitted
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
def
stepCheckPackingListSplitted
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
"""
...
...
product/ERP5/tests/testTradeModelLine.py
View file @
518fbca5
...
@@ -668,19 +668,24 @@ class TestTradeModelLine(TestTradeModelLineMixin):
...
@@ -668,19 +668,24 @@ class TestTradeModelLine(TestTradeModelLineMixin):
self
.
checkTradeModelRuleSimulationExpand
(
order
)
self
.
checkTradeModelRuleSimulationExpand
(
order
)
self
.
copyExpectedAmountDict
(
packing_list
,
self
.
copyExpectedAmountDict
(
packing_list
,
self
.
modified_packing_list_line_quantity_ratio
)
self
.
modified_packing_list_line_quantity_ratio
)
solver_process
=
self
.
portal
.
portal_solver_processes
.
newSolverProcess
(
packing_list
)
listbox
=
[{
'listbox_key'
:
line
.
getRelativeUrl
(),
quantity_solver_decision_list
=
[
x
for
x
in
solver_process
.
contentValues
()
'choice'
:
'SplitAndDefer'
}
if
x
.
getCausalityValue
().
getTestedProperty
()
==
'quantity'
]
for
line
in
packing_list
.
getMovementList
()
self
.
assertTrue
(
quantity_solver_decision_list
)
if
line
.
isDivergent
()]
for
quantity_solver_decision
in
quantity_solver_decision_list
:
self
.
assertEqual
(
len
(
order
),
len
(
listbox
))
# use Quantity Split Solver.
self
.
portal
.
portal_workflow
.
doActionFor
(
quantity_solver_decision
.
setSolverValue
(
self
.
portal
.
portal_solvers
[
'Quantity Split Solver'
])
packing_list
,
# configure for Quantity Split Solver.
'split_and_defer_action'
,
kw
=
{
start_date
=
packing_list
.
getStartDate
()
+
15
,
'delivery_solver'
:
'FIFO Delivery Solver'
,
stop_date
=
packing_list
.
getStopDate
()
+
25
,
'start_date'
:
packing_list
.
getStartDate
()
+
15
,
listbox
=
listbox
)
'stop_date'
:
packing_list
.
getStopDate
()
+
25
,
}
quantity_solver_decision
.
updateConfiguration
(
**
kw
)
solver_process
.
buildTargetSolverList
()
solver_process
.
solve
()
self
.
tic
()
self
.
buildPackingLists
()
self
.
tic
()
self
.
tic
()
self
.
checkCausalityState
(
packing_list
,
'solved'
)
self
.
checkCausalityState
(
packing_list
,
'solved'
)
new_packing_list
,
=
[
x
for
x
in
order
.
getCausalityRelatedValueList
(
new_packing_list
,
=
[
x
for
x
in
order
.
getCausalityRelatedValueList
(
...
...
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