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
Carlos Ramos Carreño
erp5
Commits
de0abcb9
Commit
de0abcb9
authored
Feb 01, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trade: add simple test for "Lines Report"
parent
ed84c574
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testTradeReports.py
...plateItem/portal_components/test.erp5.testTradeReports.py
+55
-0
No files found.
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testTradeReports.py
View file @
de0abcb9
...
...
@@ -1945,6 +1945,61 @@ class TestTradeReports(ERP5ReportTestCase):
# delivery_resource_text shows quantities and variations
delivery_resource_text
=
"ref 1: 1.0
\
n
ref 3 colour1: 3.0
\
n
ref 3 colour2: 2.0"
)
def
test_LinesReport
(
self
):
# Create sales orders
self
.
_makeOneSaleOrder
(
title
=
'SO 1'
,
destination_value
=
self
.
organisation_module
.
Organisation_1
,
destination_section_value
=
self
.
organisation_module
.
Organisation_1
,
destination_decision_value
=
self
.
organisation_module
.
Organisation_1
,
source_value
=
self
.
organisation_module
.
Organisation_2
,
source_section_value
=
self
.
organisation_module
.
Organisation_2
,
source_decision_value
=
self
.
organisation_module
.
Organisation_2
,
start_date
=
DateTime
(
2006
,
2
,
2
),
resource_dict
=
{
'product_module/product_A'
:{
"quantity"
:
11
,
"price"
:
3
},
'product_module/product_B'
:{
"quantity"
:
7
,
"price"
:
6
},},
)
self
.
_makeOneSaleOrder
(
title
=
'SO 2 (cancelled)'
,
destination_value
=
self
.
organisation_module
.
Organisation_1
,
destination_section_value
=
self
.
organisation_module
.
Organisation_1
,
destination_decision_value
=
self
.
organisation_module
.
Organisation_1
,
source_value
=
self
.
organisation_module
.
Organisation_2
,
source_section_value
=
self
.
organisation_module
.
Organisation_2
,
source_decision_value
=
self
.
organisation_module
.
Organisation_2
,
start_date
=
DateTime
(
2006
,
2
,
2
),
resource_dict
=
{
'product_module/product_A'
:{
"quantity"
:
11
,
"price"
:
3
},
'product_module/product_B'
:{
"quantity"
:
7
,
"price"
:
6
},},
cancel
=
True
,
)
# view the module first, it will set selection
self
.
portal
.
REQUEST
.
form
[
'simulation_state'
]
=
'draft'
view
=
self
.
portal
.
sale_order_module
.
view
()
self
.
assertFalse
(
'Site Error'
in
view
)
self
.
portal
.
REQUEST
.
form
[
'portal_type'
]
=
[
'Sale Order Line'
]
report_section
,
=
self
.
getReportSectionList
(
self
.
sale_order_module
,
'DeliveryModule_viewDeliveryLineReport'
)
line_list
=
sorted
(
(
l
for
l
in
self
.
getListBoxLineList
(
report_section
)
if
l
.
isDataLine
()),
key
=
lambda
x
:
x
.
getColumnProperty
(
'quantity'
))
self
.
assertEqual
(
len
(
line_list
),
2
)
self
.
checkLineProperties
(
line_list
[
0
],
start_date
=
DateTime
(
2006
,
2
,
2
),
quantity
=
7
,
price
=
6
,
)
self
.
checkLineProperties
(
line_list
[
1
],
start_date
=
DateTime
(
2006
,
2
,
2
),
quantity
=
11
,
price
=
3
,
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
...
...
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