[IMP] Account: account balance and general ledger clean
bzr revid: mra@mra-laptop-20100713044223-ny2xr6ygifeej11r
This commit is contained in:
parent
a25ace244f
commit
5751902467
|
@ -29,7 +29,7 @@ from account_journal_common_default import account_journal_common_default
|
|||
class account_balance(report_sxw.rml_parse, account_journal_common_default):
|
||||
_name = 'report.account.account.balance'
|
||||
|
||||
def set_context(self, objects, data, ids, report_type = None):
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
new_ids = ids
|
||||
if (data['model'] == 'ir.ui.menu'):
|
||||
new_ids = 'chart_account_id' in data['form'] and [data['form']['chart_account_id']] or []
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
|
@ -38,28 +36,10 @@ class account_balance_report(osv.osv_memory):
|
|||
'display_account': 'bal_all'
|
||||
}
|
||||
|
||||
# def default_get(self, cr, uid, fields, context=None):
|
||||
# """ To get default values for the object.
|
||||
# @param self: The object pointer.
|
||||
# @param cr: A database cursor
|
||||
# @param uid: ID of the user currently logged in
|
||||
# @param fields: List of fields for which we want default values
|
||||
# @param context: A standard dictionary
|
||||
# @return: A dictionary which of fields with values.
|
||||
# """
|
||||
# res = {}
|
||||
# if 'journal_ids' in fields:# FIX me!!
|
||||
# res['journal_ids'] = []
|
||||
# return res
|
||||
# else:
|
||||
# result = super(account_balance_report, self).default_get(cr, uid, fields, context=context)
|
||||
# result.update({'company_id':self.pool.get('account.account').read(cr, uid, result['chart_account_id'], context=context)['company_id']})
|
||||
# return result
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_account',])[0])
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_account'])[0])
|
||||
data['form']['query_line'] = query_line
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data, 'nodestroy':True, }
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data, 'nodestroy':True}
|
||||
|
||||
account_balance_report()
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
@ -35,21 +34,21 @@ class account_report_general_ledger(osv.osv_memory):
|
|||
'amount_currency': fields.boolean("With Currency"),
|
||||
'sortby': fields.selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], 'Sort By', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'display_account' : 'bal_all',
|
||||
'display_account': 'bal_all',
|
||||
'landscape': True,
|
||||
'amount_currency' : True,
|
||||
'amount_currency': True,
|
||||
'sortby': 'sort_date',
|
||||
}
|
||||
}
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_account', 'landscape', 'soldeinit', 'amount_currency', 'sortby'])[0])
|
||||
data['form']['query_line'] = query_line
|
||||
if data['form']['landscape'] == True:
|
||||
return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger_landscape', 'datas': data, 'nodestroy':True, }
|
||||
else:
|
||||
return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger', 'datas': data, 'nodestroy':True, }
|
||||
if data['form']['landscape']:
|
||||
return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger_landscape', 'datas': data, 'nodestroy':True }
|
||||
return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger', 'datas': data, 'nodestroy':True}
|
||||
|
||||
account_report_general_ledger()
|
||||
|
||||
|
|
Loading…
Reference in New Issue