[FIX] account: corrected reports:

- a many2many is _inherited; this means the relation table points to the original
model, not to the actual model used in the wizard. This patch redefines explicitely
the many2many in each _inheriting model.
- In action_account_pl_report, target_move default is False. The test provides a
value (this is a required field).

bzr revid: vmt@openerp.com-20110718141157-aicd8mry14aj36yp
This commit is contained in:
Vo Minh Thu 2011-07-18 16:11:57 +02:00
parent 78491dfe17
commit e56e526393
12 changed files with 29 additions and 9 deletions

View File

@ -29,7 +29,7 @@ class account_analytic_cost_ledger_journal_report(osv.osv_memory):
_columns = {
'date1': fields.date('Start of period', required=True),
'date2': fields.date('End of period', required=True),
'journal': fields.many2many('account.analytic.journal', 'ledger_journal_rel', 'ledger_id', 'Journal_id', 'Journals'),
'journal': fields.many2many('account.analytic.journal', 'ledger_journal_rel', 'ledger_id', 'journal_id', 'Journals'),
}
_defaults = {

View File

@ -147,7 +147,7 @@
!python {model: account.account}: |
ctx={}
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all'}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
-
@ -156,7 +156,7 @@
!python {model: account.account}: |
ctx={}
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True,'target_move': 'all'}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
-

View File

@ -19,13 +19,17 @@
#
##############################################################################
from osv import osv
from osv import osv, fields
class account_balance_report(osv.osv_memory):
_inherit = "account.common.account.report"
_name = 'account.balance.report'
_description = 'Trial Balance Report'
_columns = {
'journal_ids': fields.many2many('account.journal', 'account_balance_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'journal_ids': [],
}

View File

@ -35,6 +35,7 @@ class account_aged_trial_balance(osv.osv_memory):
'direction_selection': fields.selection([('past','Past'),
('future','Future')],
'Analysis Direction', required=True),
'journal_ids': fields.many2many('account.journal', 'account_aged_trial_balance_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'period_length': 30,

View File

@ -45,6 +45,7 @@ class account_bs_report(osv.osv_memory):
'(Profit: Amount will be added, Loss: Amount will be duducted), ' \
'which is calculated from Profilt & Loss Report',
domain = [('type','=','other')]),
'journal_ids': fields.many2many('account.journal', 'account_bs_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults={

View File

@ -19,13 +19,17 @@
#
##############################################################################
from osv import osv
from osv import osv, fields
class account_central_journal(osv.osv_memory):
_name = 'account.central.journal'
_description = 'Account Central Journal'
_inherit = "account.common.journal.report"
_columns = {
'journal_ids': fields.many2many('account.journal', 'account_central_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
return {

View File

@ -19,17 +19,21 @@
#
##############################################################################
from osv import osv
from osv import osv, fields
class account_general_journal(osv.osv_memory):
_inherit = "account.common.journal.report"
_name = 'account.general.journal'
_description = 'Account General Journal'
_columns = {
'journal_ids': fields.many2many('account.journal', 'account_general_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
return {'type': 'ir.actions.report.xml', 'report_name': 'account.general.journal', 'datas': data}
account_general_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -32,6 +32,7 @@ class account_report_general_ledger(osv.osv_memory):
help='If you selected to filter by date or period, this field allow you to add a row to display the amount of debit/credit/balance that precedes the filter you\'ve set.'),
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
'sortby': fields.selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], 'Sort by', required=True),
'journal_ids': fields.many2many('account.journal', 'account_report_general_ledger_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'landscape': True,

View File

@ -31,6 +31,7 @@ class account_partner_balance(osv.osv_memory):
_columns = {
'display_partner': fields.selection([('non-zero_balance', 'With balance is not equal to 0'), ('all', 'All Partners')]
,'Display Partners'),
'journal_ids': fields.many2many('account.journal', 'account_partner_balance_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
@ -51,4 +52,4 @@ class account_partner_balance(osv.osv_memory):
account_partner_balance()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -35,6 +35,7 @@ class account_partner_ledger(osv.osv_memory):
'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods'), ('unreconciled', 'Unreconciled Entries')], "Filter by", required=True),
'page_split': fields.boolean('One Partner Per Page', help='Display Ledger Report with One partner per page'),
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
'journal_ids': fields.many2many('account.journal', 'account_partner_ledger_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'initial_balance': False,

View File

@ -30,6 +30,7 @@ class account_print_journal(osv.osv_memory):
'sort_selection': fields.selection([('date', 'Date'),
('ref', 'Reference Number'),],
'Entries Sorted by', required=True),
'journal_ids': fields.many2many('account.journal', 'account_print_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'sort_selection': 'date',
@ -44,4 +45,4 @@ class account_print_journal(osv.osv_memory):
account_print_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,8 +28,10 @@ class account_pl_report(osv.osv_memory):
_inherit = "account.common.account.report"
_name = "account.pl.report"
_description = "Account Profit And Loss Report"
_columns = {
'display_type': fields.boolean("Landscape Mode"),
'journal_ids': fields.many2many('account.journal', 'account_pl_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {