[MERGE] Merged Automated YAML test for Reports

bzr revid: jvo@tinyerp.com-20100917143345-hbdayendjbehw28e
This commit is contained in:
Jay (OpenERP) 2010-09-17 20:03:45 +05:30
commit 40ca95a139
24 changed files with 260 additions and 127 deletions

View File

@ -25,29 +25,30 @@
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-voucher-report.'+format), 'wb+').write(data)
#-
# Demo data for Account tax code
#-
# !record {model: account.tax.code, id: account_tax_code_0}:
# name : Tax Code Test
#-
# Print Tax Code entries report
#-
# !python {model: account.tax.code}: |
# import netsvc, tools, os
# (data, format) = netsvc.LocalService('report.account.tax.code.entries').create(cr, uid, [ref('account.account_tax_code_0')], {}, {})
# if tools.config['test_report_directory']:
# file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data)
-
Demo data for Account tax code
-
!record {model: account.tax.code, id: account_tax_code_0}:
name : Tax Code Test
-
Print Tax Code entries report
-
!python {model: account.tax.code}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.account.tax.code.entries').create(cr, uid, [ref('account_tax_code_0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data)
-
Print Vat Declaration Report
-
!python {model: account.tax.code}: |
import netsvc, tools, os
data_dict = {'model': 'ir.ui.menu', 'form': {'based_on': 'invoices','company_id':ref('base.main_company'),'periods':[]}}
(data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account_tax_code_0")], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-vat-declaration.'+format), 'wb+').write(data)
#-
# Print Vat Declaration Report
#-
# !python {model: account.tax.code}: |
# import netsvc, tools, os
# data_dict = {'model': 'ir.ui.menu', 'form': {'based_on': 'invoices','company_id':ref('base.main_company'),'periods':[]}}
# (data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account.account_tax_code0")], data_dict, {})
# if tools.config['test_report_directory']:
# file(os.path.join(tools.config['test_report_directory'], 'account-vat-declaration.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on an invoice, we will print an invoice
-

View File

@ -52,6 +52,7 @@
# "test/account_voucher.yml",
# "test/sales_receipt.yml",
# "test/sales_payment.yml",
"test/account_voucher_report.yml"
],
'certificate': '0037580727101',
"active": False,

View File

@ -0,0 +1,34 @@
-
Demo for Account Voucher
-
!record {model: account.voucher, id: account_voucher_voucheraxelor0}:
account_id: account.cash
company_id: base.main_company
currency_id: base.EUR
journal_id: account.bank_journal
name: Voucher Axelor
narration: Basic PC
amount: 1000.0
line_ids:
- account_id: account.cash
amount: 1000.0
name: Voucher Axelor
period_id: account.period_6
-
In order to test the PDF reports defined on a account_voucher, we will print account voucher amount Report
-
!python {model: account.voucher}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.voucher.cash_amount').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_voucher-amount.'+format), 'wb+').write(data)
-
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
(data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data)

View File

@ -5,7 +5,7 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.auction.artists').create(cr, uid, [ref('auction.auction_deposit_1_lot_1'),ref('auction.auction_deposit_1_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'action_artist_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_artist_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on auction, we will print a auction Bid
@ -14,7 +14,7 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.auction.bids').create(cr, uid, [ref('auction.auction_date_1_bid_3'),ref('auction.auction_date_1_bid_4')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'action_bid_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_bid_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on auction, we will print a lots list Report
@ -23,7 +23,8 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.lots.list').create(cr, uid, [ref('auction.auction_deposit_3_lot_1'),ref('auction.auction_deposit_3_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'lots_list_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_lots_list_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on auction, we will print a lots inventory Report
-
@ -31,7 +32,8 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.lots.list.inventory').create(cr, uid, [ref('auction.auction_deposit_4_lot_1'),ref('auction.auction_deposit_4_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'lots_inventory_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_lots_inventory_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on auction, we will print a deposit seller Report
-
@ -39,7 +41,8 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.deposit.seller').create(cr, uid, [ref('auction.auction_deposit_5_lot_1'),ref('auction.auction_deposit_5_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'deposit_seller_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_deposit_seller_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on auction, we will print a catalog
-
@ -47,7 +50,8 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.auction.cat_flagy').create(cr, uid, [ref('auction.auction_date_1'),ref('auction.auction_date_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'auction-catalog_list.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_catalog_list.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on auction, we will print buyer form report
-
@ -55,7 +59,8 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.buyer_form_report').create(cr, uid, [ref('auction.auction_deposit_6_lot_1'),ref('auction.auction_deposit_6_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'auction-buyer_form.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_buyer_form.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on auction, we will print bids phones report
-
@ -63,7 +68,8 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.bids.phones.details').create(cr, uid, [ref('auction.auction_deposit_7_lot_1'),ref('auction.auction_deposit_7_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'auction-bids_phones_details.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_bids_phones_details.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a auction, we will print a Auction Total
-
@ -71,7 +77,7 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.auction.total.rml').create(cr, uid, [ref('auction.auction_deposit_8_lot_1'),ref('auction.auction_deposit_8_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'action_total_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_total_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a auction, we will print a Auction Result
@ -80,7 +86,7 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.auction.result').create(cr, uid, [ref('auction.auction_deposit_9_lot_1'),ref('auction.auction_deposit_9_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'action_result_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_result_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a auction, we will print a Auction Lot
@ -89,4 +95,31 @@
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.bids.lots').create(cr, uid, [ref('auction.auction_deposit_10_lot_1'),ref('auction.auction_deposit_10_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'action_lot_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_lot_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a auction, we will print a Auction Buyer list report
-
!python {model: auction.lots}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.buyer.list').create(cr, uid, [ref('auction.auction_deposit_10_lot_1'),ref('auction.auction_deposit_10_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_buyer_list_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a auction, we will print a Auction Flagey Hussier report
-
!python {model: auction.lots}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.flagey.huissier').create(cr, uid, [ref('auction.auction_deposit_3_lot_1'),ref('auction.auction_deposit_10_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_flagey_hussier_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a auction, we will print Auction Seller Form report
-
!python {model: auction.lots}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.seller_form_report').create(cr, uid, [ref('auction.auction_deposit_3_lot_1'),ref('auction.auction_deposit_10_lot_2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'auction-auction_seller_form_report.'+format), 'wb+').write(data)

View File

@ -3,7 +3,7 @@
<data>
<report auto="False" id="base.ir_module_reference_print" model="ir.module.module" name="ir.module.reference.graph" rml="base_module_doc_rst/report/ir_module_reference_graph.rml" string="Technical guide"/>
<report id="report_proximity_graph" model="ir.module.module" name="proximity.graph" string="Proximity grpah"/>
<report id="report_proximity_graph" model="ir.module.module" name="proximity.graph" string="Proximity graph"/>
</data>
</openerp>

View File

@ -51,7 +51,7 @@ to set up a management by affair.
],
'demo_xml': ['hr_timesheet_demo.xml'],
'test': ['test/test_hr_timesheet.yml',
'test/hr_timesheet_invoice_report.yml',
'test/hr_timesheet_report.yml',
],
'installable': True,
'active': False,

View File

@ -1,31 +1,23 @@
-
In order to test the PDF reports defined on a HR Timesheet User Report, we will print a HR Timesheet User Report
In order to test the PDF reports defined on HR Timesheet User Report, we will print a HR Timesheet User Report
-
!python {model: hr.employee}: |
import netsvc, tools, os, time
import datetime
from mx.DateTime import *
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = DateTime(int(start.year), int(start.month), int(start.day))
month=start.month
year=start.year
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_id' : ref('base.user_root') }}
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {'periods': []})
month = time.gmtime()[1]
year = time.gmtime()[0]
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_id' : uid }}
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a HR Timesheet Users Report, we will print a HR Timesheet Users Report
In order to test the PDF reports defined on HR Timesheet Users Report, we will print a HR Timesheet Users Report
-
!python {model: hr.employee}: |
import netsvc, tools, os, time
import datetime
from mx.DateTime import *
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = DateTime(int(start.year), int(start.month), int(start.day))
month=start.month
year=start.year
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_ids' : [ref('base.user_root')] }}
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {'periods': []})
month = time.gmtime()[1]
year = time.gmtime()[0]
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_ids' : [uid] }}
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)

View File

@ -47,7 +47,7 @@ reports, eso.""",
],
'demo_xml': ['hr_timesheet_invoice_demo.xml',
],
'test': ['test/test_hr_timesheet_invoice.yml'
'test': ['test/test_hr_timesheet_invoice.yml',
'test/hr_timesheet_invoice_report.yml',
],
'installable': True,

View File

@ -1,23 +1,20 @@
-
In order to test the PDF reports defined on a HR Timesheet Account Analytic Profit, we will print a HR Timesheet Account Analytic Profit
In order to test the PDF reports defined on HR Timesheet Account Analytic Profit, we will print report of HR Timesheet Account Analytic Profit
-
!python {model: account.analytic.line}: |
import netsvc, tools, os, time
data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': '2010-09-01', 'employee_ids': [[6, 0, [1, ref('hr.employee2')]]], 'journal_ids': [[6, 0, [1, 2, 3, 4]]], 'date_to': '2010-09-16'}}
(data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {'periods': []})
data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'employee_ids': [[6,0,[ref('hr.employee1'), ref('hr.employee2'),ref('hr.employee3')]]], 'journal_ids': [[6,0,[ref('account.cose_journal_sale'),ref('account.exp'),ref('account.sit')]]], 'date_to': time.strftime('%Y-%m-%d')}}
(data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-account_analytic_profit_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a HR Cost Ledger, we will print a HR Cost Ledger
In order to test the PDF reports defined on HR Cost Ledger, we will print report of HR Cost Ledger
-
!python {model: account.analytic.account}: |
import netsvc, tools, os, time
import datetime
from mx.DateTime import *
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = DateTime(int(start.year), int(start.month), int(start.day))
data_dict = {'model': 'ir.ui.menu', 'form': {'date1': start.strftime('%Y-%m-%d'), 'date2': start.strftime('%Y-%m-%d')}}
(data, format) = netsvc.LocalService('report.hr.timesheet.invoice.account.analytic.account.cost_ledger').create(cr, uid, [], data_dict, {'periods': []})
acc_ids = [ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_sednacom'),ref('account.analytic_thymbra'),ref('account.analytic_partners_camp_to_camp')]
data_dict = {'model': 'ir.ui.menu', 'form': {'date1': time.strftime('%Y-01-01'), 'date2': time.strftime('%Y-%m-%d')}}
(data, format) = netsvc.LocalService('report.hr.timesheet.invoice.account.analytic.account.cost_ledger').create(cr, uid, acc_ids, data_dict, {'active_ids': acc_ids})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-cost_ledger_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-cost_ledger_report.'+format), 'wb+').write(data)

View File

@ -1,17 +1,17 @@
-
In order to test the PDF reports defined on a l10n_ch, we will print a bvr_report
In order to test the PDF reports defined on a l10n_ch, we will print BVR Report
-
!python {model: account.invoice}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.l10n_ch.bvr').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_order.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a l10n_ch, we will print a bvr_invoice_report
In order to test the PDF reports defined on a l10n_ch, we will print a BVR Invoice Report
-
!python {model: account.invoice}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.l10n_ch.invoice.bvr').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_invoice.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_invoice_report.'+format), 'wb+').write(data)

View File

@ -1,26 +1,26 @@
-
In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear "Fiscal Year 2011" to which the entries will move
-
!record {model: account.fiscalyear, id: account_fiscalyear_0}:
!record {model: account.fiscalyear, id: account_fiscalyear_01}:
code: FY2011
company_id: base.main_company
date_start: '2011-01-01'
date_stop: '2011-12-31'
name: Fiscal Year 2011
date_start: '2012-01-01'
date_stop: '2012-12-31'
name: Fiscal Year 2012
-
In order to test the PDF reports defined on a l10n_fr, we will print a account move line for l10n_fr
In order to test the PDF reports defined on a l10n_fr, we will print an Account Move Line Report for l10n_fr
-
!python {model: account.move.line}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.l10n.fr.bilan').create(cr, uid, [], {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account_fiscalyear_0')}}, {})
(data, format) = netsvc.LocalService('report.l10n.fr.bilan').create(cr, uid, [], {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account_fiscalyear_01')}}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-bilan.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-bilan_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a l10n_fr, we will print a compute result for l10n_fr
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
(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.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-compute_resultant_report.'+format), 'wb+').write(data)

View File

@ -5,10 +5,10 @@
name: a
-
In order to test the PDF reports defined on a l10u_lu, we will print a vat
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
(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.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'l10n_lu-vat_report.'+format), 'wb+').write(data)

View File

@ -1,8 +1,8 @@
-
In order to test the PDF reports defined on a lunch, we will print a lunch order
In order to test the PDF reports defined on a Lunch, we will print a Lunch Order Report
-
!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)
file(os.path.join(tools.config['test_report_directory'], 'lunch-lunch_order_report.'+format), 'wb+').write(data)

View File

@ -1,35 +1,35 @@
-
In order to test the PDF reports defined on a mrp, we will print a bom order
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_order.'+format), 'wb+').write(data)
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 an order
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.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'mrp-production_order_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a mrp product price, we will print a (mrp)Product Price order
In order to test the PDF reports defined on a MRP, we will print Product Price Report
-
!python {model: product.product}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.product.price').create(cr, uid, [1,2,3,5], {'model':'product.product', 'form':{'number': 1}}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'mrp_product-price_order.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'mrp-product_price_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a mrp workcenter, we will print a (mrp)workcenter
In order to test the PDF reports defined on a MRP, we will print Workcenter Load Report
-
!python {model: mrp.workcenter}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.mrp.workcenter.load').create(cr, uid, [ref('mrp_workcenter_0'),ref('mrp_workcenter_1')], {'model':'mrp.workcenter', 'form':{'time_unit': 'day', 'measure_unit': 'hours'}}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'mrp_workcenter.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'mrp-workcenter_load_report.'+format), 'wb+').write(data)

View File

@ -1,17 +1,17 @@
-
In order to test the PDF reports defined on a mrp operations, we will print a barcode
In order to test the PDF reports defined on a MRP Operations, we will print a Barcode Report
-
!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)
file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcode_report.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a mrp operations, we will print a workcenters
In order to test the PDF reports defined on a MRP Operations, we will print Workcenter's Barcode Report
-
!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)
file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-workcenter_barcode_report.'+format), 'wb+').write(data)

View File

@ -386,7 +386,7 @@
<blockTable colWidths="534.0" style="Table8">
<tr>
<td>
<para style="P3">[[ format(o.quotation_notes) or removeParentNode('blockTable') ]]</para>
<para style="P3">[[ format(o.quotation_notes or '') or removeParentNode('blockTable') ]]</para>
</td>
</tr>
</blockTable>

View File

@ -1,8 +1,8 @@
-
In order to test the PDF reports defined on a mrp-repair, we will print a order
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
(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)
file(os.path.join(tools.config['test_report_directory'], 'mrp_repair-order_report.'+format), 'wb+').write(data)

View File

@ -75,8 +75,7 @@ Main features :
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml',],
'test':['test/pos_test.yml',
'test/pos_report.yml',
'test/pos_details.yml',
'test/pos_payment_report_date.yml'],
],
'installable': True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -61,5 +61,14 @@
<field name="notice">Discount Applied</field>
</record>
<record id="account_bank_statement_st0" model="account.bank.statement">
<field name="name">St. 05/19</field>
<field name="balance_end_real">0.0</field>
<field name="date">2010-05-19</field>
<field name="journal_id" ref="account.bank_journal"/>
<field name="period_id" ref="account.period_5"/>
<field name="state">draft</field>
</record>
</data>
</openerp>

View File

@ -40,13 +40,13 @@ class pos_payment_report_user(report_sxw.rml_parse):
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state in ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date " \
"and po.user_id IN %s",(tuple(ids), )
self.cr.execute (sql)
"and po.user_id IN %s"
self.cr.execute (sql, (tuple(ids), ))
data=self.cr.dictfetchall()
return data
def __pos_payment_user__total__(self,form):
def __pos_payment_user__total__(self, form):
res=[]
ids = form['user_id'][0][-1]
ids = form['user_id']
self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \

View File

@ -42,7 +42,7 @@ class pos_user_product(report_sxw.rml_parse):
a_l=[]
for r in data:
a_l.append(r['id'])
if len(a):
if len(a_l):
sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id IN %s and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit""",(tuple(a_l),)
self.cr.execute(sql2)
data = self.cr.dictfetchall()

View File

@ -1,8 +0,0 @@
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Details report
-
!python {model: ir.ui.menu}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.pos.details').create(cr, uid, [], {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d') }}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale- pos details report'+format), 'wb+').write(data)

View File

@ -1,8 +0,0 @@
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Sales Lines report
-
!python {model: ir.ui.menu}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.pos.payment.report.date').create(cr, uid, [1], {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'), 'user_id': [ref('base.user_root')] }}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale- pos sales lines report'+format), 'wb+').write(data)

View File

@ -1,5 +1,5 @@
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Detail Summary report
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
@ -8,7 +8,7 @@
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-details_summary report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Invoice report
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
@ -17,7 +17,7 @@
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Lines report
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
@ -26,7 +26,7 @@
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-lines report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt report
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
@ -35,7 +35,7 @@
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt With Reimbursement report
In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt With Reimbursement Report
-
!python {model: pos.order}: |
import netsvc, tools, os
@ -44,10 +44,93 @@
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt with reimbursement report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a point of sale, we will print a POS Receipt Without Reimbursement report
In order to test the PDF reports defined on a point of sale, we will print a POS Receipt Without Reimbursement Report
-
!python {model: pos.order}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.pos.receipt.without.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt without reimbursement report'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt without reimbursement report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Payment Report Report
-
!python {model: ir.ui.menu}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.pos.payment.report.date').create(cr, uid, [1], {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'), 'user_id': [ref('base.user_root')] }}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale- pos sales lines report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Details Report
-
!python {model: ir.ui.menu}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.pos.details').create(cr, uid, [], {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d') }}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale- pos details report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a Account Statement Report
-
!python {model: account.bank.statement}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.account.statement').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-account_statement_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS User Product Report
-
!python {model: account.bank.statement}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.pos.user.product').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-user_product_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS All Close Cashbox Of the Day Report
-
!python {model: account.bank.statement}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.all.closed.cashbox.of.the.day').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-all_closed_cash_box_of_the_day_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Report
-
!python {model: pos.order}: |
import netsvc, tools, os, time
data_dict = {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'),'user_id':[ref('base.user_root')] }}
(data, format) = netsvc.LocalService('report.pos.sales.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Today Report
-
!python {model: pos.order}: |
import netsvc, tools, os, time
data_dict = {'model':'ir.ui.menu', 'form':{'user_id':[ref('base.user_root')] }}
(data, format) = netsvc.LocalService('report.pos.sales.user.today').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_today_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment Report
-
!python {model: pos.order}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.pos.payment.report').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment User Report
-
!python {model: pos.order}: |
import netsvc, tools, os, time
data_dict = {'model':'ir.ui.menu', 'form':{'user_id':[ref('base.user_root'),ref('base.user_demo')] }}
(data, format) = netsvc.LocalService('report.pos.payment.report.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_user_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Today's Sales of Current User Report
-
!python {model: pos.order}: |
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.pos.sales.user.today.current.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_today_current_user_report'+format), 'wb+').write(data)