Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1225 Vistas


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,

       }





Avatar
Descartar
Mejor respuesta

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

Avatar
Descartar
Mejor respuesta

Hello,

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

Avatar
Descartar