Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5411 Представления

Well I'm working on jasper report and I want to create a new balance sheet report, so I reviewed that the following file: "addons\account\report\account_financial_report.py" returns a list with a dictionary with all information needed for balance sheet, I did some changes in that file to parse it to new report, but I want to create a new module and inherit that method (get_lines) to do my changes in my own files and don't use the openerp files. Is there some way to access to that method and get that list ?

I tried with the following:

class new_report_balance_sheet(osv.Model):

    _name = 'accounting.report'
    _inherit = 'accounting.report'
        

    def start_report(self, cr, uid, ids, data, context=None):
        my_val=self.pool.get('account.financial.report.report.account.common')

Аватар
Отменить
Лучший ответ


In your custom module, define a Python class for your custom report. This class should inherit from account.financial.report.report.account.common to access the get_lines method. You will also need to define your custom methods to make the required changes.

class CustomBalanceSheetReport(models.Model):

    _name = 'custom.balance.sheet.report'

    _inherit = 'account.financial.report.report.account.common'


    def get_lines(self, data):

        # Your custom code here

        lines = super(CustomBalanceSheetReport, self).get_lines(data)

        # Make your changes to the 'lines' list

        return lines


Аватар
Отменить
Related Posts Ответы Просмотры Активность
4
мар. 24
3462
1
июн. 22
6670
4
июн. 21
15979
2
авг. 17
12733
0
апр. 16
3337