From 02a114fe3b98f9f72de46e76911ed1d7a78e6299 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Sat, 9 Feb 2013 07:29:29 +0100 Subject: [PATCH] [FIX] import openerp.{netsvc,tools} instead of {netsvc,tools} in YML tests. bzr revid: vmt@openerp.com-20130209062929-g85yauw92vj9wqpb --- addons/account/test/account_report.yml | 6 ++++-- .../test/account_payment_report.yml | 3 ++- .../test/account_voucher_report.yml | 3 ++- addons/delivery/test/delivery_cost.yml | 3 ++- addons/hr_expense/test/expense_process.yml | 3 ++- addons/hr_payroll/test/hr_payroll_report.yml | 3 ++- addons/l10n_fr/test/l10n_fr_report.yml | 3 ++- addons/l10n_in_hr_payroll/test/payment_advice.yml | 3 ++- addons/l10n_lu/test/l10n_lu_report.yml | 3 ++- addons/mrp/test/order_process.yml | 6 ++++-- .../mrp_operations/test/workcenter_operations.yml | 6 ++++-- addons/mrp_repair/test/mrp_repair_report.yml | 3 ++- .../point_of_sale/test/point_of_sale_report.yml | 12 ++++++++---- addons/purchase/test/ui/print_report.yml | 6 ++++-- .../test/purchase_requisition.yml | 3 ++- .../test/report_intrastat_report.yml | 3 ++- addons/sale_stock/test/picking_order_policy.yml | 3 ++- addons/stock/test/stock_report.yml | 15 ++++++++++----- 18 files changed, 58 insertions(+), 29 deletions(-) diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index ee9b1784fc4..0064a1d2556 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -13,7 +13,8 @@ In order to test the PDF reports defined on an invoice, we will print an Invoice Report - !python {model: account.invoice}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.account_invoice_customer0')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) @@ -22,7 +23,8 @@ In order to test the PDF reports defined on a partner, we will print the Overdue Report - !python {model: res.partner}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_1'),ref('base.res_partner_2'),ref('base.res_partner_12')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data) diff --git a/addons/account_payment/test/account_payment_report.yml b/addons/account_payment/test/account_payment_report.yml index 8786841bf1a..055e2804ee3 100644 --- a/addons/account_payment/test/account_payment_report.yml +++ b/addons/account_payment/test/account_payment_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on Account Payment, I print a Payment Order report. - !python {model: payment.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.payment.order').create(cr, uid, [ref('payment_order_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account_payment-payment_order_report.'+format), 'wb+').write(data) diff --git a/addons/account_voucher/test/account_voucher_report.yml b/addons/account_voucher/test/account_voucher_report.yml index 60dc4103553..e8dbde413f2 100644 --- a/addons/account_voucher/test/account_voucher_report.yml +++ b/addons/account_voucher/test/account_voucher_report.yml @@ -19,7 +19,8 @@ In order to test the PDF reports defined on a account_voucher, we will print account voucher Report - !python {model: account.voucher}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0again")], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data) diff --git a/addons/delivery/test/delivery_cost.yml b/addons/delivery/test/delivery_cost.yml index 22b8bc3b375..8fc7a8b7afe 100644 --- a/addons/delivery/test/delivery_cost.yml +++ b/addons/delivery/test/delivery_cost.yml @@ -31,7 +31,8 @@ I print a Delivery Order report. - !python {model: stock.picking}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools sale = self.pool.get('sale.order') sale_order = sale.browse(cr, uid, ref("sale.sale_order_6")) ship_ids = [x.id for x in sale_order.picking_ids] diff --git a/addons/hr_expense/test/expense_process.yml b/addons/hr_expense/test/expense_process.yml index eae63c460fc..b563f30afa9 100644 --- a/addons/hr_expense/test/expense_process.yml +++ b/addons/hr_expense/test/expense_process.yml @@ -41,7 +41,8 @@ I print a report of the expenses. - !python {model: hr.expense.expense}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.sep_expenses')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data) diff --git a/addons/hr_payroll/test/hr_payroll_report.yml b/addons/hr_payroll/test/hr_payroll_report.yml index 5b86bacf693..9681134f270 100644 --- a/addons/hr_payroll/test/hr_payroll_report.yml +++ b/addons/hr_payroll/test/hr_payroll_report.yml @@ -4,7 +4,8 @@ Print HR Payslip - !python {model: hr.payslip}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/l10n_fr/test/l10n_fr_report.yml b/addons/l10n_fr/test/l10n_fr_report.yml index 6dd6a563525..1e036d379a5 100644 --- a/addons/l10n_fr/test/l10n_fr_report.yml +++ b/addons/l10n_fr/test/l10n_fr_report.yml @@ -12,7 +12,8 @@ In order to test the PDF reports defined on a l10n_fr, we will print a Compute Resultant Report for l10n_fr - !python {model: account.move.line}: | - import netsvc, tools, os,time + import os + from openerp import netsvc, tools,time (data, format) = netsvc.LocalService('report.l10n.fr.compute_resultant').create(cr, uid, [], {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-compute_resultant_report.'+format), 'wb+').write(data) diff --git a/addons/l10n_in_hr_payroll/test/payment_advice.yml b/addons/l10n_in_hr_payroll/test/payment_advice.yml index 20b45830c5e..ff391dd5363 100644 --- a/addons/l10n_in_hr_payroll/test/payment_advice.yml +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -35,7 +35,8 @@ In order to test the PDF report defined on a Payment Advice, we will print a Print Advice Report when NEFT is checked - !python {model: hr.payroll.advice}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_1')], {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/l10n_lu/test/l10n_lu_report.yml b/addons/l10n_lu/test/l10n_lu_report.yml index f3a35253850..cacb3015ab2 100644 --- a/addons/l10n_lu/test/l10n_lu_report.yml +++ b/addons/l10n_lu/test/l10n_lu_report.yml @@ -8,7 +8,8 @@ In order to test the PDF reports defined on a l10u_lu, we will print a VAT Report - !python {model: res.partner}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.l10n_lu.tax.report.print').create(cr, uid, [], {'model':'ir.ui.menu', 'form':{'tax_code_id': ref('account_tax_code_id_r1'), 'period_id': ref('account.period_1')}}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_lu-vat_report.'+format), 'wb+').write(data) diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index 64162291290..89331d5c255 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -214,7 +214,8 @@ I print a "BOM Structure". - !python {model: mrp.production}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools order = self.browse(cr, uid, ref("mrp_production_test1")) (data, format) = netsvc.LocalService('report.bom.structure').create(cr, uid, [order.bom_id.id], {}, {}) if tools.config['test_report_directory']: @@ -223,7 +224,8 @@ I print "Production Order". - !python {model: mrp.production}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.mrp.production.order').create(cr, uid, [ref("mrp_production_test1")], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp-production_order_report.'+format), 'wb+').write(data) diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index c1449657967..43f8e372fcb 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -106,7 +106,8 @@ I print a Barcode Report of Operation line. - !python {model: mrp_operations.operation.code}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (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-barcode_report.'+format), 'wb+').write(data) @@ -115,7 +116,8 @@ I print Workcenter's Barcode Report. - !python {model: mrp.workcenter}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (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_operations-workcenter_barcode_report.'+format), 'wb+').write(data) diff --git a/addons/mrp_repair/test/mrp_repair_report.yml b/addons/mrp_repair/test/mrp_repair_report.yml index 3b8e05108c8..5d66064f61d 100644 --- a/addons/mrp_repair/test/mrp_repair_report.yml +++ b/addons/mrp_repair/test/mrp_repair_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on a MRP Repair, we will print an Order Report - !python {model: mrp.repair}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.repair.order').create(cr, uid, [ref('mrp_repair.mrp_repair_rmrp0')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp_repair-order_report.'+format), 'wb+').write(data) diff --git a/addons/point_of_sale/test/point_of_sale_report.yml b/addons/point_of_sale/test/point_of_sale_report.yml index 4356d4e1d27..00a675ac152 100644 --- a/addons/point_of_sale/test/point_of_sale_report.yml +++ b/addons/point_of_sale/test/point_of_sale_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on a Point Of Sale,we will print a POS Detail Summary Report - !python {model: pos.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.pos.details_summary').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-details_summary report'+format), 'wb+').write(data) @@ -11,7 +12,8 @@ In order to test the PDF reports defined on a Point Of Sale, we will print a POS Invoice Report - !python {model: pos.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.pos.invoice').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice report'+format), 'wb+').write(data) @@ -20,7 +22,8 @@ In order to test the PDF reports defined on a Point Of Sale, we will print a POS Lines Report - !python {model: pos.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.pos.lines').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-lines report'+format), 'wb+').write(data) @@ -29,7 +32,8 @@ In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt Report - !python {model: pos.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.pos.receipt').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data) diff --git a/addons/purchase/test/ui/print_report.yml b/addons/purchase/test/ui/print_report.yml index 75c6d21e036..c5a9448e497 100644 --- a/addons/purchase/test/ui/print_report.yml +++ b/addons/purchase/test/ui/print_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on a Purchase Order, I print a Request Quotation report - !python {model: purchase.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.purchase.quotation').create(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'purchase-request_quotation'+format), 'wb+').write(data) @@ -10,7 +11,8 @@ I print Purchase Order report - !python {model: purchase.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.purchase.order').create(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'purchase-purchase_order_report'+format), 'wb+').write(data) diff --git a/addons/purchase_requisition/test/purchase_requisition.yml b/addons/purchase_requisition/test/purchase_requisition.yml index 38e66788dcf..36114c28e0f 100644 --- a/addons/purchase_requisition/test/purchase_requisition.yml +++ b/addons/purchase_requisition/test/purchase_requisition.yml @@ -84,7 +84,8 @@ I print a Requisition report - !python {model: purchase.requisition}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.purchase.requisition').create(cr, uid, [ref('purchase_requisition.requisition1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'purchase_requisition-purchase_requisition_report.'+format), 'wb+').write(data) diff --git a/addons/report_intrastat/test/report_intrastat_report.yml b/addons/report_intrastat/test/report_intrastat_report.yml index 626f2fde186..e51bfbbe748 100644 --- a/addons/report_intrastat/test/report_intrastat_report.yml +++ b/addons/report_intrastat/test/report_intrastat_report.yml @@ -13,7 +13,8 @@ In order to test the PDF reports defined using report_intrastat module, we print a Intrastat Report - !python {model: account.invoice}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.account.invoice.intrastat').create(cr, uid, [ref('test_invoice_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'report_intrastat-intrastat_report.'+format), 'wb+').write(data) diff --git a/addons/sale_stock/test/picking_order_policy.yml b/addons/sale_stock/test/picking_order_policy.yml index 83b7191e70e..e5187ef6c23 100644 --- a/addons/sale_stock/test/picking_order_policy.yml +++ b/addons/sale_stock/test/picking_order_policy.yml @@ -162,7 +162,8 @@ I print a sale order report. - !python {model: sale.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.sale.order').create(cr, uid, [ref('sale.sale_order_6')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'sale-sale_order.'+format), 'wb+').write(data) diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml index 5c5932446eb..b1590a4d819 100644 --- a/addons/stock/test/stock_report.yml +++ b/addons/stock/test/stock_report.yml @@ -2,7 +2,8 @@ I print a stock overview report of location. - !python {model: stock.location}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('location_refrigerator')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data) @@ -10,7 +11,8 @@ I print a Stock Overview report of location with child location. - !python {model: stock.location}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('location_refrigerator')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data) @@ -18,7 +20,8 @@ I print a Stock Inventory report. - !python {model: stock.inventory}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock_inventory_icecream')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data) @@ -26,7 +29,8 @@ I print a outgoing shipment report. - !python {model: stock.picking}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('outgoing_shipment')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data) @@ -34,7 +38,8 @@ I print stock Report. - !python {model: product.product}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product_icecream')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)