mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG] report_label: Migration to 14.0
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
from odoo import api, fields, models
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class IrActionsServer(models.Model):
|
||||
_inherit = "ir.actions.server"
|
||||
|
||||
state = fields.Selection(
|
||||
selection_add=[("report_label", "Print self-adhesive labels")]
|
||||
selection_add=[("report_label", "Print self-adhesive labels")],
|
||||
ondelete={"report_label": "cascade"},
|
||||
)
|
||||
label_template = fields.Char(
|
||||
"Label QWeb Template",
|
||||
@@ -18,7 +20,6 @@ class IrActionsServer(models.Model):
|
||||
states={"report_label": [("required", True)]},
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def report_label_associated_view(self):
|
||||
"""View the associated qweb templates"""
|
||||
self.ensure_one()
|
||||
@@ -34,22 +35,21 @@ class IrActionsServer(models.Model):
|
||||
]
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def run_action_report_label_multi(self, action, eval_context=None):
|
||||
def _run_action_report_label_multi(self, eval_context=None):
|
||||
"""Show report label wizard"""
|
||||
context = dict(self.env.context)
|
||||
context.update(
|
||||
{
|
||||
"label_template": action.label_template,
|
||||
"label_paperformat_id": action.label_paperformat_id.id,
|
||||
"res_model_id": action.model_id.id,
|
||||
"label_template": self.label_template,
|
||||
"label_paperformat_id": self.label_paperformat_id.id,
|
||||
"res_model_id": self.model_id.id,
|
||||
}
|
||||
)
|
||||
return {
|
||||
"name": action.name,
|
||||
"name": self.name,
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": "report.label.wizard",
|
||||
"context": str(context),
|
||||
"context": context,
|
||||
"view_mode": "form",
|
||||
"target": "new",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user