|
@ -24,18 +24,18 @@ |
|
|
|
|
|
|
|
|
import time |
|
|
import time |
|
|
|
|
|
|
|
|
import pooler |
|
|
|
|
|
from report import report_sxw |
|
|
|
|
|
|
|
|
from openerp.report import report_sxw |
|
|
from openerp.addons.account_financial_report_horizontal.report import ( |
|
|
from openerp.addons.account_financial_report_horizontal.report import ( |
|
|
account_profit_loss |
|
|
account_profit_loss |
|
|
) |
|
|
) |
|
|
from common_report_header import common_report_header |
|
|
from common_report_header import common_report_header |
|
|
from tools.translate import _ |
|
|
|
|
|
|
|
|
from openerp.tools.translate import _ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class report_balancesheet_horizontal( |
|
|
class report_balancesheet_horizontal( |
|
|
report_sxw.rml_parse, common_report_header |
|
|
report_sxw.rml_parse, common_report_header |
|
|
): |
|
|
): |
|
|
|
|
|
|
|
|
def __init__(self, cr, uid, name, context=None): |
|
|
def __init__(self, cr, uid, name, context=None): |
|
|
super(report_balancesheet_horizontal, self).__init__( |
|
|
super(report_balancesheet_horizontal, self).__init__( |
|
|
cr, uid, name, context=context) |
|
|
cr, uid, name, context=context) |
|
@ -69,11 +69,9 @@ class report_balancesheet_horizontal( |
|
|
def set_context(self, objects, data, ids, report_type=None): |
|
|
def set_context(self, objects, data, ids, report_type=None): |
|
|
new_ids = ids |
|
|
new_ids = ids |
|
|
if (data['model'] == 'ir.ui.menu'): |
|
|
if (data['model'] == 'ir.ui.menu'): |
|
|
new_ids = 'chart_account_id' in data['form'] and data[ |
|
|
|
|
|
'form' |
|
|
|
|
|
]['chart_account_id'] and [data[ |
|
|
|
|
|
'form' |
|
|
|
|
|
]['chart_account_id'][0]] or [] |
|
|
|
|
|
|
|
|
new_ids = 'chart_account_id' in data['form'] \ |
|
|
|
|
|
and data['form']['chart_account_id'] \ |
|
|
|
|
|
and [data['form']['chart_account_id'][0]] or [] |
|
|
objects = self.pool.get('account.account').browse( |
|
|
objects = self.pool.get('account.account').browse( |
|
|
self.cr, self.uid, new_ids) |
|
|
self.cr, self.uid, new_ids) |
|
|
lang_dict = self.pool.get('res.users').read( |
|
|
lang_dict = self.pool.get('res.users').read( |
|
@ -98,14 +96,13 @@ class report_balancesheet_horizontal( |
|
|
|
|
|
|
|
|
def get_data(self, data): |
|
|
def get_data(self, data): |
|
|
cr, uid = self.cr, self.uid |
|
|
cr, uid = self.cr, self.uid |
|
|
db_pool = pooler.get_pool(self.cr.dbname) |
|
|
|
|
|
|
|
|
|
|
|
# Getting Profit or Loss Balance from profit and Loss report |
|
|
# Getting Profit or Loss Balance from profit and Loss report |
|
|
self.obj_pl.get_data(data) |
|
|
self.obj_pl.get_data(data) |
|
|
self.res_bl = self.obj_pl.final_result() |
|
|
self.res_bl = self.obj_pl.final_result() |
|
|
|
|
|
|
|
|
account_pool = db_pool.get('account.account') |
|
|
|
|
|
currency_pool = db_pool.get('res.currency') |
|
|
|
|
|
|
|
|
account_pool = self.pool['account.account'] |
|
|
|
|
|
currency_pool = self.pool['res.currency'] |
|
|
|
|
|
|
|
|
types = [ |
|
|
types = [ |
|
|
'liability', |
|
|
'liability', |
|
@ -124,7 +121,6 @@ class report_balancesheet_horizontal( |
|
|
ctx['date_to'] = data['form'].get('date_to', False) |
|
|
ctx['date_to'] = data['form'].get('date_to', False) |
|
|
ctx['state'] = data['form'].get('target_move', 'all') |
|
|
ctx['state'] = data['form'].get('target_move', 'all') |
|
|
cal_list = {} |
|
|
cal_list = {} |
|
|
pl_dict = {} |
|
|
|
|
|
account_dict = {} |
|
|
account_dict = {} |
|
|
account_id = data['form'].get('chart_account_id', False) |
|
|
account_id = data['form'].get('chart_account_id', False) |
|
|
if account_id: |
|
|
if account_id: |
|
@ -278,5 +274,3 @@ report_sxw.report_sxw( |
|
|
'account_balance_sheet.rml', |
|
|
'account_balance_sheet.rml', |
|
|
parser=report_balancesheet_horizontal, |
|
|
parser=report_balancesheet_horizontal, |
|
|
header='internal') |
|
|
header='internal') |
|
|
|
|
|
|
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
|
|
|