[FIX] import openerp.{netsvc,tools} instead of {netsvc,tools} in YML tests.

bzr revid: vmt@openerp.com-20130209062929-g85yauw92vj9wqpb
This commit is contained in:
Vo Minh Thu 2013-02-09 07:29:29 +01:00
parent c92b76740f
commit 02a114fe3b
18 changed files with 58 additions and 29 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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]

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)