From 8c794a52574af7c5ca31ef59af47bf6ac679daaf Mon Sep 17 00:00:00 2001 From: GuillemCForgeFlow Date: Mon, 28 Oct 2024 16:07:54 +0100 Subject: [PATCH] [BKP][ADD]base_cancel_confirm Backport from https://github.com/OCA/server-ux/tree/14.0/base_cancel_confirm Just needed to adjust calls based on 13.0 ORM --- base_cancel_confirm/__manifest__.py | 2 +- base_cancel_confirm/model/base_cancel_confirm.py | 11 ++++++----- base_cancel_confirm/readme/CONTRIBUTORS.rst | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/base_cancel_confirm/__manifest__.py b/base_cancel_confirm/__manifest__.py index 6a62a4fc56..d78354a16b 100644 --- a/base_cancel_confirm/__manifest__.py +++ b/base_cancel_confirm/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Base Cancel Confirm", - "version": "14.0.1.1.0", + "version": "13.0.1.0.0", "author": "Ecosoft,Odoo Community Association (OCA)", "category": "Usability", "license": "AGPL-3", diff --git a/base_cancel_confirm/model/base_cancel_confirm.py b/base_cancel_confirm/model/base_cancel_confirm.py index 9185a14121..7fae6213dd 100644 --- a/base_cancel_confirm/model/base_cancel_confirm.py +++ b/base_cancel_confirm/model/base_cancel_confirm.py @@ -37,8 +37,9 @@ def _cancel_confirm_disabled(self): return tools.str2bool(res) def open_cancel_confirm_wizard(self): - xmlid = "base_cancel_confirm.action_cancel_confirm_wizard" - action = self.env["ir.actions.act_window"]._for_xml_id(xmlid) + module_name = "base_cancel_confirm" + action_xmlid = "action_cancel_confirm_wizard" + action = self.env["ir.actions.act_window"].for_xml_id(module_name, action_xmlid) action["context"] = { "cancel_res_model": self._name, "cancel_res_ids": self.ids, @@ -59,7 +60,7 @@ def fields_view_get( if view_type == "form": doc = etree.XML(res["arch"]) for node in doc.xpath(self._cancel_reason_xpath): - str_element = self.env["ir.qweb"]._render( + str_element = self.env["ir.qweb"].render( "base_cancel_confirm.cancel_reason_template" ) new_node = etree.fromstring(str_element) @@ -69,9 +70,9 @@ def fields_view_get( View = self.env["ir.ui.view"] if view_id and res.get("base_model", self._name) != self._name: View = View.with_context(base_model_name=res["base_model"]) - new_arch, new_fields = View.postprocess_and_fields(doc, self._name) + new_arch, new_fields = View.postprocess_and_fields(self._name, doc, View) res["arch"] = new_arch - # We don't want to loose previous configuration, so, we only want to add + # We don't want to lose previous configuration, so, we only want to add # the new fields new_fields.update(res["fields"]) res["fields"] = new_fields diff --git a/base_cancel_confirm/readme/CONTRIBUTORS.rst b/base_cancel_confirm/readme/CONTRIBUTORS.rst index 6ce956d961..cd87e771eb 100644 --- a/base_cancel_confirm/readme/CONTRIBUTORS.rst +++ b/base_cancel_confirm/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Kitti U. +* Guillem Casassas