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
1
Issues
1
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
Roque
erp5
Commits
c2437851
Commit
c2437851
authored
Jan 27, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Fixes for Order, Packing Lists and Invoice Report
See merge request
nexedi/erp5!1345
parents
0039aa3f
fe42394c
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
160 additions
and
18 deletions
+160
-18
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/AccountingTransactionModule_viewInvoiceReport.xml
...voicing/AccountingTransactionModule_viewInvoiceReport.xml
+4
-4
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_activateGetOrderStatList.py
..._skins/erp5_trade/OrderModule_activateGetOrderStatList.py
+1
-1
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_filterOrderStatResult.py
...tal_skins/erp5_trade/OrderModule_filterOrderStatResult.py
+0
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_filterOrderStatResult.xml
...al_skins/erp5_trade/OrderModule_filterOrderStatResult.xml
+1
-1
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderReportParameterDict.py
...ins/erp5_trade/OrderModule_getOrderReportParameterDict.py
+8
-2
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_viewOrderReport.xml
...m/portal_skins/erp5_trade/OrderModule_viewOrderReport.xml
+4
-4
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingListModule_viewPackingListReport.xml
...ns/erp5_trade/PackingListModule_viewPackingListReport.xml
+4
-4
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingListModule_viewPackingListReportDialog/your_simulation_state.xml
...ule_viewPackingListReportDialog/your_simulation_state.xml
+28
-1
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testTradeReports.py
...plateItem/portal_components/test.erp5.testTradeReports.py
+110
-1
No files found.
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/AccountingTransactionModule_viewInvoiceReport.xml
View file @
c2437851
...
@@ -89,13 +89,13 @@
...
@@ -89,13 +89,13 @@
<key>
<string>
left
</string>
</key>
<key>
<string>
left
</string>
</key>
<value>
<value>
<list>
<list>
<string>
your_aggregation_level
</string>
<string>
your_section_category
</string>
<string>
your_from_date
</string>
<string>
your_at_date
</string>
<string>
your_at_date
</string>
<string>
your_delivery_mode
</string>
<string>
your_delivery_mode
</string>
<string>
your_from_date
</string>
<string>
your_group_by
</string>
<string>
your_incoterm
</string>
<string>
your_incoterm
</string>
<string>
your_section_category
</string>
<string>
your_aggregation_level
</string>
<string>
your_group_by
</string>
<string>
your_simulation_state
</string>
<string>
your_simulation_state
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_activateGetOrderStatList.py
View file @
c2437851
...
@@ -88,7 +88,7 @@ portal.portal_catalog.activate(tag=tag).searchAndActivate(
...
@@ -88,7 +88,7 @@ portal.portal_catalog.activate(tag=tag).searchAndActivate(
'date_format'
:
date_format
,
'date_format'
:
date_format
,
'report_type'
:
report_type
,
'report_type'
:
report_type
,
'report_group_by'
:
report_group_by
},
'report_group_by'
:
report_group_by
},
select_method_id
=
'OrderModule_filterOrderStatResul'
,
select_method_id
=
'OrderModule_filterOrderStatResul
t
'
,
activate_kw
=
{
'priority'
:
7
,
activate_kw
=
{
'priority'
:
7
,
'tag'
:
tag
,
'tag'
:
tag
,
},
},
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_filterOrderStatResul.py
→
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_filterOrderStatResul
t
.py
View file @
c2437851
File moved
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_filterOrderStatResul.xml
→
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_filterOrderStatResul
t
.xml
View file @
c2437851
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
OrderModule_filterOrderStatResul
</string>
</value>
<value>
<string>
OrderModule_filterOrderStatResul
t
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderReportParameterDict.py
View file @
c2437851
...
@@ -14,10 +14,16 @@ if "Sale" in context.getPortalType():
...
@@ -14,10 +14,16 @@ if "Sale" in context.getPortalType():
report_type
=
"sale"
report_type
=
"sale"
line_portal_type
=
"Sale Order Line"
line_portal_type
=
"Sale Order Line"
doc_portal_type
=
"Sale Order"
doc_portal_type
=
"Sale Order"
if
"Packing List"
in
context
.
getPortalType
():
line_portal_type
=
"Sale Packing List Line"
doc_portal_type
=
"Sale Packing List"
elif
"Purchase"
in
context
.
getPortalType
():
elif
"Purchase"
in
context
.
getPortalType
():
report_type
=
"purchase"
report_type
=
"purchase"
line_portal_type
=
"Purchase Order Line"
line_portal_type
=
"Purchase Order Line"
doc_portal_type
=
"Purchase Order"
doc_portal_type
=
"Purchase Order"
if
"Packing List"
in
context
.
getPortalType
():
line_portal_type
=
"Purchase Packing List Line"
doc_portal_type
=
"Purchase Packing List"
elif
request
.
get
(
'order_report_document_portal_type'
):
elif
request
.
get
(
'order_report_document_portal_type'
):
doc_portal_type
=
request
.
get
(
'order_report_document_portal_type'
)
doc_portal_type
=
request
.
get
(
'order_report_document_portal_type'
)
if
doc_portal_type
==
'Purchase Invoice Transaction'
:
if
doc_portal_type
==
'Purchase Invoice Transaction'
:
...
@@ -61,7 +67,7 @@ interval_list = interval_list_dict[aggregation_level]
...
@@ -61,7 +67,7 @@ interval_list = interval_list_dict[aggregation_level]
interval_column_list
=
[]
interval_column_list
=
[]
if
group_by
==
"client"
:
if
group_by
==
"client"
:
interval_column_list
.
extend
([(
"Amount %s"
%
x
,
"Amount %s"
%
x
)
for
x
in
interval_list
])
interval_column_list
.
extend
([(
"Amount %s"
%
x
,
"Amount %s"
%
x
)
for
x
in
interval_list
])
selection_columns
=
[(
'client'
,
"
Client
"
)]
selection_columns
=
[(
'client'
,
"
Third Party
"
)]
total_column_list
=
[(
'total amount'
,
'Total Amount'
),]
total_column_list
=
[(
'total amount'
,
'Total Amount'
),]
stat_columns
=
[(
'client'
,
"client"
)]
stat_columns
=
[(
'client'
,
"client"
)]
total_stat_list
=
[(
'total amount'
,
'total amount'
),]
total_stat_list
=
[(
'total amount'
,
'total amount'
),]
...
@@ -70,7 +76,7 @@ else:
...
@@ -70,7 +76,7 @@ else:
selection_columns
=
[(
'product'
,
"Product"
)]
selection_columns
=
[(
'product'
,
"Product"
)]
stat_columns
=
[(
'product'
,
"product"
)]
stat_columns
=
[(
'product'
,
"product"
)]
else
:
else
:
selection_columns
=
[(
'client'
,
"
Client
"
),
(
'product'
,
"Product"
)]
selection_columns
=
[(
'client'
,
"
Third Party
"
),
(
'product'
,
"Product"
)]
stat_columns
=
[(
'client'
,
"client"
),
(
'product'
,
"product"
)]
stat_columns
=
[(
'client'
,
"client"
),
(
'product'
,
"product"
)]
for
x
in
interval_list
:
for
x
in
interval_list
:
interval_column_list
.
extend
([(
"Amount %s"
%
x
,
"Amount %s"
%
x
),
(
"Quantity %s"
%
x
,
"Quantity %s"
%
x
),
interval_column_list
.
extend
([(
"Amount %s"
%
x
,
"Amount %s"
%
x
),
(
"Quantity %s"
%
x
,
"Quantity %s"
%
x
),
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_viewOrderReport.xml
View file @
c2437851
...
@@ -89,14 +89,14 @@
...
@@ -89,14 +89,14 @@
<key>
<string>
left
</string>
</key>
<key>
<string>
left
</string>
</key>
<value>
<value>
<list>
<list>
<string>
your_aggregation_level
</string>
<string>
your_section_category
</string>
<string>
your_from_date
</string>
<string>
your_at_date
</string>
<string>
your_at_date
</string>
<string>
your_delivery_mode
</string>
<string>
your_delivery_mode
</string>
<string>
your_from_date
</string>
<string>
your_group_by
</string>
<string>
your_incoterm
</string>
<string>
your_incoterm
</string>
<string>
your_order
</string>
<string>
your_order
</string>
<string>
your_section_category
</string>
<string>
your_aggregation_level
</string>
<string>
your_group_by
</string>
<string>
your_simulation_state
</string>
<string>
your_simulation_state
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingListModule_viewPackingListReport.xml
View file @
c2437851
...
@@ -95,14 +95,14 @@
...
@@ -95,14 +95,14 @@
<key>
<string>
left
</string>
</key>
<key>
<string>
left
</string>
</key>
<value>
<value>
<list>
<list>
<string>
your_aggregation_level
</string>
<string>
your_section_category
</string>
<string>
your_from_date
</string>
<string>
your_at_date
</string>
<string>
your_at_date
</string>
<string>
your_delivery_mode
</string>
<string>
your_delivery_mode
</string>
<string>
your_from_date
</string>
<string>
your_group_by
</string>
<string>
your_incoterm
</string>
<string>
your_incoterm
</string>
<string>
your_order
</string>
<string>
your_order
</string>
<string>
your_section_category
</string>
<string>
your_aggregation_level
</string>
<string>
your_group_by
</string>
<string>
your_simulation_state
</string>
<string>
your_simulation_state
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingListModule_viewPackingListReportDialog/your_simulation_state.xml
View file @
c2437851
...
@@ -9,7 +9,9 @@
...
@@ -9,7 +9,9 @@
<item>
<item>
<key>
<string>
delegated_list
</string>
</key>
<key>
<string>
delegated_list
</string>
</key>
<value>
<value>
<list/>
<list>
<string>
items
</string>
</list>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -58,6 +60,12 @@
...
@@ -58,6 +60,12 @@
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
target
</string>
</key>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
...
@@ -77,6 +85,12 @@
...
@@ -77,6 +85,12 @@
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewTradeFieldLibrary
</string>
</value>
<value>
<string>
Base_viewTradeFieldLibrary
</string>
</value>
</item>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<item>
<key>
<string>
target
</string>
</key>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
<value>
<string>
Click to edit the target
</string>
</value>
...
@@ -87,4 +101,17 @@
...
@@ -87,4 +101,17 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python:here.Base_getTranslatedWorkflowStateItemList(wf_id=\'packing_list_workflow\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
</ZopeData>
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testTradeReports.py
View file @
c2437851
...
@@ -267,6 +267,22 @@ class TestTradeReports(ERP5ReportTestCase):
...
@@ -267,6 +267,22 @@ class TestTradeReports(ERP5ReportTestCase):
return
sale_order
return
sale_order
@
reindex
def
_makeOneSalePackingList
(
self
,
resource_dict
=
None
,
**
kw
):
"""
Create a sale packing list
"""
if
resource_dict
is
None
:
resource_dict
=
{}
sale_packing_list
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
"Sale Packing List"
,
**
kw
)
for
product
,
values
in
resource_dict
.
iteritems
():
sale_packing_list
.
newContent
(
portal_type
=
"Sale Packing List Line"
,
resource
=
product
,
quantity
=
values
[
"quantity"
],
price
=
values
[
"price"
])
return
sale_packing_list
def
_createSaleOrdersForSaleOrderReportTest
(
self
):
def
_createSaleOrdersForSaleOrderReportTest
(
self
):
# Create sales orders to be used in testSaleOrderReportXXX tests
# Create sales orders to be used in testSaleOrderReportXXX tests
self
.
_makeOneSaleOrder
(
self
.
_makeOneSaleOrder
(
...
@@ -318,6 +334,19 @@ class TestTradeReports(ERP5ReportTestCase):
...
@@ -318,6 +334,19 @@ class TestTradeReports(ERP5ReportTestCase):
cancel
=
True
cancel
=
True
)
)
# create also packing lists
self
.
_makeOneSalePackingList
(
title
=
'SPL 1 (same as SO 3, but delivered state)'
,
destination_value
=
self
.
organisation_module
.
Organisation_2
,
destination_section_value
=
self
.
organisation_module
.
Organisation_2
,
destination_decision_value
=
self
.
organisation_module
.
Organisation_2
,
source_value
=
self
.
organisation_module
.
Organisation_1
,
source_section_value
=
self
.
organisation_module
.
Organisation_1
,
source_decision_value
=
self
.
organisation_module
.
Organisation_1
,
start_date
=
DateTime
(
2006
,
2
,
22
),
resource_dict
=
{
'product_module/product_A'
:{
"quantity"
:
5
,
"price"
:
3
},
'product_module/product_B'
:{
"quantity"
:
1
,
"price"
:
6
},}
)
self
.
tic
()
self
.
tic
()
def
testSaleOrderReportBefore2006
(
self
):
def
testSaleOrderReportBefore2006
(
self
):
...
@@ -889,8 +918,88 @@ class TestTradeReports(ERP5ReportTestCase):
...
@@ -889,8 +918,88 @@ class TestTradeReports(ERP5ReportTestCase):
'total quantity'
:
None
}
'total quantity'
:
None
}
self
.
checkLineProperties
(
stat_line_list
[
0
],
**
d
)
self
.
checkLineProperties
(
stat_line_list
[
0
],
**
d
)
def
testSalePackingListReport
(
self
):
"""Using Sale Packing Lists, not sales Order
"""
self
.
_createSaleOrdersForSaleOrderReportTest
()
request
=
self
.
portal
.
REQUEST
request
[
'from_date'
]
=
DateTime
(
2006
,
1
,
1
)
request
[
'at_date'
]
=
DateTime
(
2006
,
12
,
31
)
request
[
'simulation_state'
]
=
[
'draft'
,]
request
[
'aggregation_level'
]
=
"year"
request
[
'group_by'
]
=
"both"
request
[
'section_category'
]
=
'group/g1'
parameter_dict
,
_
,
_
=
self
.
portal
.
sale_packing_list_module
.
OrderModule_getOrderReportParameterDict
()
active_process
=
self
.
portal
.
sale_packing_list_module
.
OrderModule_activateGetOrderStatList
(
tag
=
"unit_test"
,
**
parameter_dict
)
request
[
'active_process'
]
=
active_process
.
getPath
()
self
.
tic
()
report_section_list
=
self
.
getReportSectionList
(
self
.
portal
.
sale_packing_list_module
,
'OrderModule_viewOrderReport'
)
self
.
assertEqual
(
1
,
len
(
report_section_list
))
line_list
=
self
.
getListBoxLineList
(
report_section_list
[
0
])
data_line_list
=
[
l
for
l
in
line_list
if
l
.
isDataLine
()]
stat_line_list
=
[
l
for
l
in
line_list
if
l
.
isStatLine
()]
self
.
assertEqual
(
3
,
len
(
data_line_list
))
# test columns values
line
=
data_line_list
[
0
]
self
.
assertEqual
(
line
.
column_id_list
,
[
'client'
,
'product'
,
'Amount 2006'
,
'Quantity 2006'
,
'Quantity Unit 2006'
,
'total amount'
,
'total quantity'
])
d
=
{
'Amount 2006'
:
21.0
,
'Quantity 2006'
:
None
,
'Quantity Unit 2006'
:
None
,
'client'
:
'Organisation_2'
,
'product'
:
None
,
'total amount'
:
21.0
,
'total quantity'
:
None
,
}
self
.
checkLineProperties
(
data_line_list
[
0
],
**
d
)
d
=
{
'Amount 2006'
:
15.0
,
'Quantity 2006'
:
5.0
,
'Quantity Unit 2006'
:
'G'
,
'client'
:
None
,
'product'
:
'product_A'
,
'total amount'
:
15.0
,
'total quantity'
:
5.0
,
}
self
.
checkLineProperties
(
data_line_list
[
1
],
**
d
)
d
=
{
'Amount 2006'
:
6.0
,
'Quantity 2006'
:
1.0
,
'Quantity Unit 2006'
:
'Kg'
,
'client'
:
None
,
'product'
:
'product_B'
,
'total amount'
:
6.0
,
'total quantity'
:
1.0
,
}
self
.
checkLineProperties
(
data_line_list
[
2
],
**
d
)
# stat line
d
=
{
'Amount 2006'
:
21.0
,
'Quantity 2006'
:
None
,
'Quantity Unit 2006'
:
None
,
'client'
:
'Total'
,
'product'
:
None
,
'total amount'
:
21.0
,
'total quantity'
:
None
,
}
self
.
checkLineProperties
(
stat_line_list
[
0
],
**
d
)
def
_createInventoryForStockReportTest
(
self
):
def
_createInventoryForStockReportTest
(
self
):
# Create inventories
# Create inventories
# Create inventories
self
.
_makeOneInventory
(
self
.
_makeOneInventory
(
title
=
'Inventory 1'
,
title
=
'Inventory 1'
,
...
...
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