Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5_fork
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
Show 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):
stepCheckInvoiceIsDiverged
stepSplitAndDeferInvoice
stepTic
stepInvoiceBuilderAlarm
stepTic
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsSolved
...
...
@@ -822,6 +824,8 @@ class TestAdvancedSaleInvoice(TestAdvancedInvoice):
stepTic
stepDeliverInvoice
stepTic
stepInvoiceBuilderAlarm
stepTic
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsSolved
stepCheckInvoiceSplitted
...
...
product/ERP5/tests/testInvoice.py
View file @
518fbca5
...
...
@@ -888,19 +888,19 @@ class TestInvoiceMixin(TestPackingListMixin):
def
stepSplitAndDeferInvoice
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
split and defer at the invoice level
"""
invoice
=
sequence
.
get
(
'invoice'
)
kw
=
{
'listbox'
:[
{
'listbox_key'
:
line
.
getRelativeUrl
(),
'choice'
:
'SplitAndDefer'
}
for
line
in
invoice
.
getMovementList
()]}
self
.
portal
.
portal_workflow
.
doActionFor
(
invoice
,
'split_and_defer_action'
,
start_date
=
self
.
datetime
+
15
,
stop_date
=
self
.
datetime
+
25
,
**
kw
)
solver_process
=
self
.
portal
.
portal_solver_processes
.
newSolverProcess
(
invoice
)
quantity_solver_decision
,
=
[
x
for
x
in
solver_process
.
contentValues
()
if
x
.
getCausalityValue
().
getTestedProperty
()
==
'quantity'
]
# use Quantity Split Solver.
quantity_solver_decision
.
setSolverValue
(
self
.
portal
.
portal_solvers
[
'Quantity Split Solver'
])
# configure for Quantity Split Solver.
kw
=
{
'delivery_solver'
:
'FIFO Delivery Solver'
,
'start_date'
:
self
.
datetime
+
15
,
'stop_date'
:
self
.
datetime
+
25
}
quantity_solver_decision
.
updateConfiguration
(
**
kw
)
solver_process
.
buildTargetSolverList
()
solver_process
.
solve
()
def
stepUnifyStartDateWithDecisionInvoice
(
self
,
sequence
=
None
,
sequence_list
=
None
):
...
...
@@ -3001,6 +3001,8 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepCheckInvoiceIsDiverged
stepSplitAndDeferInvoice
stepTic
stepInvoiceBuilderAlarm
stepTic
stepCheckInvoiceIsNotDivergent
stepCheckInvoiceIsSolved
...
...
product/ERP5/tests/testPackingList.py
View file @
518fbca5
...
...
@@ -336,19 +336,18 @@ class TestPackingListMixin(TestOrderMixin):
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'
)
kw
=
{
'listbox'
:[
{
'listbox_key'
:
line
.
getRelativeUrl
(),
'choice'
:
'ignore'
}
for
line
in
packing_list
.
getMovementList
()
if
line
.
isDivergent
()]}
self
.
portal
.
portal_workflow
.
doActionFor
(
packing_list
,
'split_and_defer_action'
,
start_date
=
self
.
datetime
+
15
,
stop_date
=
self
.
datetime
+
25
,
**
kw
)
solver_process
=
self
.
portal
.
portal_solver_processes
.
newSolverProcess
(
packing_list
)
quantity_solver_decision
,
=
[
x
for
x
in
solver_process
.
contentValues
()
if
x
.
getCausalityValue
().
getTestedProperty
()
==
'quantity'
]
# use no solver
quantity_solver_decision
.
setSolverValue
(
None
)
# and no configure
quantity_solver_decision
.
updateConfiguration
()
solver_process
.
buildTargetSolverList
()
solver_process
.
solve
()
def
stepCheckPackingListSplitted
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
...
...
product/ERP5/tests/testTradeModelLine.py
View file @
518fbca5
...
...
@@ -668,19 +668,24 @@ class TestTradeModelLine(TestTradeModelLineMixin):
self
.
checkTradeModelRuleSimulationExpand
(
order
)
self
.
copyExpectedAmountDict
(
packing_list
,
self
.
modified_packing_list_line_quantity_ratio
)
listbox
=
[{
'listbox_key'
:
line
.
getRelativeUrl
(),
'choice'
:
'SplitAndDefer'
}
for
line
in
packing_list
.
getMovementList
()
if
line
.
isDivergent
()]
self
.
assertEqual
(
len
(
order
),
len
(
listbox
))
self
.
portal
.
portal_workflow
.
doActionFor
(
packing_list
,
'split_and_defer_action'
,
start_date
=
packing_list
.
getStartDate
()
+
15
,
stop_date
=
packing_list
.
getStopDate
()
+
25
,
listbox
=
listbox
)
solver_process
=
self
.
portal
.
portal_solver_processes
.
newSolverProcess
(
packing_list
)
quantity_solver_decision_list
=
[
x
for
x
in
solver_process
.
contentValues
()
if
x
.
getCausalityValue
().
getTestedProperty
()
==
'quantity'
]
self
.
assertTrue
(
quantity_solver_decision_list
)
for
quantity_solver_decision
in
quantity_solver_decision_list
:
# use Quantity Split Solver.
quantity_solver_decision
.
setSolverValue
(
self
.
portal
.
portal_solvers
[
'Quantity Split Solver'
])
# configure for Quantity Split Solver.
kw
=
{
'delivery_solver'
:
'FIFO Delivery Solver'
,
'start_date'
:
packing_list
.
getStartDate
()
+
15
,
'stop_date'
:
packing_list
.
getStopDate
()
+
25
,
}
quantity_solver_decision
.
updateConfiguration
(
**
kw
)
solver_process
.
buildTargetSolverList
()
solver_process
.
solve
()
self
.
tic
()
self
.
buildPackingLists
()
self
.
tic
()
self
.
checkCausalityState
(
packing_list
,
'solved'
)
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