Hello
I am trying to customize the invoice layout in the accounting module in odoo 16 but I dont want to mess with the default views so I want to create another option under the print menu.
I have inherited account.move
model into my custom model ice.report
as follows:
from odoo import fields, api, models
class CustomIceReport(models.Model):
_name = 'ice.report'
_inherits = {'account.move': 'transaction_ids'}
_description = 'Custom industrial control equipment'
transaction_ids = fields.Many2one('account.move', string='Transaction ID', required=True, ondelete="cascade")
I can confirm the fields in my custom model have been extended taking from account.move
.
I defined the report like so
using the binding model I thought it would automatically include it under the print menu but I cannot see it. The template file ice_report.ice_report_template
exists under the ice_report
directory.
record id="ice_report_action" model="ir.actions.report"
field name="name" Ice Invoice field
field name="model" ice.report /
field name="report_type" qweb-pdf /
field name="report_name" ice_report.ice_report_template /
field name="report_file" ice_report.ice_report_template /
field name="binding_model_id" ref="account.model_account_move" /
field name="binding_type" report field
record
I assume this is where I am missing something. I am new to the job and the system and still trying to wrap my head around it. I get that an action would be triggered if the custom button is clicked, the data defined in the model would be rendered through the template. Don't know which part I overlooked.
Thank you for the help