Skip to content

Commit

Permalink
[BKP][ADD]base_cancel_confirm
Browse files Browse the repository at this point in the history
Backport from https://github.com/OCA/server-ux/tree/14.0/base_cancel_confirm
Just needed to adjust calls based on 13.0 ORM
  • Loading branch information
GuillemCForgeFlow committed Oct 28, 2024
1 parent 7b4a4e5 commit 8c794a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion base_cancel_confirm/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 6 additions & 5 deletions base_cancel_confirm/model/base_cancel_confirm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions base_cancel_confirm/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Kitti U. <[email protected]>
* Guillem Casassas <[email protected]>

0 comments on commit 8c794a5

Please sign in to comment.