Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 22
2434
1
thg 2 16
4311
0
thg 7 25
654
2
thg 2 23
2038
2
thg 6 16
5913