diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index c432689de44..9bbddb1e050 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -134,6 +134,7 @@ module named account_voucher.
'test/account_use_model.yml',
'test/account_validate_account_move.yml',
'test/account_fiscalyear_close.yml',
+ 'test/account_report.yml',
],
'installable': True,
'active': False,
diff --git a/addons/account/account.py b/addons/account/account.py
index 375d1a046d2..28fff33a4bc 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -2680,6 +2680,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
vals_journal['type'] = 'sale'
vals_journal['code'] = _('SAJ')
vals_journal['sequence_id'] = seq_id_sale
+ vals_journal['company_id'] = company_id
if obj_multi.chart_template_id.property_account_receivable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id]
@@ -2693,6 +2694,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
vals_journal['code'] = _('EXJ')
vals_journal['sequence_id'] = seq_id_purchase
vals_journal['view_id'] = view_id
+ vals_journal['company_id'] = company_id
if obj_multi.chart_template_id.property_account_payable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_expense_categ.id]
@@ -2744,6 +2746,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
vals_journal['code']= _('BNK') + str(current_num)
vals_journal['sequence_id'] = seq_id
vals_journal['type'] = 'cash'
+ vals_journal['company_id'] = company_id
+
if line.currency_id:
vals_journal['view_id'] = view_id_cur
vals_journal['currency'] = line.currency_id.id
diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py
index c87b3bf2f80..2fd80348404 100644
--- a/addons/account/account_cash_statement.py
+++ b/addons/account/account_cash_statement.py
@@ -270,7 +270,7 @@ class account_cash_statement(osv.osv):
super(account_cash_statement, self).write(cr, uid, [rs], res.get(rs))
return True
- def onchange_journal_id(self, cr, uid, statement_id, journal_id, context={}):
+ def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None):
""" Changes balance start and starting details if journal_id changes"
@param statement_id: Changed statement_id
@param journal_id: Changed journal_id
@@ -288,7 +288,7 @@ class account_cash_statement(osv.osv):
'balance_start': balance_start
})
return res
- res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context)
+ res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context)
return res
def _equal_balance(self, cr, uid, ids, statement, context={}):
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 559070450c9..14081cb6a45 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -452,7 +452,7 @@ class account_invoice(osv.osv):
_('Can not select currency that is not related to current company.\nPlease select accordingly !.'))
return {}
- def onchange_journal_id(self, cr, uid, ids, journal_id):
+ def onchange_journal_id(self, cr, uid, ids, journal_id=False):
result = {}
if journal_id:
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
diff --git a/addons/account/report/account_balance_sheet.py b/addons/account/report/account_balance_sheet.py
index 49606dc2c6b..9b816b2ab5a 100644
--- a/addons/account/report/account_balance_sheet.py
+++ b/addons/account/report/account_balance_sheet.py
@@ -78,7 +78,7 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
db_pool = pooler.get_pool(self.cr.dbname)
#Getting Profit or Loss Balance from profit and Loss report
- result_pl=self.obj_pl.get_data(data)
+ result_pl = self.obj_pl.get_data(data)
self.res_bl = self.obj_pl.final_result()
type_pool = db_pool.get('account.account.type')
diff --git a/addons/account/report/account_general_journal.py b/addons/account/report/account_general_journal.py
index 8cd3dad05ba..684a75b1f20 100644
--- a/addons/account/report/account_general_journal.py
+++ b/addons/account/report/account_general_journal.py
@@ -86,7 +86,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
'FROM account_move_line l '
'LEFT JOIN account_journal j ON (l.journal_id=j.id) '
'LEFT JOIN res_currency c on (l.currency_id=c.id)'
- 'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + ''
+ 'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + ' '
'GROUP BY j.id, j.code, j.name, l.amount_currency,c.code, l.currency_id ',
(period_id, tuple(self.journal_ids)))
return self.cr.dictfetchall()
diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py
index e49c47034fb..f313704bc8a 100644
--- a/addons/account/report/account_general_ledger.py
+++ b/addons/account/report/account_general_ledger.py
@@ -43,6 +43,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
self.init_query = data['form']['initial_bal_query']
self.init_balance = data['form']['initial_balance']
self.display_account = data['form']['display_account']
+ self.target_move = data['form'].get('target_move', 'all')
if (data['model'] == 'ir.ui.menu'):
new_ids = [data['form']['chart_account_id']]
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
@@ -78,14 +79,14 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
self.context = context
def _sum_currency_amount_account(self, account):
- self.cr.execute("SELECT sum(l.amount_currency) AS tot_currency "\
- "FROM account_move_line l "\
- "WHERE l.account_id = %s AND %s" %(account.id, self.query))
+ self.cr.execute('SELECT sum(l.amount_currency) AS tot_currency \
+ FROM account_move_line l \
+ WHERE l.account_id = %s AND %s' %(account.id, self.query))
sum_currency = self.cr.fetchone()[0] or 0.0
if self.init_balance:
- self.cr.execute("SELECT sum(l.amount_currency) AS tot_currency "\
- "FROM account_move_line l "\
- "WHERE l.account_id = %s AND %s "%(account.id, self.init_query))
+ self.cr.execute('SELECT sum(l.amount_currency) AS tot_currency \
+ FROM account_move_line l \
+ WHERE l.account_id = %s AND %s '%(account.id, self.init_query))
sum_currency += self.cr.fetchone()[0] or 0.0
return str(sum_currency)
@@ -117,13 +118,23 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
def lines(self, account):
""" Return all the account_move_line of account with their account code counterparts """
+ move_state = ['draft','posted']
+ if self.target_move == 'posted':
+ move_state = ['posted', '']
# First compute all counterpart strings for every move_id where this account appear.
# Currently, the counterpart info is used only in landscape mode
sql = """
SELECT m1.move_id,
- array_to_string(ARRAY(SELECT DISTINCT a.code FROM account_move_line m2 LEFT JOIN account_account a ON (m2.account_id=a.id) WHERE m2.move_id = m1.move_id AND m2.account_id<>%%s), ', ') AS counterpart
- FROM (SELECT move_id FROM account_move_line l WHERE %s AND l.account_id = %%s GROUP BY move_id) m1
- """ % self.query
+ array_to_string(ARRAY(SELECT DISTINCT a.code
+ FROM account_move_line m2
+ LEFT JOIN account_account a ON (m2.account_id=a.id)
+ WHERE m2.move_id = m1.move_id
+ AND m2.account_id<>%%s), ', ') AS counterpart
+ FROM (SELECT move_id
+ FROM account_move_line l
+ LEFT JOIN account_move am ON (am.id = l.move_id)
+ WHERE am.state IN %s and %s AND l.account_id = %%s GROUP BY move_id) m1
+ """% (tuple(move_state), self.query)
self.cr.execute(sql, (account.id, account.id))
counterpart_res = self.cr.dictfetchall()
counterpart_accounts = {}
@@ -143,13 +154,13 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
i.id AS invoice_id, i.type AS invoice_type, i.number AS invoice_number,
p.name AS partner_name
FROM account_move_line l
- LEFT JOIN account_move m on (l.move_id=m.id)
+ JOIN account_move m on (l.move_id=m.id)
LEFT JOIN res_currency c on (l.currency_id=c.id)
LEFT JOIN res_partner p on (l.partner_id=p.id)
LEFT JOIN account_invoice i on (m.id =i.move_id)
JOIN account_journal j on (l.journal_id=j.id)
- WHERE %s AND l.account_id = %%s ORDER by %s
- """ % (self.query, sql_sort)
+ WHERE %s AND m.state IN %s AND l.account_id = %%s ORDER by %s
+ """ %(self.query, tuple(move_state), sql_sort)
self.cr.execute(sql, (account.id,))
res_lines = self.cr.dictfetchall()
res_init = []
@@ -167,8 +178,8 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
LEFT JOIN res_partner p on (l.partner_id=p.id)
LEFT JOIN account_invoice i on (m.id =i.move_id)
JOIN account_journal j on (l.journal_id=j.id)
- WHERE %s AND l.account_id = %%s
- """ %(self.init_query)
+ WHERE %s AND m.state IN %s AND l.account_id = %%s
+ """ %(self.init_query, tuple(move_state))
self.cr.execute(sql, (account.id,))
res_init = self.cr.dictfetchall()
@@ -192,40 +203,73 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
return res
def _sum_debit_account(self, account):
- self.cr.execute("SELECT sum(debit) "\
- "FROM account_move_line l "\
- "WHERE l.account_id = %s AND %s "%(account.id, self.query))
+ move_state = ['draft','posted']
+ if self.target_move == 'posted':
+ move_state = ['posted','']
+ self.cr.execute('SELECT sum(debit) \
+ FROM account_move_line l \
+ JOIN account_move am ON (am.id = l.move_id) \
+ WHERE (l.account_id = %s) \
+ AND (am.state IN %s) \
+ AND '+ self.query +' '
+ ,(account.id, tuple(move_state)))
sum_debit = self.cr.fetchone()[0] or 0.0
if self.init_balance:
- self.cr.execute("SELECT sum(debit) "\
- "FROM account_move_line l "\
- "WHERE l.account_id = %s AND %s "%(account.id, self.init_query))
+ self.cr.execute('SELECT sum(debit) \
+ FROM account_move_line l \
+ JOIN account_move am ON (am.id = l.move_id) \
+ WHERE (l.account_id = %s) \
+ AND (am.state IN %s) \
+ AND '+ self.init_query +' '
+ ,(account.id, tuple(move_state)))
# Add initial balance to the result
sum_debit += self.cr.fetchone()[0] or 0.0
return sum_debit
def _sum_credit_account(self, account):
- self.cr.execute("SELECT sum(credit) "\
- "FROM account_move_line l "\
- "WHERE l.account_id = %s AND %s "%(account.id, self.query))
+ move_state = ['draft','posted']
+ if self.target_move == 'posted':
+ move_state = ['posted','']
+ self.cr.execute('SELECT sum(credit) \
+ FROM account_move_line l \
+ JOIN account_move am ON (am.id = l.move_id) \
+ WHERE (l.account_id = %s) \
+ AND (am.state IN %s) \
+ AND '+ self.query +' '
+ ,(account.id, tuple(move_state)))
sum_credit = self.cr.fetchone()[0] or 0.0
if self.init_balance:
- self.cr.execute("SELECT sum(credit) "\
- "FROM account_move_line l "\
- "WHERE l.account_id = %s AND %s "%(account.id, self.init_query))
+ self.cr.execute('SELECT sum(credit) \
+ FROM account_move_line l \
+ JOIN account_move am ON (am.id = l.move_id) \
+ WHERE (l.account_id = %s) \
+ AND (am.state IN %s) \
+ AND '+ self.init_query +' '
+ ,(account.id, tuple(move_state)))
# Add initial balance to the result
sum_credit += self.cr.fetchone()[0] or 0.0
return sum_credit
def _sum_balance_account(self, account):
- self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_balance "\
- "FROM account_move_line l "\
- "WHERE l.account_id = %s AND %s"%(account.id, self.query))
+ move_state = ['draft','posted']
+ if self.target_move == 'posted':
+ move_state = ['posted','']
+ self.cr.execute('SELECT (sum(debit) - sum(credit)) as tot_balance \
+ FROM account_move_line l \
+ JOIN account_move am ON (am.id = l.move_id) \
+ WHERE (l.account_id = %s) \
+ AND (am.state IN %s) \
+ AND '+ self.query +' '
+ ,(account.id, tuple(move_state)))
sum_balance = self.cr.fetchone()[0] or 0.0
if self.init_balance:
- self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_balance "\
- "FROM account_move_line l "\
- "WHERE l.account_id = %s AND %s "%(account.id, self.init_query))
+ self.cr.execute('SELECT (sum(debit) - sum(credit)) as tot_balance \
+ FROM account_move_line l \
+ JOIN account_move am ON (am.id = l.move_id) \
+ WHERE (l.account_id = %s) \
+ AND (am.state IN %s) \
+ AND '+ self.init_query +' '
+ ,(account.id, tuple(move_state)))
# Add initial balance to the result
sum_balance += self.cr.fetchone()[0] or 0.0
return sum_balance
diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py
index 15607a79011..a89335f99c5 100644
--- a/addons/account/report/tax_report.py
+++ b/addons/account/report/tax_report.py
@@ -212,10 +212,8 @@ class tax_report(rml_parse.rml_parse):
result_accounts.append(account_elem)
ind+=1
-
return result_accounts
-
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
'addons/account/report/tax_report.rml', parser=tax_report, header="internal")
diff --git a/addons/account/report/voucher_print.rml b/addons/account/report/voucher_print.rml
index abfa714aa43..b1d7941068c 100644
--- a/addons/account/report/voucher_print.rml
+++ b/addons/account/report/voucher_print.rml
@@ -325,7 +325,7 @@
|
- [[ voucher.line_id and voucher.line_id.name and voucher.line_id.name[1] or removeParentNode('para') ]]
+ [[ voucher.line_id and voucher.line_id[0].name or removeParentNode('para') ]]
|
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
new file mode 100644
index 00000000000..44899ec1d8d
--- /dev/null
+++ b/addons/account/test/account_report.yml
@@ -0,0 +1,385 @@
+-
+ In order to test the PDF reports defined on an invoice, we will print an invoice
+-
+ !python {model: account.invoice}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
+
+-
+ 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
+ (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data)
+
+-
+ In order to test the PDF reports defined on Account Move, we will print the Voucher Report
+-
+ !python {model: account.move}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.account.move.voucher').create(cr, uid, [ref('account.account_move_0')], {}, {})
+ 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)
+
+#-
+# 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
+-
+ !python {model: account.invoice}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
+
+-
+ Print the Aged Partner Balance Report
+-
+ !python {model: res.partner}: |
+ 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))
+ res = {}
+ for i in range(5)[::-1]:
+ stop = start - RelativeDateTime(days=30)
+ res[str(i)] = {
+ 'name': (i!=0 and (str((5-(i+1)) * 30) + '-' + str((5-i) * 30)) or ('+'+str(4 * 30))),
+ 'stop': start.strftime('%Y-%m-%d'),
+ 'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
+ }
+ start = stop - RelativeDateTime(days=1)
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+
+ data_dict = {'model': 'ir.ui.menu', 'form': {'chart_account_id':ref('account.chart0'),'initial_balance': 1, 'periods': period_list,'journal_ids':journal_ids, 'page_split': 0, 'date_from': time.strftime('%Y-%m-%d'), 'period_length': 30, 'amount_currency': 0,'query_line' : query_line, 'result_selection': 'customer','direction_selection': 'past','fiscalyear_id':fy_id}}
+ data_dict['form'].update(res)
+ (data, format) = netsvc.LocalService('report.account.aged_trial_balance').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-aged_partner_balance.'+format), 'wb+').write(data)
+
+-
+ Print the Compare Account Balance Report in Normal mode
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}}
+ (data, format) = netsvc.LocalService('report.account.balance.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance.'+format), 'wb+').write(data)
+
+-
+ Print the Compare Account Balance Report in Landscape mode
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':1,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}}
+ (data, format) = netsvc.LocalService('report.account.account.balance.landscape').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance-landscape.'+format), 'wb+').write(data)
+
+
+-
+ Print the Account Balance Sheet in Horizontal mode
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'ir.ui.menu', 'form': {'reserve_account_id':ref('account.rsa') ,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 1,'journal_ids':[],'fiscalyear': ref('account.data_fiscalyear') ,'target_move': 'all'}}
+ (data, format) = netsvc.LocalService('report.account.balancesheet.horizontal').create(cr, uid, [], data_dict, {'periods': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-account_balance_sheet_horizontal.'+format), 'wb+').write(data)
+
+-
+ Print the Account Balance Sheet in Normal mode
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'ir.ui.menu', 'form': {'reserve_account_id':ref('account.rsa') ,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':[],'fiscalyear': ref('account.data_fiscalyear') ,'target_move': 'all'}}
+ (data, format) = netsvc.LocalService('report.account.balancesheet').create(cr, uid, [], data_dict, {'periods': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-account_balance_sheet.'+format), 'wb+').write(data)
+
+-
+ Print the Account Balance Report in Normal mode - From Account Chart
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'account.account', 'form': {'chart_account_id':ref('account.chart0'),'select_account': False,'display_account':'bal_all','format_perc':0,'filter': 'filter_no','show_columns' :0, 'account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': ref('account.data_fiscalyear') ,'target_move': 'all','periods': [],'id':ref('account.bal'),'context':{'state':'all'}}}
+ (data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal.'+format), 'wb+').write(data)
+ print "Account Balance Report in Normal mode - From Menu"
+
+ data_dict.update({'model': 'ir.ui.menu'})
+ data_dict['form'].update({'active_ids':[ref('account.bal'),ref('account.gpf')]})
+
+ (data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [], data_dict, {'periods': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal-menu.'+format), 'wb+').write(data)
+
+-
+ Print the Central Journal Report - From Account
+-
+ !python {model: account.journal.period}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+ journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
+
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+ data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
+ (data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, journal_period_ids, data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-central_journal.'+format), 'wb+').write(data)
+
+ print "Central Journal Report - From Menu"
+ data_dict.update({'model': 'ir.ui.menu'})
+ data_dict['form'].update({'active_ids':journal_period_ids})
+
+ (data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-central_journal-menu.'+format), 'wb+').write(data)
+-
+ Print the General Journal Report - From Journal
+-
+ !python {model: account.journal.period}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+ journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
+
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+ data_dict = {'model': 'ir.ui.menu','id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids, 'active_ids':journal_period_ids}}
+ (data, format) = netsvc.LocalService('report.account.general.journal').create(cr, uid, journal_period_ids, data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-general_journal.'+format), 'wb+').write(data)
+
+-
+ Print the General Ledger Report in Normal Mode
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+ acc_ids = [ref('account.bal'),ref('account.gpf')]
+
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+
+ data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query': query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
+ (data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, acc_ids, data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger.'+format), 'wb+').write(data)
+
+ print "GL report from menu"
+ data_dict.update({'model': 'ir.ui.menu'})
+ data_dict['form'].update({'active_ids': acc_ids})
+ (data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-menu.'+format), 'wb+').write(data)
+-
+ Print the General Ledger Report in Landscape Mode
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+ acc_ids = [ref('account.bal'),ref('account.gpf')]
+
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+
+ data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query':query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':1,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
+ (data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, acc_ids, data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-landscape.'+format), 'wb+').write(data)
+
+ print "GL report landscape mode from menu"
+ data_dict.update({'model': 'ir.ui.menu'})
+ data_dict['form'].update({'active_ids': acc_ids})
+ (data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-landscape-menu.'+format), 'wb+').write(data)
+
+-
+ Print Journal Report - From Model
+-
+ !python {model: account.journal.period}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+ journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
+
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+
+ data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'sort_selection': 'date','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
+ (data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, journal_period_ids, data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-print_journal.'+format), 'wb+').write(data)
+
+ print "Journal Report - From Menu"
+ data_dict.update({'model': 'ir.ui.menu'})
+ data_dict['form'].update({'active_ids':journal_period_ids})
+
+ (data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-print_journal-menu.'+format), 'wb+').write(data)
+
+-
+ Print the Partner Balance Report
+-
+ !python {model: res.partner}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+ data_dict = {'model': 'ir.ui.menu', 'form': {'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
+ (data, format) = netsvc.LocalService('report.account.partner.balance').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-partner_balance.'+format), 'wb+').write(data)
+
+-
+ Print the Partner Ledger Report
+-
+ !python {model: res.partner}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+
+ data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': True,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
+ (data, format) = netsvc.LocalService('report.account.third_party_ledger').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-partner_ledger.'+format), 'wb+').write(data)
+
+-
+ Print the Partner Ledger-Other Report
+-
+ !python {model: res.partner}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+
+ obj_move = self.pool.get('account.move.line')
+ ctx = {}
+ ctx['fiscalyear'] = fy_id
+ ctx['journal_ids'] = journal_ids
+ ctx['chart_account_id'] = ref('account.chart0')
+
+ query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
+ data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': False,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
+ (data, format) = netsvc.LocalService('report.account.third_party_ledger_other').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-partner_ledger-other.'+format), 'wb+').write(data)
+
+-
+ Print the Profit-Loss Report in Normal Mode
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = []
+ acc_ids = [ref('account.bal'),ref('account.gpf')]
+ data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': False,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }}
+ (data, format) = netsvc.LocalService('report.pl.account').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss.'+format), 'wb+').write(data)
+
+-
+ Print the Profit-Loss Report in Horizontal Mode
+-
+ !python {model: account.account}: |
+ import netsvc, tools, os, time
+ fy_id = ref('account.data_fiscalyear')
+ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
+ journal_ids = []
+ acc_ids = [ref('account.bal'),ref('account.gpf')]
+ data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': True,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }}
+ (data, format) = netsvc.LocalService('report.pl.account.horizontal').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss-horizontal.'+format), 'wb+').write(data)
diff --git a/addons/account/wizard/account_chart.py b/addons/account/wizard/account_chart.py
index 84683d17b30..bf10838b9c8 100644
--- a/addons/account/wizard/account_chart.py
+++ b/addons/account/wizard/account_chart.py
@@ -54,14 +54,14 @@ class account_chart(osv.osv_memory):
def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None):
res = {}
- res['value'] = {'period_from': False, 'period_to': False}
+ res['value'] = {}
if fiscalyear_id:
start_period = end_period = False
cr.execute('''
- SELECT * FROM (SELECT p.id
- FROM account_period p
- LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
- WHERE f.id = %s
+ SELECT * FROM (SELECT p.id
+ FROM account_period p
+ LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
+ WHERE f.id = %s
ORDER BY p.date_start ASC
LIMIT 1) AS period_start
UNION
diff --git a/addons/account/wizard/account_chart_view.xml b/addons/account/wizard/account_chart_view.xml
index eb662058f32..f35a2c5480c 100644
--- a/addons/account/wizard/account_chart_view.xml
+++ b/addons/account/wizard/account_chart_view.xml
@@ -9,11 +9,11 @@
|
- Note: [[ (a['note'] and format(a['note'])) or removeParentNode('tr') ]]
+ Note: [[ (a['note'] and format(a['note'] or '')) or removeParentNode('tr') ]]
@@ -337,7 +337,7 @@
|
- [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]]
+ [[ a['type']=='text' and format(a['name'] or '') or removeParentNode('blockTable') ]]
|
[[ a['type']=='text' and '' ]]
@@ -467,7 +467,7 @@
|
- [[ format(o.comment or removeParentNode('blockTable')) ]]
+ [[ format(o.comment or '') or removeParentNode('blockTable') ]]
|
@@ -477,7 +477,7 @@
|
- [[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]]
+ [[ format((o.payment_term and o.payment_term.note or '') or removeParentNode('blockTable')) ]]
|
diff --git a/addons/account_invoice_layout/test/account_invoice_layout_report.yml b/addons/account_invoice_layout/test/account_invoice_layout_report.yml
new file mode 100644
index 00000000000..b7b1c1e76cc
--- /dev/null
+++ b/addons/account_invoice_layout/test/account_invoice_layout_report.yml
@@ -0,0 +1,17 @@
+-
+ Print the Invoice layout report in Normal Mode
+-
+ !python {model: account.invoice}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.account.invoice.layout').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout.'+format), 'wb+').write(data)
+-
+ Print the Invoice Layout Report with Message in Normal mode
+-
+ !python {model: account.invoice}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'account.invoice', 'form': {'message':ref('account_invoice_layout.demo_message1'),'id':ref('account.test_invoice_1'),'context':{}}}
+ (data, format) = netsvc.LocalService('report.notify_account.invoice').create(cr, uid, [ref('account.test_invoice_1')], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout_message_report.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py
index f3e437face2..5114a576512 100644
--- a/addons/account_payment/__openerp__.py
+++ b/addons/account_payment/__openerp__.py
@@ -47,8 +47,11 @@
'account_invoice_view.xml',
'account_payment_report.xml',
],
- 'demo_xml': [],
- 'test': ['test/account_payment.yml'],
+ 'demo_xml': ['account_payment_demo.xml'],
+ 'test': [
+ 'test/account_payment.yml'
+ 'test/account_payment_report.yml'
+ ],
'installable': True,
'active': False,
'certificate': '0061703998541',
diff --git a/addons/account_payment/account_payment_demo.xml b/addons/account_payment/account_payment_demo.xml
new file mode 100644
index 00000000000..25fe4a2c55b
--- /dev/null
+++ b/addons/account_payment/account_payment_demo.xml
@@ -0,0 +1,24 @@
+
+
+
+
+ Reserve Bank
+ 00987654321
+
+
+
+
+ Direct Payment
+
+
+
+
+
+ ORDER1
+
+
+ now
+ draft
+
+
+
diff --git a/addons/account_payment/test/account_payment_report.yml b/addons/account_payment/test/account_payment_report.yml
new file mode 100644
index 00000000000..45022e19a73
--- /dev/null
+++ b/addons/account_payment/test/account_payment_report.yml
@@ -0,0 +1,8 @@
+-
+ In order to test the PDF reports defined on Account Payment, Print a Payment Order
+-
+ !python {model: payment.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.payment.order').create(cr, uid, [ref('account_payment.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)
\ No newline at end of file
diff --git a/addons/account_report/__openerp__.py b/addons/account_report/__openerp__.py
index 07afc6ed58f..b8029bf3563 100644
--- a/addons/account_report/__openerp__.py
+++ b/addons/account_report/__openerp__.py
@@ -42,7 +42,8 @@
'wizard/account_report_print_indicators_with_pdf_view.xml',
'board_account_report_view.xml',
],
- 'demo_xml': [],
+ 'demo_xml': ['account_report_demo.xml'],
+ 'test': ['test/account_report.yml'],
'installable': True,
'active': False,
'certificate': '0050976406925',
diff --git a/addons/account_report/account_report_demo.xml b/addons/account_report/account_report_demo.xml
new file mode 100644
index 00000000000..30f1318c592
--- /dev/null
+++ b/addons/account_report/account_report_demo.xml
@@ -0,0 +1,11 @@
+
+
+
+
+ Account Demo Report
+ ADR
+ fiscal
+ debit>0.0
+
+
+
\ No newline at end of file
diff --git a/addons/account_report/report/print_indicator.rml b/addons/account_report/report/print_indicator.rml
index 52133cb894e..160cd435ada 100644
--- a/addons/account_report/report/print_indicator.rml
+++ b/addons/account_report/report/print_indicator.rml
@@ -119,7 +119,7 @@
- | [['..........'*(o['level']) ]] [[ format(o['note']) or removeParentNode('blockTable') ]] |
+ [['..........'*(o['level']) ]] [[ format(o['note'] or '') or removeParentNode('blockTable') ]] |
diff --git a/addons/account_report/test/account_report_report.yml b/addons/account_report/test/account_report_report.yml
new file mode 100644
index 00000000000..d94dce1f553
--- /dev/null
+++ b/addons/account_report/test/account_report_report.yml
@@ -0,0 +1,17 @@
+-
+ In order to test the PDF reports defined on Account, Print a Financial Statement Report
+-
+ !python {model: account.report.report}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.accounting.report').create(cr, uid, [ref('account_report.account_report_1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account_report-financial_statement_report.'+format), 'wb+').write(data)
+-
+ Print the Indicators Report in Normal mode
+-
+ !python {model: account.report.history }: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'ir.ui.menu', 'form': {'select_base':'year','base_selection':[ref('account.data_fiscalyear')],'context':{}}}
+ (data, format) = netsvc.LocalService('report.print.indicators').create(cr, uid, [], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account_report-indicators_report.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/account_reporting/__openerp__.py b/addons/account_reporting/__openerp__.py
index 5ac93d17984..fb05e755ac2 100644
--- a/addons/account_reporting/__openerp__.py
+++ b/addons/account_reporting/__openerp__.py
@@ -36,7 +36,8 @@
'account_data.xml',
'wizard/account_reporting_balance_report_view.xml',
],
- 'demo_xml': [],
+ 'demo_xml': ['account_reporting_demo.xml'],
+ 'test': ['test/account_reporting_report.yml'],
'installable': True,
'active': False,
'certificate': '0072305016797',
diff --git a/addons/account_reporting/account_reporting_demo.xml b/addons/account_reporting/account_reporting_demo.xml
new file mode 100644
index 00000000000..880fa51deda
--- /dev/null
+++ b/addons/account_reporting/account_reporting_demo.xml
@@ -0,0 +1,9 @@
+
+
+
+
+ My Balance Sheet
+ MBS
+
+
+
\ No newline at end of file
diff --git a/addons/account_reporting/test/account_reporting_report.yml b/addons/account_reporting/test/account_reporting_report.yml
new file mode 100644
index 00000000000..9754f53cc4d
--- /dev/null
+++ b/addons/account_reporting/test/account_reporting_report.yml
@@ -0,0 +1,9 @@
+-
+ Print the Balance Sheet Report in Normal mode
+-
+ !python {model: account.report.bs }: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'account.report.bs', 'form': {'fiscalyear':ref('account.data_fiscalyear'),'periods':[ref('account.period_1'),ref('account.period_2'),ref('account.period_3')],'context':{}}}
+ (data, format) = netsvc.LocalService('report.account.report.bs').create(cr, uid, [ref('account_reporting.account_balance_sheet_1')], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account_reporting-balance_sheet_report.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/auction/__openerp__.py b/addons/auction/__openerp__.py
index 69fef0748c4..7105102b385 100644
--- a/addons/auction/__openerp__.py
+++ b/addons/auction/__openerp__.py
@@ -59,7 +59,9 @@
],
'demo_xml': ['auction_demo.xml','board_auction_demo.xml'],
- 'test': ['test/auction.yml'],
+ 'test': ['test/auction.yml',
+ 'test/auction_report.yml',
+ ],
'installable': True,
'active': False,
diff --git a/addons/auction/test/auction_report.yml b/addons/auction/test/auction_report.yml
new file mode 100644
index 00000000000..4d5110c03a1
--- /dev/null
+++ b/addons/auction/test/auction_report.yml
@@ -0,0 +1,92 @@
+-
+ In order to test the PDF reports defined on auction, we will print a auction artist
+-
+ !python {model: auction.lots}: |
+ 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)
+
+-
+ In order to test the PDF reports defined on auction, we will print a auction Bid
+-
+ !python {model: auction.bid}: |
+ 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)
+
+-
+ In order to test the PDF reports defined on auction, we will print a lots list Report
+-
+ !python {model: auction.lots}: |
+ 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)
+-
+ In order to test the PDF reports defined on auction, we will print a lots inventory Report
+-
+ !python {model: auction.lots}: |
+ 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)
+-
+ In order to test the PDF reports defined on auction, we will print a deposit seller Report
+-
+ !python {model: auction.lots}: |
+ 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)
+-
+ In order to test the PDF reports defined on auction, we will print a catalog
+-
+ !python {model: auction.dates}: |
+ 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)
+-
+ In order to test the PDF reports defined on auction, we will print buyer form report
+-
+ !python {model: auction.lots}: |
+ 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)
+-
+ In order to test the PDF reports defined on auction, we will print bids phones report
+-
+ !python {model: auction.lots}: |
+ 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)
+-
+ In order to test the PDF reports defined on a auction, we will print a Auction Total
+-
+ !python {model: auction.lots}: |
+ 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)
+
+-
+ In order to test the PDF reports defined on a auction, we will print a Auction Result
+-
+ !python {model: auction.lots}: |
+ 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)
+
+-
+ In order to test the PDF reports defined on a auction, we will print a Auction Lot
+-
+ !python {model: auction.lots}: |
+ 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)
\ No newline at end of file
diff --git a/addons/base_module_doc_rst/__terp__.py b/addons/base_module_doc_rst/__openerp__.py
similarity index 100%
rename from addons/base_module_doc_rst/__terp__.py
rename to addons/base_module_doc_rst/__openerp__.py
diff --git a/addons/delivery/__openerp__.py b/addons/delivery/__openerp__.py
index 193bd0bcaee..ad88d552e6b 100644
--- a/addons/delivery/__openerp__.py
+++ b/addons/delivery/__openerp__.py
@@ -40,7 +40,7 @@
'partner_view.xml'
],
'demo_xml': ['delivery_demo.xml'],
- 'test':['test/delivery_test.yml',],
+ 'test':['test/delivery_test.yml','test/delivery_report.yml'],
'installable': True,
'active': False,
'certificate': '0033981912253',
diff --git a/addons/delivery/test/delivery_report.yml b/addons/delivery/test/delivery_report.yml
new file mode 100644
index 00000000000..ed3a859f23d
--- /dev/null
+++ b/addons/delivery/test/delivery_report.yml
@@ -0,0 +1,8 @@
+-
+ In order to test the PDF reports defined on a Delievry, we will print a Delivery Order report
+-
+ !python {model: stock.picking}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.sale.shipping').create(cr, uid, [ref('stock.stock_picking_1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'delievry-shipping'+format), 'wb+').write(data)
diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py
index 5a79566bcde..3714050cbdb 100644
--- a/addons/hr_attendance/__openerp__.py
+++ b/addons/hr_attendance/__openerp__.py
@@ -43,7 +43,9 @@
'wizard/hr_attendance_sign_in_out_view.xml',
],
'demo_xml': ['hr_attendance_demo.xml'],
- 'test': ['test/test_hr_attendance.yml'],
+ 'test': ['test/test_hr_attendance.yml',
+ 'test/hr_attendance_report.yml'
+ ],
'installable': True,
'active': False,
'certificate': '0063495605613',
diff --git a/addons/hr_attendance/test/hr_attendance_report.yml b/addons/hr_attendance/test/hr_attendance_report.yml
new file mode 100644
index 00000000000..d26f6ddb9bc
--- /dev/null
+++ b/addons/hr_attendance/test/hr_attendance_report.yml
@@ -0,0 +1,19 @@
+-
+ In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance By Month
+-
+ !python {model: hr.employee}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'hr.employee', 'form': {'month': time.gmtime()[1], 'year': time.gmtime()[0]}}
+ (data, format) = netsvc.LocalService('report.hr.attendance.bymonth').create(cr, uid, [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-by_month_report.'+format), 'wb+').write(data)
+
+-
+ In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance Error
+-
+ !python {model: hr.employee}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'hr.employee', 'form': {'init_date': time.strftime('%Y-01-01'), 'end_date':time.strftime('%Y-%m-%d'), 'emp_ids': [ref('hr.employee1')], 'max_delay': 120}}
+ (data, format) = netsvc.LocalService('report.hr.attendance.error').create(cr, uid, [ref('hr.employee1')], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-error_report.'+format), 'wb+').write(data)
diff --git a/addons/hr_evaluation/__openerp__.py b/addons/hr_evaluation/__openerp__.py
index 9710a84b4d7..b28c6d4e913 100644
--- a/addons/hr_evaluation/__openerp__.py
+++ b/addons/hr_evaluation/__openerp__.py
@@ -40,6 +40,7 @@
],
"update_xml": [
"security/ir.model.access.csv",
+ "security/hr_evaluation_security.xml",
"wizard/hr_evaluation_mail_view.xml",
"hr_evaluation_view.xml",
"report/hr_evaluation_report_view.xml"
diff --git a/addons/hr_evaluation/security/hr_evaluation_security.xml b/addons/hr_evaluation/security/hr_evaluation_security.xml
new file mode 100644
index 00000000000..49b0e19177b
--- /dev/null
+++ b/addons/hr_evaluation/security/hr_evaluation_security.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_evaluation/security/ir.model.access.csv b/addons/hr_evaluation/security/ir.model.access.csv
index 4e37e74ca0f..181e412ce69 100644
--- a/addons/hr_evaluation/security/ir.model.access.csv
+++ b/addons/hr_evaluation/security/ir.model.access.csv
@@ -12,3 +12,20 @@
"access_hr_evaluation_plan_phase_system","hr_evaluation.plan.phase.system","model_hr_evaluation_plan_phase","base.group_system",1,1,1,1
"access_hr_evaluation_evaluation_system","hr_evaluation.evaluation.system","model_hr_evaluation_evaluation","base.group_system",1,0,0,0
"access_hr_evaluation_interview_system","hr.evaluation.interview.system","model_hr_evaluation_interview","base.group_system",1,0,0,0
+"access_survey_type_hr_manager","survey.type","survey.model_survey_type","base.group_hr_manager",1,1,1,1
+"access_survey_hr_manager","survey.hr.manager","survey.model_survey","base.group_hr_manager",1,1,1,1
+"access_survey_history_manager","survey.history","survey.model_survey_history","base.group_hr_manager",1,1,1,1
+"access_survey_page_hr_manager","survey.page","survey.model_survey_page","base.group_hr_manager",1,1,1,1
+"access_survey_question_hr_manager","survey.question","survey.model_survey_question","base.group_hr_manager",1,1,1,1
+"access_survey_question_column_heading_hr_manager","survey.question.column.heading","survey.model_survey_question_column_heading","base.group_hr_manager",1,1,1,1
+"access_survey_answer_hr_manager","survey.answer","survey.model_survey_answer","base.group_hr_manager",1,1,1,1
+"access_survey_response_hr_manager","survey.response","survey.model_survey_response","base.group_hr_manager",1,1,1,1
+"access_survey_response_line_hr_manager","survey.response.line","survey.model_survey_response_line","base.group_hr_manager",1,1,1,1
+"access_survey_tbl_column_heading_hr_manager","survey.tbl.column.heading","survey.model_survey_tbl_column_heading","base.group_hr_manager",1,1,1,1
+"access_survey_response_answer_hr_manager","survey.response.answer","survey.model_survey_response_answer","base.group_hr_manager",1,1,1,1
+"access_survey_request_hr_manager","survey.request","survey.model_survey_request","base.group_hr_manager",1,1,1,1
+"access_survey_hr_user","survey.hr.user","survey.model_survey","base.group_hr_user",1,1,1,0
+"access_survey_answer_hr_user","survey.answer.hr.user","survey.model_survey_answer","base.group_hr_user",1,1,1,0
+"access_survey_response_answer_hr_user","survey.response.answer.hr.user","survey.model_survey_response_answer","base.group_hr_user",1,1,1,0
+"access_survey_type_hr_user","survey.type.hr.user","survey.model_survey_type","base.group_hr_user",1,1,1,0
+"access_survey_question_hr_user","survey.question.hr.user","survey.model_survey_question","base.group_hr_user",1,1,1,0
\ No newline at end of file
diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py
index aa45f4aa888..fe06b0110c2 100644
--- a/addons/hr_expense/__openerp__.py
+++ b/addons/hr_expense/__openerp__.py
@@ -55,7 +55,9 @@
'demo_xml': [
'hr_expense_demo.xml',
],
- 'test': ['test/test_hr_expense.yml'],
+ 'test': ['test/test_hr_expense.yml',
+ 'test/hr_expense_report.yml',
+ ],
'installable': True,
'active': False,
'certificate': '0062479841789',
diff --git a/addons/hr_expense/test/hr_expense_report.yml b/addons/hr_expense/test/hr_expense_report.yml
new file mode 100644
index 00000000000..4c81ceb5976
--- /dev/null
+++ b/addons/hr_expense/test/hr_expense_report.yml
@@ -0,0 +1,8 @@
+-
+ In order to test the PDF reports defined on a HR Expense, we will print a HR Expense
+-
+ !python {model: hr.expense.expense}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.hr_expense_expense_septemberexpenses0'),ref('hr_expense.hr_expense_expense_septemberexpenses1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py
index 7d68b216494..e6d901ad02c 100644
--- a/addons/hr_holidays/__openerp__.py
+++ b/addons/hr_holidays/__openerp__.py
@@ -65,7 +65,9 @@
'board_hr_holidays_view.xml',
],
'demo_xml': ['hr_holidays_demo.xml',],
- 'test': ['test/test_hr_holiday.yml'],
+ 'test': ['test/test_hr_holiday.yml',
+ 'test/hr_holidays_report.yml',
+ ],
'installable': True,
'active': False,
'certificate': '0086579209325',
diff --git a/addons/hr_holidays/test/hr_holidays_report.yml b/addons/hr_holidays/test/hr_holidays_report.yml
new file mode 100644
index 00000000000..9faf7358b53
--- /dev/null
+++ b/addons/hr_holidays/test/hr_holidays_report.yml
@@ -0,0 +1,14 @@
+-
+ In order to test the PDF reports defined on a HR Holidays, we will print HR Holidays
+-
+ !python {model: hr.holidays}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated' }}
+ (data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-dept_summary_report.'+format), 'wb+').write(data)
+
+ data_dict = {'model': 'hr.employee', 'form': {'date_from': time.strftime('%Y-%m-01'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated','emp':[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')] }}
+ (data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-employee_summary_report.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/hr_payroll/__openerp__.py b/addons/hr_payroll/__openerp__.py
index b7886da2df0..ab814ed80c2 100644
--- a/addons/hr_payroll/__openerp__.py
+++ b/addons/hr_payroll/__openerp__.py
@@ -60,6 +60,7 @@
'test/payslip.yml',
'test/payment_advice.yml',
'test/payroll_register.yml',
+ 'test/hr_payroll_report.yml',
],
'demo_xml': [
'hr_payroll_demo.xml'
diff --git a/addons/hr_payroll/test/hr_payroll_report.yml b/addons/hr_payroll/test/hr_payroll_report.yml
new file mode 100644
index 00000000000..e2268db7697
--- /dev/null
+++ b/addons/hr_payroll/test/hr_payroll_report.yml
@@ -0,0 +1,36 @@
+-
+ In order to test the PDF reports defined on HR Employee Salary, we will print HR Employee Salary
+-
+ !python {model: hr.employee}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.salary.structure').create(cr, uid, [ref('hr_payroll.hr_employee_bonamy0')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-salary_report.'+format), 'wb+').write(data)
+
+-
+ In order to test the PDF reports defined on HR Payslip, we will print a HR Payslip
+-
+ !python {model: hr.payslip}: |
+ import netsvc, tools, os
+ (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)
+
+-
+ In order to test the PDF reports defined on HR Employee Salary Details, we will print HR Employee Salary Details
+-
+ !python {model: hr.payslip}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'employee_ids': [ref('hr.employee2')]}}
+ (data, format) = netsvc.LocalService('report.employees.salary').create(cr, uid, [], data_dict, {'periods': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_salary_detai_report.'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on HR Employee Salary Details, we will print HR Employee Salary Details
+-
+ !python {model: hr.payslip}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'salary_on': 'current_month', 'employee_ids': [ref('hr.employee2')]}}
+ (data, format) = netsvc.LocalService('report.year.salary').create(cr, uid, [], data_dict, {'periods': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_yearly_salary_detai_report.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
index a789206b518..edb00d1f727 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml
+++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
@@ -130,7 +130,7 @@
{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}
-
+
diff --git a/addons/hr_timesheet/__openerp__.py b/addons/hr_timesheet/__openerp__.py
index c7207b6761c..5a2e37353cd 100644
--- a/addons/hr_timesheet/__openerp__.py
+++ b/addons/hr_timesheet/__openerp__.py
@@ -50,7 +50,9 @@ to set up a management by affair.
'wizard/hr_timesheet_sign_in_out_view.xml',
],
'demo_xml': ['hr_timesheet_demo.xml'],
- 'test': ['test/test_hr_timesheet.yml'],
+ 'test': ['test/test_hr_timesheet.yml',
+ 'test/hr_timesheet_invoice_report.yml',
+ ],
'installable': True,
'active': False,
'certificate': '0071405533469',
diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv
index cab38e5b519..0b75f11e2c4 100644
--- a/addons/hr_timesheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet/security/ir.model.access.csv
@@ -7,3 +7,4 @@
"access_product_uom_hr_timesheet","product.uom.hr.timesheet","product.model_product_uom","base.group_hr_user",1,0,0,0
"access_hr_analytic_timesheet_manager","hr.analytic.timesheet.manager","model_hr_analytic_timesheet","base.group_hr_manager",1,0,0,0
"access_hr_analytic_timesheet_system","hr.analytic.timesheet.system","model_hr_analytic_timesheet","base.group_system",1,0,0,0
+"access_hr_analytic_timesheet_employee","hr.analytic.timesheet.employee","model_hr_analytic_timesheet","base.group_user",1,1,1,0
diff --git a/addons/hr_timesheet/test/hr_timesheet_report.yml b/addons/hr_timesheet/test/hr_timesheet_report.yml
new file mode 100644
index 00000000000..04c07d77403
--- /dev/null
+++ b/addons/hr_timesheet/test/hr_timesheet_report.yml
@@ -0,0 +1,31 @@
+-
+ In order to test the PDF reports defined on a 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': []})
+ 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
+-
+ !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': []})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py
index f9be64cc454..df44302ec56 100644
--- a/addons/hr_timesheet_invoice/__openerp__.py
+++ b/addons/hr_timesheet_invoice/__openerp__.py
@@ -47,7 +47,9 @@ 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,
'active': False,
'certificate': '0056091842381',
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
index ef4bee1deb3..21ddd3ddda5 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
@@ -21,17 +21,7 @@
-
- account.analytic.account.form
- account.analytic.account
-
- form
-
-
-
-
-
-
+
hr.analytic.timesheet.form
diff --git a/addons/hr_timesheet_invoice/security/ir.model.access.csv b/addons/hr_timesheet_invoice/security/ir.model.access.csv
index 619fc6344cf..7089e184f98 100644
--- a/addons/hr_timesheet_invoice/security/ir.model.access.csv
+++ b/addons/hr_timesheet_invoice/security/ir.model.access.csv
@@ -12,3 +12,5 @@
"access_report_analytic_account_close_system","report.analytic.account.close system","model_report_analytic_account_close","base.group_system",1,1,1,1
"access_report_account_analytic_line_to_invoice_system","report.account.analytic.line.to.invoice system","model_report_account_analytic_line_to_invoice","base.group_system",1,1,1,1
"access_report_timesheet_line","report.timesheet.line","model_report_timesheet_line","base.group_hr_manager",1,0,0,0
+"access_account_invoice_hr_user","account.invoice.hr.user","account.model_account_invoice","base.group_hr_user",1,1,1,0
+"access_account_fiscalyear_hr_user","account.fiscalyear.hr.user","account.model_account_fiscalyear","base.group_hr_user",1,1,1,0
diff --git a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml
new file mode 100644
index 00000000000..118699c4aa3
--- /dev/null
+++ b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml
@@ -0,0 +1,23 @@
+-
+ In order to test the PDF reports defined on a HR Timesheet Account Analytic Profit, we will print a 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': []})
+ 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
+-
+ !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': []})
+ 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)
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/security/ir.model.access.csv b/addons/hr_timesheet_sheet/security/ir.model.access.csv
index 3ca4d966f78..de19d325f5f 100644
--- a/addons/hr_timesheet_sheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet_sheet/security/ir.model.access.csv
@@ -6,7 +6,7 @@
"access_hr_timesheet_sheet_sheet_manager","hr_timesheet_sheet.sheet.manager","model_hr_timesheet_sheet_sheet","base.group_hr_manager",1,1,1,1
"access_hr_timesheet_sheet_sheet_system","hr_timesheet_sheet.sheet.system","model_hr_timesheet_sheet_sheet","base.group_system",1,0,0,0
"access_timesheet_report_manager","timesheet.report.manager","model_timesheet_report","base.group_hr_manager",1,1,1,1
-"access_hr_timesheet_sheet_sheet_employee","hr_timesheet_sheet.sheet.employee","model_hr_timesheet_sheet_sheet","base.group_user",1,0,0,0
+"access_hr_timesheet_sheet_sheet_employee","hr_timesheet_sheet.sheet.employee","model_hr_timesheet_sheet_sheet","base.group_user",1,1,1,0
"access_hr_timesheet_sheet_sheet_day_manager","hr_timesheet_sheet.sheet.day.manager","model_hr_timesheet_sheet_sheet_day","base.group_hr_manager",1,1,1,1
"access_hr_timesheet_sheet_sheet_account_manager","hr_timesheet_sheet.sheet.account.manager","model_hr_timesheet_sheet_sheet_account","base.group_hr_manager",1,1,1,1
"access_hr_timesheet_sheet_sheet_day_employee","hr_timesheet_sheet.sheet.day.employee","model_hr_timesheet_sheet_sheet_day","base.group_user",1,0,0,0
diff --git a/addons/l10n_ch/__openerp__.py b/addons/l10n_ch/__openerp__.py
index de378528b33..1af2e70ca59 100644
--- a/addons/l10n_ch/__openerp__.py
+++ b/addons/l10n_ch/__openerp__.py
@@ -94,6 +94,9 @@ TODO :
"account_journal_view.xml",
"security/ir.model.access.csv",
],
+ 'test' : [
+ 'test/l10n_ch_report.yml',
+ ],
"active": False,
"installable": True,
}
diff --git a/addons/l10n_ch/test/l10n_ch_report.yml b/addons/l10n_ch/test/l10n_ch_report.yml
new file mode 100644
index 00000000000..0379e6bc83b
--- /dev/null
+++ b/addons/l10n_ch/test/l10n_ch_report.yml
@@ -0,0 +1,17 @@
+-
+ In order to test the PDF reports defined on a l10n_ch, we will print a 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)
+
+-
+ 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)
diff --git a/addons/l10n_fr/__openerp__.py b/addons/l10n_fr/__openerp__.py
index f96945a8bc8..0de26734781 100644
--- a/addons/l10n_fr/__openerp__.py
+++ b/addons/l10n_fr/__openerp__.py
@@ -48,8 +48,9 @@ Credits: Sistheo Zeekom CrysaLEAD
"security/ir.model.access.csv",
"wizard/fr_report_bilan_view.xml",
"wizard/fr_report_compute_resultant_view.xml",
-
+
],
+ "test": ['test/l10n_fr_report.yml'],
"demo_xml" : [],
"certificate" : "00435321693876313629",
"active": False,
diff --git a/addons/l10n_fr/test/l10n_fr_report.yml b/addons/l10n_fr/test/l10n_fr_report.yml
new file mode 100644
index 00000000000..cfc4f659925
--- /dev/null
+++ b/addons/l10n_fr/test/l10n_fr_report.yml
@@ -0,0 +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}:
+ code: FY2011
+ company_id: base.main_company
+ date_start: '2011-01-01'
+ date_stop: '2011-12-31'
+ name: Fiscal Year 2011
+-
+ In order to test the PDF reports defined on a l10n_fr, we will print a account move line 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')}}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-bilan.'+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
+-
+ !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)
diff --git a/addons/l10n_lu/__openerp__.py b/addons/l10n_lu/__openerp__.py
index 739f36c9ce4..d1f6ba49905 100644
--- a/addons/l10n_lu/__openerp__.py
+++ b/addons/l10n_lu/__openerp__.py
@@ -41,6 +41,7 @@ This module installs:
'account.tax.template.csv',
'wizard/print_vat_view.xml'
],
+ 'test': ['test/l10n_lu_report.yml'],
'demo_xml': ['account.report.report.csv'],
'installable': True,
'active': False,
diff --git a/addons/l10n_lu/test/l10n_lu_report.yml b/addons/l10n_lu/test/l10n_lu_report.yml
new file mode 100644
index 00000000000..0ea9850df9a
--- /dev/null
+++ b/addons/l10n_lu/test/l10n_lu_report.yml
@@ -0,0 +1,14 @@
+-
+ It is demo data for the account.tax.code
+-
+ !record {model: account.tax.code, id: account_tax_code_id_r1}:
+ name: a
+
+-
+ In order to test the PDF reports defined on a l10u_lu, we will print a vat
+-
+ !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)
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..6a13d489104
--- /dev/null
+++ b/addons/mrp/test/mrp_report.yml
@@ -0,0 +1,35 @@
+-
+ 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 an 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 product price, 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, [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)
+
+-
+ In order to test the PDF reports defined on a mrp workcenter, we will print a (mrp)workcenter
+-
+ !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)
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)
diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py
index cab0fb40dc0..6f33f75f65d 100644
--- a/addons/point_of_sale/__openerp__.py
+++ b/addons/point_of_sale/__openerp__.py
@@ -73,7 +73,10 @@ Main features :
'statement_report.xml',
],
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml',],
- 'test':['test/pos_test.yml',],
+ '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:
diff --git a/addons/point_of_sale/pos_demo.xml b/addons/point_of_sale/pos_demo.xml
index 14710cf8f37..80ba3d24397 100644
--- a/addons/point_of_sale/pos_demo.xml
+++ b/addons/point_of_sale/pos_demo.xml
@@ -1,6 +1,65 @@
-
+
+
+
+
+
+
+
+
+ tax_excluded
+
+
+
+
+
+
+
+
+ tax_excluded
+
+
+
+
+
+
+
+ 2010/09/15
+ [PC3] Medium PC
+
+
+
+ 450
+ 2
+ No Discount
+
+
+
+
+ 2010/09/15
+ [PC2] Basic+ PC (assembly on order)
+
+
+
+ 450
+ 2
+ No Discount
+
+
+
+
+ 2010/09/15
+ [PC1] Basic PC
+
+
+
+ 450
+ 5
+ 0.10
+ Discount Applied
+
+
diff --git a/addons/point_of_sale/test/pos_details_report.yml b/addons/point_of_sale/test/pos_details_report.yml
new file mode 100644
index 00000000000..72f35b87ec5
--- /dev/null
+++ b/addons/point_of_sale/test/pos_details_report.yml
@@ -0,0 +1,8 @@
+-
+ 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)
\ No newline at end of file
diff --git a/addons/point_of_sale/test/pos_payment_report_date.yml b/addons/point_of_sale/test/pos_payment_report_date.yml
new file mode 100644
index 00000000000..15eefcdc6ab
--- /dev/null
+++ b/addons/point_of_sale/test/pos_payment_report_date.yml
@@ -0,0 +1,8 @@
+-
+ 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)
\ No newline at end of file
diff --git a/addons/point_of_sale/test/pos_report.yml b/addons/point_of_sale/test/pos_report.yml
new file mode 100644
index 00000000000..bd89ca2015d
--- /dev/null
+++ b/addons/point_of_sale/test/pos_report.yml
@@ -0,0 +1,53 @@
+-
+ 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
+ (data, format) = netsvc.LocalService('report.pos.details_summary').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-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
+-
+ !python {model: pos.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.pos.invoice').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-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
+-
+ !python {model: pos.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.pos.lines').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-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
+-
+ !python {model: pos.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.pos.receipt').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 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
+-
+ !python {model: pos.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.pos.receipt.with.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 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
+-
+ !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)
\ No newline at end of file
diff --git a/addons/product/__openerp__.py b/addons/product/__openerp__.py
index 0a0cfceff20..5d099489859 100644
--- a/addons/product/__openerp__.py
+++ b/addons/product/__openerp__.py
@@ -58,6 +58,7 @@
'company_view.xml',
'process/product_process.xml'
],
+ 'test':['test/product_report.yml'],
'installable': True,
'active': False,
'certificate': '0068861431437',
diff --git a/addons/product/test/product_report.yml b/addons/product/test/product_report.yml
new file mode 100644
index 00000000000..6e80083f66b
--- /dev/null
+++ b/addons/product/test/product_report.yml
@@ -0,0 +1,17 @@
+-
+ In order to test the PDF reports defined on Products, we will print a Products Pricelists Report
+-
+ !python {model: product.product}: |
+ import netsvc, tools, os
+ data_dict = {'model': 'product.price_list'}
+ data_dict['form'] = {
+ 'qty1': 1,
+ 'qty2': 5,
+ 'qty3': 10,
+ 'qty4': 0,
+ 'qty5': 0,
+ 'price_list':ref('product.list0')
+ }
+ (data, format) = netsvc.LocalService('report.product.pricelist').create(cr, uid, [ref('product.product_product_pc1'), ref('product.product_product_pc3')], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'product-product_pricelist'+format), 'wb+').write(data)
diff --git a/addons/project_planning/__openerp__.py b/addons/project_planning/__openerp__.py
index 4624de97f8c..3f378cc21be 100644
--- a/addons/project_planning/__openerp__.py
+++ b/addons/project_planning/__openerp__.py
@@ -55,6 +55,7 @@ At the end of the month, the planning manager can also check if the encoded time
],
'test': [
'test/planning_states.yml'
+ 'test/planning_report.yml'
],
'installable': True,
'active': False,
diff --git a/addons/project_planning/project_planning_demo.xml b/addons/project_planning/project_planning_demo.xml
index 9a64217f252..1c12e5c53cf 100644
--- a/addons/project_planning/project_planning_demo.xml
+++ b/addons/project_planning/project_planning_demo.xml
@@ -8,5 +8,13 @@
+
+ Project_Planning
+ 20
+ 2010-01-01'
+ 2010-12-31
+ draft
+
+
diff --git a/addons/project_planning/test/project_plannning_report.yml b/addons/project_planning/test/project_plannning_report.yml
new file mode 100644
index 00000000000..a7597af86e8
--- /dev/null
+++ b/addons/project_planning/test/project_plannning_report.yml
@@ -0,0 +1,8 @@
+-
+ In order to test the PDF reports defined on a Project Planning, we will print Project Planning Report
+-
+ !python {model: report_account_analytic.planning}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.report_account_analytic.planning.print').create(cr, uid, [ref('project_planning.project_plannning_1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'project_planning-project_planning_report'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/project_scrum/__openerp__.py b/addons/project_scrum/__openerp__.py
index 847263ba7d3..3350419af30 100644
--- a/addons/project_scrum/__openerp__.py
+++ b/addons/project_scrum/__openerp__.py
@@ -60,6 +60,7 @@
"board_project_scrum_view.xml",
],
'demo_xml': ['project_scrum_demo.xml'],
+ 'test': ['test/project_scrum_report.yml'],
'installable': True,
'active': False,
}
diff --git a/addons/project_scrum/test/project_scrum_report.yml b/addons/project_scrum/test/project_scrum_report.yml
new file mode 100644
index 00000000000..7fb3e9c07fc
--- /dev/null
+++ b/addons/project_scrum/test/project_scrum_report.yml
@@ -0,0 +1,9 @@
+-
+ In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report
+-
+ !python {model: project.scrum.sprint}: |
+ import netsvc, tools, os
+ data_dict = {'model': 'project.scrum.sprint', 'id':ref('project_scrum.scrum_sprint_0')}
+ (data, format) = netsvc.LocalService('report.scrum.sprint.burndown').create(cr, uid, [ref('project_scrum.scrum_sprint_0')], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py
index c7b4de7decc..7af6dbceff0 100644
--- a/addons/purchase/__openerp__.py
+++ b/addons/purchase/__openerp__.py
@@ -60,6 +60,7 @@
'test/purchase_from_picking.yml',
'purchase_unit_test.xml',
'test/procurement_buy.yml',
+ 'test/purchase_report.yml',
],
'demo': ['purchase_demo.xml'],
'installable': True,
diff --git a/addons/purchase/purchase_demo.xml b/addons/purchase/purchase_demo.xml
index 1168fd29679..f6c2931a626 100644
--- a/addons/purchase/purchase_demo.xml
+++ b/addons/purchase/purchase_demo.xml
@@ -1,6 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2010/09/15
+ New server config + material
+
+
+ 150
+ 5
+ make_to_stock
+
+
+
+
+ 2010/09/15
+ [PC1] Basic PC
+
+
+ 450
+ 2
+ 3
+ 3
+ make_to_stock
+
+
+
+
+ 2010/09/15
+ [PC3] Medium PC
+
+
+ 900
+ 1
+ make_to_stock
+
+
+
+
\ No newline at end of file
diff --git a/addons/purchase/test/purchase_report.yml b/addons/purchase/test/purchase_report.yml
new file mode 100644
index 00000000000..bbc15b1e936
--- /dev/null
+++ b/addons/purchase/test/purchase_report.yml
@@ -0,0 +1,16 @@
+-
+ In order to test the PDF reports defined on a Purchase Order, we will print a Request Quotation report
+-
+ !python {model: purchase.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.purchase.quotation').create(cr, uid, [ref('purchase.order_purchase1'),ref('purchase.order_purchase2')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'purchase-request_quotation'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on a Purchase Order, we will print Purchase Order report
+-
+ !python {model: purchase.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.purchase.order').create(cr, uid, [ref('purchase.order_purchase1'),ref('purchase.order_purchase2')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'purchase-purchase_order_report'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/purchase_requisition/__openerp__.py b/addons/purchase_requisition/__openerp__.py
index 27be1f3ce64..0cfc48feccd 100644
--- a/addons/purchase_requisition/__openerp__.py
+++ b/addons/purchase_requisition/__openerp__.py
@@ -30,7 +30,7 @@
""",
"depends" : ["purchase","mrp"],
"init_xml" : [],
- "demo_xml" : [],
+ "demo_xml" : ['purchase_requisition_demo.xml'],
"update_xml" : ["wizard/purchase_requisition_partner_view.xml",
"purchase_requisition_data.xml",
"purchase_requisition_view.xml",
@@ -38,7 +38,7 @@
"security/ir.model.access.csv","purchase_requisition_sequence.xml"
],
"active": False,
- "test":[],
+ "test":['test/purchase_requisition_report.yml'],
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase_requisition/purchase_requisition_demo.xml b/addons/purchase_requisition/purchase_requisition_demo.xml
new file mode 100644
index 00000000000..ff9bba7c700
--- /dev/null
+++ b/addons/purchase_requisition/purchase_requisition_demo.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+ TE0001
+
+ multiple
+ 2010/09/16 15:56:14
+
+
+
+
+
+
+
+
+
+ 5
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/purchase_requisition/test/purchase_requisition_report.yml b/addons/purchase_requisition/test/purchase_requisition_report.yml
new file mode 100644
index 00000000000..29edea96a8a
--- /dev/null
+++ b/addons/purchase_requisition/test/purchase_requisition_report.yml
@@ -0,0 +1,8 @@
+-
+ In order to test the PDF reports defined on Purchase Requisition, we will print a Requisition report
+-
+ !python {model: purchase.requisition}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.purchase.requisition').create(cr, uid, [ref('purchase_requisition.order_purchase_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/__openerp__.py b/addons/report_intrastat/__openerp__.py
index 16860ef9b70..b4dc9b52c89 100644
--- a/addons/report_intrastat/__openerp__.py
+++ b/addons/report_intrastat/__openerp__.py
@@ -37,6 +37,7 @@
'intrastat_report.xml'
],
'demo_xml': [],
+ 'test': ['test/report_instratat_report.yml'],
'installable': True,
'active': False,
'certificate': '0056982189085',
diff --git a/addons/report_intrastat/test/report_instratat_report.yml b/addons/report_intrastat/test/report_instratat_report.yml
new file mode 100644
index 00000000000..c6162f51c25
--- /dev/null
+++ b/addons/report_intrastat/test/report_instratat_report.yml
@@ -0,0 +1,8 @@
+-
+ In order to test the PDF reports defined using report_instratat module, we print a Instratat Report
+-
+ !python {model: account.invoice}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.account.invoice.intrastat').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'report_instratat-instrastat_report.'+format), 'wb+').write(data)
diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py
index 2bcb2f2d88f..6978a0bb072 100644
--- a/addons/sale/__openerp__.py
+++ b/addons/sale/__openerp__.py
@@ -79,7 +79,7 @@
'test/sale_procurement.yml',
'test/invoice_on_ordered_qty.yml',
'test/invoice_on_shipped_qty.yml',
- 'test/sale_order_print.yml',
+ 'test/sale_report.yml',
],
'installable': True,
'active': False,
diff --git a/addons/sale/test/sale_order_print.yml b/addons/sale/test/sale_order_print.yml
deleted file mode 100644
index def94d8c27e..00000000000
--- a/addons/sale/test/sale_order_print.yml
+++ /dev/null
@@ -1,8 +0,0 @@
--
- In order to test the PDF reports defined on a sale order, we will print a sale order
--
- !python {model: sale.order}: |
- import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.sale.order').create(cr, uid, [ref('sale.order'),ref('sale.order2')], {}, {})
- 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/sale/test/sale_report.yml b/addons/sale/test/sale_report.yml
new file mode 100644
index 00000000000..d60420294fe
--- /dev/null
+++ b/addons/sale/test/sale_report.yml
@@ -0,0 +1,16 @@
+-
+ In order to test the PDF reports defined on a sale order, we will print a sale order
+-
+ !python {model: sale.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.sale.order').create(cr, uid, [ref('sale.order'),ref('sale.order2')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'sale-sale_order.'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on a sale order, we will print a report for sale prepare allot
+-
+ !python {model: sale.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.sale.order.prepare.allot').create(cr, uid, [ref('sale.order'),ref('sale.order2'),ref('sale.order3')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'sale-sale_prepare_allot.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/sale_layout/__openerp__.py b/addons/sale_layout/__openerp__.py
index ee9fdadf8c3..b8490c02fc9 100755
--- a/addons/sale_layout/__openerp__.py
+++ b/addons/sale_layout/__openerp__.py
@@ -40,6 +40,7 @@
"sale_layout_view.xml",
"sale_layout_report.xml",
],
+ "test" : ['test/sale_layout_report.yml'],
"active": False,
"installable": True
}
diff --git a/addons/sale_layout/test/sale_layout_report.yml b/addons/sale_layout/test/sale_layout_report.yml
new file mode 100644
index 00000000000..ed43ac639f6
--- /dev/null
+++ b/addons/sale_layout/test/sale_layout_report.yml
@@ -0,0 +1,8 @@
+-
+ In order to test the PDF reports defined on Sale, we will print a Sale Layout report.
+-
+ !python {model: sale.order}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.sale.order.layout').create(cr, uid, [ref('sale.order')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'sale_layout-sale layout report'+format), 'wb+').write(data)
diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py
index e33e347d612..432f95242bd 100644
--- a/addons/stock/__openerp__.py
+++ b/addons/stock/__openerp__.py
@@ -74,7 +74,9 @@ Thanks to the double entry management, the inventory controlling is powerful and
"security/ir.model.access.csv",
"board_warehouse_view.xml"
],
- 'test': ['test/stock_test.yml'],
+ 'test': ['test/stock_test.yml',
+ 'test/stock_report.yml',
+ ],
'installable': True,
'active': False,
'certificate': '0055421559965',
diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml
index 6607d97b2b3..03a29838981 100644
--- a/addons/stock/stock_demo.xml
+++ b/addons/stock/stock_demo.xml
@@ -270,6 +270,12 @@
-
+
+ PACKO1
+ out
+ direct
+ 2binvoiced
+
+
diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml
new file mode 100644
index 00000000000..491fd7fa9d7
--- /dev/null
+++ b/addons/stock/test/stock_report.yml
@@ -0,0 +1,48 @@
+-
+ In order to test the PDF reports defined on a stock, we will print a Stock Overviewall(childs) report
+-
+ !python {model: stock.location}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('stock.stock_location_13')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on stock location, we will print a lot location report
+-
+ !python {model: stock.location}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.lot.location').create(cr, uid, [ref('stock.stock_location_components')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'stock-stock_lot_location.'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on stock inventory, we will print a Stock Inventory Move report
+-
+ !python {model: stock.inventory}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock.stock_inventory_0')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on a stock, we will print a Stock Overview report
+-
+ !python {model: stock.location}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('stock.stock_location_14')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on a stock, we will print a Stock Picking List report
+-
+ !python {model: stock.picking}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('stock.stock_picking_1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on a Stock, we will print Product Stock Report
+-
+ !python {model: product.product}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product.product_product_pc1')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)
\ No newline at end of file
diff --git a/addons/survey/__openerp__.py b/addons/survey/__openerp__.py
index 853370132de..fa48e176b26 100644
--- a/addons/survey/__openerp__.py
+++ b/addons/survey/__openerp__.py
@@ -47,6 +47,7 @@
'demo_xml': ['survey_demo.xml'],
'test': [
'test/survey00.yml',
+ 'test/survey_report.yml',
],
'installable': True,
'active': False,
diff --git a/addons/survey/security/ir.model.access.csv b/addons/survey/security/ir.model.access.csv
index 9d7c9c44ee4..2a64acdb0d4 100644
--- a/addons/survey/security/ir.model.access.csv
+++ b/addons/survey/security/ir.model.access.csv
@@ -25,19 +25,6 @@
"access_survey_tbl_column_heading_user","survey.tbl.column.heading user","model_survey_tbl_column_heading","base.group_tool_user",1,1,1,1
"access_survey_response_line_manager","survey.response.line manager","model_survey_response_line","base.group_tool_manager",1,1,1,1
"access_survey_response_line_user","survey.response.line user","model_survey_response_line","base.group_tool_user",1,1,1,1
-"access_survey_type","survey.type","model_survey_type","base.group_hr_manager",1,1,1,1
-"access_survey","survey","model_survey","base.group_hr_manager",1,1,1,1
-"access_survey_history_manager","survey.history","model_survey_history","base.group_hr_manager",1,1,1,1
-"access_survey_page","survey.page","model_survey_page","base.group_hr_manager",1,1,1,1
-"access_survey_question","survey.question","model_survey_question","base.group_hr_manager",1,1,1,1
-"access_survey_question_column_heading","survey.question.column.heading","model_survey_question_column_heading","base.group_hr_manager",1,1,1,1
-"access_survey_answer","survey.answer","model_survey_answer","base.group_hr_manager",1,1,1,1
-"access_survey_response","survey.response","model_survey_response","base.group_hr_manager",1,1,1,1
-"access_survey_response_line","survey.response.line","model_survey_response_line","base.group_hr_manager",1,1,1,1
-"access_survey_tbl_column_heading","survey.tbl.column.heading","model_survey_tbl_column_heading","base.group_hr_manager",1,1,1,1
-"access_survey_response_answer","survey.response.answer","model_survey_response_answer","base.group_hr_manager",1,1,1,1
-"access_survey_res_users","res.users","base.model_res_users","base.group_hr_manager",1,1,1,1
-"access_survey_request","survey.request","model_survey_request","base.group_hr_manager",1,1,1,1
"access_survey_history_survey_manager","survey.history manager","model_survey_history","base.group_tool_manager",1,1,1,1
"access_survey_type_system","survey.type system","model_survey_type","base.group_system",1,0,0,0
"access_survey_question_system","survey.question system","model_survey_question","base.group_system",1,0,0,0
diff --git a/addons/survey/security/survey_security.xml b/addons/survey/security/survey_security.xml
index 7172fdf615e..6c3559fa138 100644
--- a/addons/survey/security/survey_security.xml
+++ b/addons/survey/security/survey_security.xml
@@ -4,12 +4,6 @@
Sales / User
-
-
- Human Resources / Manager
-
-
- Human Resources / User
Tools / Manager
diff --git a/addons/survey/test/survey_report.yml b/addons/survey/test/survey_report.yml
new file mode 100644
index 00000000000..adb3ddb28ed
--- /dev/null
+++ b/addons/survey/test/survey_report.yml
@@ -0,0 +1,24 @@
+-
+ In order to test the PDF reports defined on a Survey, we will print Survey Analysis Report
+-
+ !python {model: survey}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.survey.analysis').create(cr, uid, [ref('survey.survey_partner_feedback')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'survey-survey_analysis_report.'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on a Survey, we will print Survey Browse Response Report
+-
+ !python {model: survey}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.survey.browse.response').create(cr, uid, [ref('survey.survey_partner_feedback')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'survey-survey_browse_response_report.'+format), 'wb+').write(data)
+-
+ In order to test the PDF reports defined on a Survey, we will print Survey Form Report
+-
+ !python {model: survey}: |
+ import netsvc, tools, os
+ (data, format) = netsvc.LocalService('report.survey.form').create(cr, uid, [ref('survey.survey_partner_feedback')], {}, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'survey-survey_form_report.'+format), 'wb+').write(data)
\ No newline at end of file
|