39 lines
1.9 KiB
YAML
39 lines
1.9 KiB
YAML
-
|
|
In order to test the PDF reports defined on a MRP, we will print a BOM Structure Report
|
|
-
|
|
!python {model: mrp.bom}: |
|
|
import netsvc, tools, os
|
|
(data, format) = netsvc.LocalService('report.bom.structure').create(cr, uid, [ref('mrp.mrp_bom_0'),ref('mrp.mrp_bom_1'),ref('mrp.mrp_bom_2'),ref('mrp.mrp_bom_23'),ref('mrp.mrp_bom_1901'),ref('mrp.mrp_bom_assemblysection0'),ref('mrp.mrp_bom_sidepanel0'),ref('mrp.mrp_bom_defaultbomforshelfofcm1'),ref('mrp.mrp_bom_sidepanel3')], {}, {})
|
|
if tools.config['test_report_directory']:
|
|
file(os.path.join(tools.config['test_report_directory'], 'mrp-bom_structure_report.'+format), 'wb+').write(data)
|
|
|
|
-
|
|
In order to test the PDF reports defined on a MRP, we will print Production Order Report
|
|
-
|
|
!python {model: mrp.production}: |
|
|
import netsvc, tools, os
|
|
(data, format) = netsvc.LocalService('report.mrp.production.order').create(cr, uid, [ref('mrp.mrp_production_mo1')], {}, {})
|
|
if tools.config['test_report_directory']:
|
|
file(os.path.join(tools.config['test_report_directory'], 'mrp-production_order_report.'+format), 'wb+').write(data)
|
|
|
|
-
|
|
Print Product Price Report through the wizard
|
|
-
|
|
!python {model: product.product}: |
|
|
ctx={}
|
|
ctx.update({'model': 'product.product','active_ids': [1,2,3,5]})
|
|
data_dict = {'number': 1}
|
|
from tools import test_reports
|
|
test_reports.try_report_action(cr, uid, 'action_view_mrp_product_price_wizard',wiz_data=data_dict, context=ctx, our_module='mrp')
|
|
|
|
-
|
|
Print Work Center Load Report through the wizard
|
|
-
|
|
!python {model: mrp.workcenter}: |
|
|
ctx={}
|
|
ctx.update({'model': 'mrp.workcenter','active_ids': [ref('mrp_workcenter_0'),ref('mrp_workcenter_1')]})
|
|
data_dict = {'time_unit': 'day', 'measure_unit': 'hours'}
|
|
from tools import test_reports
|
|
test_reports.try_report_action(cr, uid, 'action_mrp_workcenter_load_wizard',wiz_data=data_dict, context=ctx, our_module='mrp')
|
|
|