|
@ -24,18 +24,19 @@ |
|
|
|
|
|
|
|
|
import time |
|
|
import time |
|
|
|
|
|
|
|
|
import pooler |
|
|
|
|
|
from report import report_sxw |
|
|
|
|
|
|
|
|
import openerp.pooler as pooler |
|
|
|
|
|
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 +70,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( |
|
@ -100,7 +99,7 @@ class report_balancesheet_horizontal( |
|
|
cr, uid = self.cr, self.uid |
|
|
cr, uid = self.cr, self.uid |
|
|
db_pool = pooler.get_pool(self.cr.dbname) |
|
|
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() |
|
|
|
|
|
|
|
@ -124,7 +123,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: |
|
|