package models

import "odoo-go/pkg/orm"

// initIrActionsReport registers ir.actions.report — Report Action definitions.
// Mirrors: odoo/addons/base/models/ir_actions_report.py class IrActionsReport
//
// Report actions define how to generate reports for records.
// The default report_type is "qweb-html" which renders HTML in the browser.
func initIrActionsReport() {
	m := orm.NewModel("ir.actions.report", orm.ModelOpts{
		Description: "Report Action",
		Table:       "ir_act_report",
		Order:       "name",
	})

	m.AddFields(
		orm.Char("name", orm.FieldOpts{String: "Name", Required: true}),
		orm.Char("type", orm.FieldOpts{String: "Action Type", Default: "ir.actions.report"}),
		orm.Char("report_name", orm.FieldOpts{String: "Report Name", Required: true}),
		orm.Char("report_type", orm.FieldOpts{String: "Report Type", Default: "qweb-html"}),
		orm.Many2one("model_id", "ir.model", orm.FieldOpts{String: "Model"}),
		orm.Char("model", orm.FieldOpts{String: "Model Name"}),
		orm.Boolean("multi", orm.FieldOpts{String: "On Multiple Docs"}),
		orm.Many2one("paperformat_id", "report.paperformat", orm.FieldOpts{String: "Paper Format"}),
		orm.Char("print_report_name", orm.FieldOpts{String: "Printed Report Name"}),
		orm.Boolean("attachment_use", orm.FieldOpts{String: "Reload from Attachment"}),
		orm.Char("attachment", orm.FieldOpts{String: "Save as Attachment Prefix"}),
		orm.Many2many("groups_id", "res.groups", orm.FieldOpts{String: "Groups"}),
		orm.Char("binding_type", orm.FieldOpts{String: "Binding Type", Default: "report"}),
	)
}
