跳至內容
選單
此問題已被標幟
2 回覆
1234 瀏覽次數


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

頭像
捨棄