From 67fe69cc61a622996d30b34d8a28508ec4071703 Mon Sep 17 00:00:00 2001 From: "DHS (OpenERP)" Date: Wed, 15 Sep 2010 18:04:52 +0530 Subject: [PATCH] [IMP] lunch,mrp,mrp_operations,mrp_repair : yml report test added bzr revid: dhs@tinyerp.com-20100915123452-odrbked6wcx0wg60 --- addons/lunch/__openerp__.py | 5 ++-- addons/lunch/test/lunch_report.yml | 8 ++++++ addons/mrp/__openerp__.py | 3 ++- addons/mrp/test/mrp_report.yml | 26 +++++++++++++++++++ addons/mrp_operations/__openerp__.py | 2 +- .../test/mrp_operations_report.yml | 17 ++++++++++++ addons/mrp_repair/__openerp__.py | 10 +++---- addons/mrp_repair/test/mrp_repair_report.yml | 8 ++++++ 8 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 addons/lunch/test/lunch_report.yml create mode 100644 addons/mrp/test/mrp_report.yml create mode 100644 addons/mrp_operations/test/mrp_operations_report.yml create mode 100644 addons/mrp_repair/test/mrp_repair_report.yml diff --git a/addons/lunch/__openerp__.py b/addons/lunch/__openerp__.py index ab540ad10d3..2e5c2489339 100644 --- a/addons/lunch/__openerp__.py +++ b/addons/lunch/__openerp__.py @@ -49,9 +49,8 @@ 'report/report_lunch_order_view.xml', ], "demo_xml": ['lunch_demo.xml'], - "test": ['test/test_lunch.yml'], + "test": ['test/test_lunch.yml', 'test/lunch_report.yml'], "installable": True, } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/lunch/test/lunch_report.yml b/addons/lunch/test/lunch_report.yml new file mode 100644 index 00000000000..76214dfb599 --- /dev/null +++ b/addons/lunch/test/lunch_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a lunch, we will print a lunch order +- + !python {model: lunch.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lunch.order').create(cr, uid, [ref('lunch.lunch_order_0'),ref('lunch.lunch_order_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'lunch-lunch_order.'+format), 'wb+').write(data) diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index f8630065598..c56466501e0 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -92,7 +92,8 @@ 'test/mrp_packs.yml', 'test/mrp_phantom_bom.yml', 'test/mrp_production_order.yml', - + 'test/mrp_report.yml', + ], 'installable': True, 'active': False, diff --git a/addons/mrp/test/mrp_report.yml b/addons/mrp/test/mrp_report.yml new file mode 100644 index 00000000000..5c619e0b09d --- /dev/null +++ b/addons/mrp/test/mrp_report.yml @@ -0,0 +1,26 @@ +- + In order to test the PDF reports defined on a mrp, we will print a bom order +- + !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_order.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a mrp, we will print a order +- + !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.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a mrp, we will print a (mrp)Product-price order +- + !python {model: product.product}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.product.price').create(cr, uid, [ref('product.product_product_0'), ref('product.product_product_pc2'), ref('product.product_product_cpu1'), ref('product.product_product_hdd1'), ref('product.product_product_fan'), ref('product.product_product_cpu1'), ref('product.product_product_ram512')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp-production-price_order.'+format), 'wb+').write(data) diff --git a/addons/mrp_operations/__openerp__.py b/addons/mrp_operations/__openerp__.py index d4d5cf98d08..5170cc4c627 100644 --- a/addons/mrp_operations/__openerp__.py +++ b/addons/mrp_operations/__openerp__.py @@ -61,7 +61,7 @@ 'process/mrp_operation_process.xml' ], 'demo_xml': ['mrp_operation_data.xml'], - 'test': ['test/mrp_operations.yml'], + 'test': ['test/mrp_operations.yml', 'test/mrp_operations_report.yml'], 'installable': True, 'active': False, 'certificate': '0056233813133', diff --git a/addons/mrp_operations/test/mrp_operations_report.yml b/addons/mrp_operations/test/mrp_operations_report.yml new file mode 100644 index 00000000000..c83d077acde --- /dev/null +++ b/addons/mrp_operations/test/mrp_operations_report.yml @@ -0,0 +1,17 @@ +- + In order to test the PDF reports defined on a mrp operations, we will print a barcode +- + !python {model: mrp_operations.operation.code}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.mrp.code.barcode').create(cr, uid, [ref('mrp_operations.mrp_op_1'),ref('mrp_operations.mrp_op_2'),ref('mrp_operations.mrp_op_3'),ref('mrp_operations.mrp_op_4'),ref('mrp_operations.mrp_op_5')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcoder.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a mrp operations, we will print a workcenters +- + !python {model: mrp.workcenter}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.mrp.wc.barcode').create(cr, uid, [ref('mrp.mrp_workcenter_0'),ref('mrp.mrp_workcenter_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp_ workcenter.'+format), 'wb+').write(data) diff --git a/addons/mrp_repair/__openerp__.py b/addons/mrp_repair/__openerp__.py index c9a4068f925..4313ae1a062 100644 --- a/addons/mrp_repair/__openerp__.py +++ b/addons/mrp_repair/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -31,13 +31,13 @@ * Invoicing (products and/or services) * Warranty concept * Repair quotation report - * Notes for the technician and for the final customer + * Notes for the technician and for the final customer """, 'author': 'OpenERP SA', 'depends': ['mrp', 'sale', 'account'], 'update_xml': [ 'security/ir.model.access.csv', - 'mrp_repair_sequence.xml', + 'mrp_repair_sequence.xml', 'wizard/mrp_repair_cancel_view.xml', 'wizard/mrp_repair_make_invoice_view.xml', 'mrp_repair_view.xml', @@ -45,7 +45,7 @@ 'mrp_repair_report.xml', ], 'demo_xml': [], - 'test': ['test/test_mrp_repair.yml'], + 'test': ['test/test_mrp_repair.yml', 'test/mrp_repair_report.yml'], 'installable': True, 'active': False, 'certificate': '0060814381277', diff --git a/addons/mrp_repair/test/mrp_repair_report.yml b/addons/mrp_repair/test/mrp_repair_report.yml new file mode 100644 index 00000000000..b6eb782dcfe --- /dev/null +++ b/addons/mrp_repair/test/mrp_repair_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a mrp-repair, we will print a order +- + !python {model: mrp.repair}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.repair.order').create(cr, uid, [ref('mrp_repair.mrp_repair_rma0')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp-repair_order.'+format), 'wb+').write(data)