跳至内容
菜单
此问题已终结
2 回复
1075 查看


Does anyone know why these codes do not create a button in the print section of account move of odoo16?


Code button:


xml version="1.0" encoding="utf-8"

odoo>

        record id="invoice_report_menu" model="ir.actions.report"

                field name="name" Factura 1 field

                field name="model" account.move field

                field name="report_type" qweb-pdf field

                field name="report_name" facturas_personalizadas.report_facturas_personalizadas field

                field name="report_file" facturas_personalizadas.report_facturas_personalizadas field

                field name="binding_model_id" ref="account.model_account_move" 

                field name="binding_type" report field

        record

odoo



code .py:

from odoo import models, fields, api

from datetime import datetime


class report_invoice(models.AbstractModel):

    _name = 'report.facturas_personalizadas.report_facturas_personalizadas'


@api.model

    def _get_report_values(self, docids, data=None):

        docs = self.env['account.move'].browse(docids)

        return {

            'doc_ids': docs.ids,

            'doc_model': 'account.move',

            'docs': docs,

       }





形象
丢弃
最佳答案

Hi,

The XML template you provided seems correct. If the print button is not visible in the model, please ensure that you have included the XML file in the views section of your manifest file. Additionally, consider upgrading your custom module.


Hope it helps

形象
丢弃
最佳答案

Hello,

please make sure that the xml file name is defined on __manifest__.py

形象
丢弃