Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

Hello community.

I have tried several times, but so far I have not succeeded. In the Profit and Loss report I need to add a button to export in a format other than PDF and/or XLSX, so I need to add a button as indicated in the following image.


I am using the following code but it never triggers anything

# models/report.py
from odoo import models, api
import base64
class CustomAccountReport(models.AbstractModel):
    _inherit = 'account.report'
    def _custom_options_initializer(self, report, options, previous_options=None):
        super()._custom_options_initializer(report, options, previous_options=previous_options)
        codigoPais = self.env.company.account_fiscal_country_id.code;
       options.setdefault('buttons', []).append({            'name': 'export_txt_peru',            'label': 'Exportar TXT (PE)',            'method': 'action_export_txt_peru',            'file_export_type': 'txt',        })

I am already using something similar in the tax report, the difference is the model from which it inherits.


HELP!

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lip 22
2370
1
lut 16
4260
0
lip 25
577
2
lut 23
1953
2
cze 16
5847