Skip to content
Open
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
97 changes: 97 additions & 0 deletions base_cancel_confirm_selection/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
=============================
Base Cancel Confirm Selection
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:27aca3aeae58b252f6db12e2f9abb388a47be1daa042902839d138712832f66e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/18.0/base_cancel_confirm_selection
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-18-0/server-ux-18-0-base_cancel_confirm_selection
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-ux&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module introduces a selection field for cancellation reasons
instead of free text, enabling better reporting and analysis of
cancellation causes.

**Table of contents**

.. contents::
:local:

Configuration
=============

To use cancellation reasons as a selection field, you must first
configure them under **Settings > Technical > Cancel Reason
Configuration** Create all necessary reasons there. they can be defined
and displayed separately for each model.

After that, when a record is cancelled, it will display a reason field,
and users can select the appropriate reason.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20base_cancel_confirm_selection%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Ecosoft

Contributors
------------

- Saran Lim. <saranl@ecosoft.co.th>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-Saran440| image:: https://github.com/Saran440.png?size=40px
:target: https://github.com/Saran440
:alt: Saran440

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-Saran440|

This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/18.0/base_cancel_confirm_selection>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions base_cancel_confirm_selection/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import model
from . import wizard
20 changes: 20 additions & 0 deletions base_cancel_confirm_selection/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Base Cancel Confirm Selection",
"version": "18.0.1.0.0",
"author": "Ecosoft, Odoo Community Association (OCA)",
"category": "Usability",
"license": "AGPL-3",
"website": "https://github.com/OCA/server-ux",
"depends": ["base_cancel_confirm"],
"data": [
"security/ir.model.access.csv",
"wizard/cancel_confirm.xml",
"views/cancel_reason_view.xml",
"views/cancel_confirm_template.xml",
],
"installable": True,
"maintainers": ["Saran440"],
}
4 changes: 4 additions & 0 deletions base_cancel_confirm_selection/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import res_cancel_reason
from . import base_cancel_confirm
19 changes: 19 additions & 0 deletions base_cancel_confirm_selection/model/base_cancel_confirm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2025 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class BaseCancelConfirm(models.AbstractModel):
_inherit = "base.cancel.confirm"

cancel_reason_id = fields.Many2one(
comodel_name="res.cancel.reason",
string="Cancel Reason Selection",
index=True,
)

def _get_value_clear_cancel(self):
vals_cancel = super()._get_value_clear_cancel()
vals_cancel["cancel_reason_id"] = False
return vals_cancel
17 changes: 17 additions & 0 deletions base_cancel_confirm_selection/model/res_cancel_reason.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class ResCancelReason(models.Model):
_name = "res.cancel.reason"
_description = "Cancel Reason"

name = fields.Char(required=True, translate=True)
description = fields.Text(
help="Explanation of the reason, Why we should select this reason?"
)
model_id = fields.Many2one(comodel_name="ir.model", string="Referenced Model")
model = fields.Char(related="model_id.model", index=True, store=True)
active = fields.Boolean(default=True)
3 changes: 3 additions & 0 deletions base_cancel_confirm_selection/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions base_cancel_confirm_selection/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use cancellation reasons as a selection field,
you must first configure them under **Settings > Technical > Cancel Reason Configuration**
Create all necessary reasons there. they can be defined and displayed separately for each model.

After that, when a record is cancelled, it will display a reason field, and users can select the appropriate reason.
1 change: 1 addition & 0 deletions base_cancel_confirm_selection/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Saran Lim. \<<saranl@ecosoft.co.th>\>
1 change: 1 addition & 0 deletions base_cancel_confirm_selection/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module introduces a selection field for cancellation reasons instead of free text, enabling better reporting and analysis of cancellation causes.
2 changes: 2 additions & 0 deletions base_cancel_confirm_selection/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_res_cancel_reason,access_res_cancel_reason,model_res_cancel_reason,base.group_user,1,1,1,1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading