Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ addon | version | maintainers | summary
--- | --- | --- | ---
[announcement](announcement/) | 18.0.1.0.1 | | Notify internal users about relevant organization stuff
[barcode_action](barcode_action/) | 18.0.1.0.0 | | Allows to use barcodes as a launcher
[base_cancel_confirm](base_cancel_confirm/) | 18.0.1.0.1 | <a href='https://github.com/kittiu'><img src='https://github.com/kittiu.png' width='32' height='32' style='border-radius:50%;' alt='kittiu'/></a> | Base Cancel Confirm
[base_cancel_confirm](base_cancel_confirm/) | 18.0.1.0.2 | <a href='https://github.com/kittiu'><img src='https://github.com/kittiu.png' width='32' height='32' style='border-radius:50%;' alt='kittiu'/></a> | Base Cancel Confirm
[base_custom_filter](base_custom_filter/) | 18.0.1.0.0 | <a href='https://github.com/AshishHirapara'><img src='https://github.com/AshishHirapara.png' width='32' height='32' style='border-radius:50%;' alt='AshishHirapara'/></a> <a href='https://github.com/ForgeFlow'><img src='https://github.com/ForgeFlow.png' width='32' height='32' style='border-radius:50%;' alt='ForgeFlow'/></a> | Add custom filters in standard filters and group by dropdowns
[base_export_manager](base_export_manager/) | 18.0.1.0.2 | | Manage model export profiles
[base_import_security_group](base_import_security_group/) | 18.0.1.0.0 | | Group-based permissions for importing CSV files
Expand Down
2 changes: 1 addition & 1 deletion base_cancel_confirm/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Base Cancel Confirm
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fae0ef1c6d1dd76aad220b3620639cbafd2aa06efca75a41d0476c706db7b068
!! source digest: sha256:3a1d5474e16df8a851d39ec3b5fb9929ab4c6f2990e0eac80c1ca56145dfc43e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
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": "18.0.1.0.1",
"version": "18.0.1.0.2",
"author": "Ecosoft,Odoo Community Association (OCA)",
"category": "Usability",
"license": "AGPL-3",
Expand Down
5 changes: 4 additions & 1 deletion base_cancel_confirm/model/base_cancel_confirm.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ def open_cancel_confirm_wizard(self):
}
return action

def _get_value_clear_cancel(self):
return {"cancel_confirm": False, "cancel_reason": False}

def clear_cancel_confirm_data(self):
self.write({"cancel_confirm": False, "cancel_reason": False})
self.write(self._get_value_clear_cancel())

def get_view(self, view_id=None, view_type="form", **options):
res = super().get_view(view_id=view_id, view_type=view_type, **options)
Expand Down
2 changes: 1 addition & 1 deletion base_cancel_confirm/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Base Cancel Confirm</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fae0ef1c6d1dd76aad220b3620639cbafd2aa06efca75a41d0476c706db7b068
!! source digest: sha256:3a1d5474e16df8a851d39ec3b5fb9929ab4c6f2990e0eac80c1ca56145dfc43e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-ux/tree/18.0/base_cancel_confirm"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-ux-18-0/server-ux-18-0-base_cancel_confirm"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-ux&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Many document model that already has cancel action may also want a
Expand Down
14 changes: 10 additions & 4 deletions base_cancel_confirm/wizard/cancel_confirm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ class CancelConfirm(models.TransientModel):
required=True,
)

def _get_dict_update(self):
"""Hooks this method to update value in docs"""
dict_update = {"cancel_confirm": True}
# Cancel Reason
if self.has_cancel_reason in ["optional", "required"]:
dict_update.update({"cancel_reason": self.cancel_reason})
return dict_update

def confirm_cancel(self):
self.ensure_one()
res_model = self._context.get("cancel_res_model")
res_ids = self._context.get("cancel_res_ids")
cancel_method = self._context.get("cancel_method")
docs = self.env[res_model].browse(res_ids)
docs.write({"cancel_confirm": True})
# Cancel Reason
if self.has_cancel_reason in ["optional", "required"]:
docs.write({"cancel_reason": self.cancel_reason})
dict_update = self._get_dict_update()
docs.write(dict_update)
res = getattr(docs, cancel_method)()
return res
Loading