|
@ -42,18 +42,20 @@ class GeneralView(models.TransientModel): |
|
|
def view_report(self, option, title): |
|
|
def view_report(self, option, title): |
|
|
r = self.env['account.general.ledger'].search([('id', '=', option[0])]) |
|
|
r = self.env['account.general.ledger'].search([('id', '=', option[0])]) |
|
|
new_title = '' |
|
|
new_title = '' |
|
|
|
|
|
trans_title = self.env['ir.translation'].search([('value', '=', title), ('module', '=', 'dynamic_accounts_report')], limit=1).src |
|
|
|
|
|
|
|
|
journals = r.journal_ids |
|
|
journals = r.journal_ids |
|
|
if title == 'General Ledger': |
|
|
if title == 'General Ledger' or trans_title == 'General Ledger': |
|
|
journals = r.journal_ids |
|
|
journals = r.journal_ids |
|
|
new_title = 'General Ledger' |
|
|
new_title = title |
|
|
if title == 'Bank Book': |
|
|
if title == 'Bank Book' or trans_title == 'Bank Book': |
|
|
journals = self.env['account.journal'].search([('type', '=', 'bank')], |
|
|
journals = self.env['account.journal'].search([('type', '=', 'bank')], |
|
|
limit=1) |
|
|
limit=1) |
|
|
new_title = 'Bank Book' |
|
|
new_title = title |
|
|
if title == 'Cash Book': |
|
|
if title == 'Cash Book' or trans_title == 'Cash Book': |
|
|
journals = self.env['account.journal'].search([('type', '=', 'cash')], |
|
|
journals = self.env['account.journal'].search([('type', '=', 'cash')], |
|
|
limit=1) |
|
|
limit=1) |
|
|
new_title = 'Cash Book' |
|
|
new_title = title |
|
|
r.write({ |
|
|
r.write({ |
|
|
'titles': new_title, |
|
|
'titles': new_title, |
|
|
}) |
|
|
}) |
|
@ -332,6 +334,7 @@ class GeneralView(models.TransientModel): |
|
|
params = tuple(where_params) |
|
|
params = tuple(where_params) |
|
|
else: |
|
|
else: |
|
|
params = (tuple(accounts.ids),) + tuple(where_params) |
|
|
params = (tuple(accounts.ids),) + tuple(where_params) |
|
|
|
|
|
|
|
|
cr.execute(sql, params) |
|
|
cr.execute(sql, params) |
|
|
|
|
|
|
|
|
for row in cr.dictfetchall(): |
|
|
for row in cr.dictfetchall(): |
|
|