mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 02:32:04 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
46
odoo-bringout-oca-server-ux-base_cancel_confirm/README.md
Normal file
46
odoo-bringout-oca-server-ux-base_cancel_confirm/README.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# Base Cancel Confirm
|
||||
|
||||
Odoo addon: base_cancel_confirm
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-server-ux-base_cancel_confirm
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
This addon depends on:
|
||||
- base
|
||||
|
||||
## Manifest Information
|
||||
|
||||
- **Name**: Base Cancel Confirm
|
||||
- **Version**: 16.0.1.0.1
|
||||
- **Category**: Usability
|
||||
- **License**: AGPL-3
|
||||
- **Installable**: True
|
||||
|
||||
## Source
|
||||
|
||||
Based on [OCA/server-ux](https://github.com/OCA/server-ux) branch 16.0, addon `base_cancel_confirm`.
|
||||
|
||||
## License
|
||||
|
||||
This package maintains the original AGPL-3 license from the upstream Odoo project.
|
||||
|
||||
## Documentation
|
||||
|
||||
- Overview: doc/OVERVIEW.md
|
||||
- Architecture: doc/ARCHITECTURE.md
|
||||
- Models: doc/MODELS.md
|
||||
- Controllers: doc/CONTROLLERS.md
|
||||
- Wizards: doc/WIZARDS.md
|
||||
- Reports: doc/REPORTS.md
|
||||
- Security: doc/SECURITY.md
|
||||
- Install: doc/INSTALL.md
|
||||
- Usage: doc/USAGE.md
|
||||
- Configuration: doc/CONFIGURATION.md
|
||||
- Dependencies: doc/DEPENDENCIES.md
|
||||
- Troubleshooting: doc/TROUBLESHOOTING.md
|
||||
- FAQ: doc/FAQ.md
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
===================
|
||||
Base Cancel Confirm
|
||||
===================
|
||||
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:ac67f451a2d77db32074340753f7ab30872dce3cf2d8d80108df9af61a228db5
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |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/16.0/base_cancel_confirm
|
||||
: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-16-0/server-ux-16-0-base_cancel_confirm
|
||||
: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=16.0
|
||||
:alt: Try me on Runboat
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
Many document model that already has cancel action may also want a confirm dialog with option to provide reason.
|
||||
|
||||
This module does not provide a functionality by itself but an abstract model
|
||||
to easily implement a confirm with reason wizard when cancel button is clicked.
|
||||
If reason is provided, it will be visible in form view.
|
||||
|
||||
**Note:** To be able to use this module in a new model you will need some
|
||||
development.
|
||||
|
||||
You can see implementation example as followings,
|
||||
|
||||
* `sale_cancel_confirm <https://github.com/OCA/sale-workflow>`_
|
||||
* `purchase_cancel_confirm <https://github.com/OCA/purchase-workflow>`_
|
||||
* `purchase_request_cancel_confirm <https://github.com/OCA/purchase-workflow>`_
|
||||
* `account_move_cancel_confirm <https://github.com/OCA/account-invoicing>`_
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
By default, the cancel confirm will be disabled (to ensure no side effect on other module unit test)
|
||||
|
||||
To enable cancel confirm wizard, please add System Parameter (ir.config_parameter) for each extended module.
|
||||
|
||||
For example,
|
||||
|
||||
* sale_cancel_confirm, add `sale.order.cancel_confirm_disable = False`
|
||||
* purchase_cancel_confirm, add `purchase.order.cancel_confirm_disable = False`
|
||||
|
||||
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%0Aversion:%2016.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
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Kitti U. <kittiu@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-kittiu| image:: https://github.com/kittiu.png?size=40px
|
||||
:target: https://github.com/kittiu
|
||||
:alt: kittiu
|
||||
|
||||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
||||
|
||||
|maintainer-kittiu|
|
||||
|
||||
This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/16.0/base_cancel_confirm>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import wizard
|
||||
from . import model
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
{
|
||||
"name": "Base Cancel Confirm",
|
||||
"version": "16.0.1.0.1",
|
||||
"author": "Ecosoft,Odoo Community Association (OCA)",
|
||||
"category": "Usability",
|
||||
"license": "AGPL-3",
|
||||
"website": "https://github.com/OCA/server-ux",
|
||||
"depends": ["base"],
|
||||
"data": [
|
||||
"wizard/cancel_confirm.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"views/cancel_confirm_template.xml",
|
||||
],
|
||||
"auto_install": False,
|
||||
"installable": True,
|
||||
"maintainers": ["kittiu"],
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_cancel_confirm
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "A flag signify that this document is confirmed for cancellation"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
msgid "An optional cancel reason"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Are you sure to cancel this document?"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model,name:base_cancel_confirm.model_cancel_confirm
|
||||
msgid "Cancel Confirm"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.actions.act_window,name:base_cancel_confirm.action_cancel_confirm_wizard
|
||||
#: model:ir.model,name:base_cancel_confirm.model_base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel Confirmation"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "Cancel Confirmed"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__cancel_reason
|
||||
msgid "Cancel Reason"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#. odoo-python
|
||||
#: code:addons/base_cancel_confirm/model/base_cancel_confirm.py:0
|
||||
#, python-format
|
||||
msgid "Configuration Error (%s), should be 'True' or 'False'"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Confirm"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__has_cancel_reason
|
||||
msgid "Has Cancel Reason"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__no
|
||||
msgid "None"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__optional
|
||||
msgid "Optional"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__required
|
||||
msgid "Required"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "or"
|
||||
msgstr ""
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_cancel_confirm
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "A flag signify that this document is confirmed for cancellation"
|
||||
msgstr "Zastava koja označava da je ovaj dokument potvrđen za otkazivanje"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
msgid "An optional cancel reason"
|
||||
msgstr "Opcionalni razlog otkazivanja"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Are you sure to cancel this document?"
|
||||
msgstr "Jeste li sigurni da želite otkazati ovaj dokument?"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel"
|
||||
msgstr "Otkaži"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model,name:base_cancel_confirm.model_cancel_confirm
|
||||
msgid "Cancel Confirm"
|
||||
msgstr "Potvrdi otkazivanje"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.actions.act_window,name:base_cancel_confirm.action_cancel_confirm_wizard
|
||||
#: model:ir.model,name:base_cancel_confirm.model_base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel Confirmation"
|
||||
msgstr "Potvrda otkazivanja"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "Cancel Confirmed"
|
||||
msgstr "Otkazivanje potvrđeno"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__cancel_reason
|
||||
msgid "Cancel Reason"
|
||||
msgstr "Razlog otkazivanja"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#. odoo-python
|
||||
#: code:addons/base_cancel_confirm/model/base_cancel_confirm.py:0
|
||||
#, python-format
|
||||
msgid "Configuration Error (%s), should be 'True' or 'False'"
|
||||
msgstr "Greška konfiguracije (%s), treba biti 'True' ili 'False'"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Confirm"
|
||||
msgstr "Potvrdi"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Kreirao"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Kreirano"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Prikazani naziv"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__has_cancel_reason
|
||||
msgid "Has Cancel Reason"
|
||||
msgstr "Ima razlog otkazivanja"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Zadnje mijenjano"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Zadnji ažurirao"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Zadnje ažurirano"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__no
|
||||
msgid "None"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__optional
|
||||
msgid "Optional"
|
||||
msgstr "Opcionalno"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__required
|
||||
msgid "Required"
|
||||
msgstr "Zahtijevano"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "or"
|
||||
msgstr "ili"
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_cancel_confirm
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2023-11-11 15:33+0000\n"
|
||||
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.17\n"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "A flag signify that this document is confirmed for cancellation"
|
||||
msgstr ""
|
||||
"Una bandera significa que este documento está confirmado para su anulación"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
msgid "An optional cancel reason"
|
||||
msgstr "Un motivo de cancelación opcional"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Are you sure to cancel this document?"
|
||||
msgstr "¿Está seguro de cancelar este documento?"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel"
|
||||
msgstr "Cancelar"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model,name:base_cancel_confirm.model_cancel_confirm
|
||||
msgid "Cancel Confirm"
|
||||
msgstr "Cancelar Confirmar"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.actions.act_window,name:base_cancel_confirm.action_cancel_confirm_wizard
|
||||
#: model:ir.model,name:base_cancel_confirm.model_base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel Confirmation"
|
||||
msgstr "Cancelar Confirmación"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "Cancel Confirmed"
|
||||
msgstr "Cancelar Confirmado"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__cancel_reason
|
||||
msgid "Cancel Reason"
|
||||
msgstr "Cancelar Razón"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#. odoo-python
|
||||
#: code:addons/base_cancel_confirm/model/base_cancel_confirm.py:0
|
||||
#, python-format
|
||||
msgid "Configuration Error (%s), should be 'True' or 'False'"
|
||||
msgstr "Error de configuración (%s), debe ser 'True' o 'False'"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Confirm"
|
||||
msgstr "Confirmar"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Creado por"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Creado el"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Mostrar Nombre"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__has_cancel_reason
|
||||
msgid "Has Cancel Reason"
|
||||
msgstr "Tiene Motivo de Cancelación"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__id
|
||||
msgid "ID"
|
||||
msgstr "ID (identificación)"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Última Modifiación el"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Última actualización por"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Última Actualización el"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__no
|
||||
msgid "None"
|
||||
msgstr "Ninguno/a"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__optional
|
||||
msgid "Optional"
|
||||
msgstr "Opcional"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__required
|
||||
msgid "Required"
|
||||
msgstr "Requerido"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "or"
|
||||
msgstr "o"
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_cancel_confirm
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2023-12-31 19:35+0000\n"
|
||||
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.17\n"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "A flag signify that this document is confirmed for cancellation"
|
||||
msgstr "Una spunta indica che questo documento è confermato per l'annullamento"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
msgid "An optional cancel reason"
|
||||
msgstr "Un motivo di annullamento opzionale"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Are you sure to cancel this document?"
|
||||
msgstr "Sicuri di annullare questo documento?"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel"
|
||||
msgstr "Annulla"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model,name:base_cancel_confirm.model_cancel_confirm
|
||||
msgid "Cancel Confirm"
|
||||
msgstr "Annulla conferma"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.actions.act_window,name:base_cancel_confirm.action_cancel_confirm_wizard
|
||||
#: model:ir.model,name:base_cancel_confirm.model_base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel Confirmation"
|
||||
msgstr "Annulla conferma"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "Cancel Confirmed"
|
||||
msgstr "Annullamento confermato"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__cancel_reason
|
||||
msgid "Cancel Reason"
|
||||
msgstr "Causale annullamento"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#. odoo-python
|
||||
#: code:addons/base_cancel_confirm/model/base_cancel_confirm.py:0
|
||||
#, python-format
|
||||
msgid "Configuration Error (%s), should be 'True' or 'False'"
|
||||
msgstr "Errore configurazione (%s), deve essere 'True' o 'False'"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Confirm"
|
||||
msgstr "Conferma"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Creato da"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Creato il"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nome visualizzato"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__has_cancel_reason
|
||||
msgid "Has Cancel Reason"
|
||||
msgstr "Ha causale annullamento"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Ultima modifica il"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Ultimo aggiornamento di"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Ultimo aggiornamento il"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__no
|
||||
msgid "None"
|
||||
msgstr "Nessuna"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__optional
|
||||
msgid "Optional"
|
||||
msgstr "Opzionale"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__required
|
||||
msgid "Required"
|
||||
msgstr "Richiesta"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "or"
|
||||
msgstr "o"
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_cancel_confirm
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2021-04-18 10:46+0000\n"
|
||||
"Last-Translator: Bosd <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: nl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.3.2\n"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "A flag signify that this document is confirmed for cancellation"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,help:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
msgid "An optional cancel reason"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Are you sure to cancel this document?"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel"
|
||||
msgstr "Annuleer"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model,name:base_cancel_confirm.model_cancel_confirm
|
||||
msgid "Cancel Confirm"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.actions.act_window,name:base_cancel_confirm.action_cancel_confirm_wizard
|
||||
#: model:ir.model,name:base_cancel_confirm.model_base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Cancel Confirmation"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_confirm
|
||||
msgid "Cancel Confirmed"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_base_cancel_confirm__cancel_reason
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__cancel_reason
|
||||
msgid "Cancel Reason"
|
||||
msgstr "Annuleringsreden"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#. odoo-python
|
||||
#: code:addons/base_cancel_confirm/model/base_cancel_confirm.py:0
|
||||
#, python-format
|
||||
msgid "Configuration Error (%s), should be 'True' or 'False'"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "Confirm"
|
||||
msgstr "Bevestig"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Aangemaakt door"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Aangemaakt op"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Weergavenaam"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__has_cancel_reason
|
||||
msgid "Has Cancel Reason"
|
||||
msgstr "Heeft annuleringsreden"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Laatst bijgewerk op"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Laatst bijgewerkt door"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields,field_description:base_cancel_confirm.field_cancel_confirm__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Laatst bijgewerkt op"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__no
|
||||
msgid "None"
|
||||
msgstr "Geen"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__optional
|
||||
msgid "Optional"
|
||||
msgstr "Optioneel"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model:ir.model.fields.selection,name:base_cancel_confirm.selection__cancel_confirm__has_cancel_reason__required
|
||||
msgid "Required"
|
||||
msgstr "Vereist"
|
||||
|
||||
#. module: base_cancel_confirm
|
||||
#: model_terms:ir.ui.view,arch_db:base_cancel_confirm.view_cancel_confirm_wizard
|
||||
msgid "or"
|
||||
msgstr "of"
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import base_cancel_confirm
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
import inspect
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from odoo import _, fields, models, tools
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.tools.misc import frozendict
|
||||
|
||||
|
||||
class BaseCancelConfirm(models.AbstractModel):
|
||||
_name = "base.cancel.confirm"
|
||||
_description = "Cancel Confirmation"
|
||||
|
||||
_has_cancel_reason = "no" # ["no", "optional", "required"]
|
||||
_cancel_reason_xpath = "/form/sheet/group[last()]"
|
||||
|
||||
cancel_confirm = fields.Boolean(
|
||||
string="Cancel Confirmed",
|
||||
default=lambda self: self._cancel_confirm_disabled(),
|
||||
copy=False,
|
||||
help="A flag signify that this document is confirmed for cancellation",
|
||||
)
|
||||
cancel_reason = fields.Text(
|
||||
copy=False,
|
||||
help="An optional cancel reason",
|
||||
)
|
||||
|
||||
def _cancel_confirm_disabled(self):
|
||||
key = "%s.cancel_confirm_disable" % self._name
|
||||
res = self.env["ir.config_parameter"].sudo().get_param(key)
|
||||
if not res:
|
||||
return True
|
||||
if res not in ("True", "False"):
|
||||
raise ValidationError(
|
||||
_("Configuration Error (%s), should be 'True' or 'False'") % key
|
||||
)
|
||||
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)
|
||||
action["context"] = {
|
||||
"cancel_res_model": self._name,
|
||||
"cancel_res_ids": self.ids,
|
||||
"cancel_method": inspect.stack()[1][3],
|
||||
"default_has_cancel_reason": self._has_cancel_reason,
|
||||
}
|
||||
return action
|
||||
|
||||
def clear_cancel_confirm_data(self):
|
||||
self.write({"cancel_confirm": False, "cancel_reason": False})
|
||||
|
||||
def get_view(self, view_id=None, view_type="form", **options):
|
||||
res = super().get_view(view_id=view_id, view_type=view_type, **options)
|
||||
if view_type == "form":
|
||||
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"])
|
||||
doc = etree.XML(res["arch"])
|
||||
all_models = res["models"].copy()
|
||||
for node in doc.xpath(self._cancel_reason_xpath):
|
||||
str_element = self.env["ir.qweb"]._render(
|
||||
"base_cancel_confirm.cancel_reason_template"
|
||||
)
|
||||
new_node = etree.fromstring(str_element)
|
||||
new_arch, new_models = View.postprocess_and_fields(new_node, self._name)
|
||||
new_node = etree.fromstring(new_arch)
|
||||
for new_element in new_node:
|
||||
node.addnext(new_element)
|
||||
for model in new_models:
|
||||
if model in all_models:
|
||||
continue
|
||||
all_models[model] = new_models[model]
|
||||
res["arch"] = etree.tostring(doc)
|
||||
res["models"] = frozendict(all_models)
|
||||
return res
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
By default, the cancel confirm will be disabled (to ensure no side effect on other module unit test)
|
||||
|
||||
To enable cancel confirm wizard, please add System Parameter (ir.config_parameter) for each extended module.
|
||||
|
||||
For example,
|
||||
|
||||
* sale_cancel_confirm, add `sale.order.cancel_confirm_disable = False`
|
||||
* purchase_cancel_confirm, add `purchase.order.cancel_confirm_disable = False`
|
||||
|
|
@ -0,0 +1 @@
|
|||
* Kitti U. <kittiu@ecosoft.co.th>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
Many document model that already has cancel action may also want a confirm dialog with option to provide reason.
|
||||
|
||||
This module does not provide a functionality by itself but an abstract model
|
||||
to easily implement a confirm with reason wizard when cancel button is clicked.
|
||||
If reason is provided, it will be visible in form view.
|
||||
|
||||
**Note:** To be able to use this module in a new model you will need some
|
||||
development.
|
||||
|
||||
You can see implementation example as followings,
|
||||
|
||||
* `sale_cancel_confirm <https://github.com/OCA/sale-workflow>`_
|
||||
* `purchase_cancel_confirm <https://github.com/OCA/purchase-workflow>`_
|
||||
* `purchase_request_cancel_confirm <https://github.com/OCA/purchase-workflow>`_
|
||||
* `account_move_cancel_confirm <https://github.com/OCA/account-invoicing>`_
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_cancel_confirm,access_cancel_confirm,model_cancel_confirm,base.group_user,1,1,1,1
|
||||
|
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
|
|
@ -0,0 +1,448 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>Base Cancel Confirm</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
Despite the name, some widely supported CSS2 features are used.
|
||||
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="base-cancel-confirm">
|
||||
<h1 class="title">Base Cancel Confirm</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:ac67f451a2d77db32074340753f7ab30872dce3cf2d8d80108df9af61a228db5
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<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/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-ux/tree/16.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-16-0/server-ux-16-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&target_branch=16.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 confirm dialog with option to provide reason.</p>
|
||||
<p>This module does not provide a functionality by itself but an abstract model
|
||||
to easily implement a confirm with reason wizard when cancel button is clicked.
|
||||
If reason is provided, it will be visible in form view.</p>
|
||||
<p><strong>Note:</strong> To be able to use this module in a new model you will need some
|
||||
development.</p>
|
||||
<p>You can see implementation example as followings,</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference external" href="https://github.com/OCA/sale-workflow">sale_cancel_confirm</a></li>
|
||||
<li><a class="reference external" href="https://github.com/OCA/purchase-workflow">purchase_cancel_confirm</a></li>
|
||||
<li><a class="reference external" href="https://github.com/OCA/purchase-workflow">purchase_request_cancel_confirm</a></li>
|
||||
<li><a class="reference external" href="https://github.com/OCA/account-invoicing">account_move_cancel_confirm</a></li>
|
||||
</ul>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
|
||||
<p>By default, the cancel confirm will be disabled (to ensure no side effect on other module unit test)</p>
|
||||
<p>To enable cancel confirm wizard, please add System Parameter (ir.config_parameter) for each extended module.</p>
|
||||
<p>For example,</p>
|
||||
<ul class="simple">
|
||||
<li>sale_cancel_confirm, add <cite>sale.order.cancel_confirm_disable = False</cite></li>
|
||||
<li>purchase_cancel_confirm, add <cite>purchase.order.cancel_confirm_disable = False</cite></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20base_cancel_confirm%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Ecosoft</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Kitti U. <<a class="reference external" href="mailto:kittiu@ecosoft.co.th">kittiu@ecosoft.co.th</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org">
|
||||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
||||
</a>
|
||||
<p>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.</p>
|
||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||
<p><a class="reference external image-reference" href="https://github.com/kittiu"><img alt="kittiu" src="https://github.com/kittiu.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/16.0/base_cancel_confirm">OCA/server-ux</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import test_cancel_confirm
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class CancelConfirmTester(models.Model):
|
||||
_name = "cancel.confirm.tester"
|
||||
_description = "Cancel Confirm Tester"
|
||||
_inherit = ["base.cancel.confirm"]
|
||||
|
||||
_has_cancel_reason = "optional"
|
||||
|
||||
name = fields.Char()
|
||||
state = fields.Selection(
|
||||
selection=[
|
||||
("draft", "Draft"),
|
||||
("confirmed", "Confirmed"),
|
||||
("cancel", "Cancel"),
|
||||
],
|
||||
default="draft",
|
||||
)
|
||||
|
||||
def action_confirm(self):
|
||||
self.write({"state": "confirmed"})
|
||||
|
||||
def action_cancel(self):
|
||||
if not self.filtered("cancel_confirm"):
|
||||
return self.open_cancel_confirm_wizard()
|
||||
self.write({"state": "cancel"})
|
||||
|
||||
def action_draft(self):
|
||||
self.clear_cancel_confirm_data()
|
||||
self.write({"state": "draft"})
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
from lxml import etree
|
||||
from odoo_test_helper import FakeModelLoader
|
||||
|
||||
from odoo.tests import Form, common
|
||||
|
||||
|
||||
class TestCancelConfirm(common.TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
||||
cls.loader = FakeModelLoader(cls.env, cls.__module__)
|
||||
cls.loader.backup_registry()
|
||||
from .cancel_confirm_tester import CancelConfirmTester
|
||||
|
||||
cls.loader.update_registry((CancelConfirmTester,))
|
||||
cls.test_model = cls.env[CancelConfirmTester._name]
|
||||
cls.tester_model = cls.env["ir.model"].search(
|
||||
[("model", "=", "cancel.confirm.tester")]
|
||||
)
|
||||
cls.env["ir.config_parameter"].create(
|
||||
{"key": "cancel.confirm.tester.cancel_confirm_disable", "value": "False"}
|
||||
)
|
||||
# Access record:
|
||||
cls.env["ir.model.access"].create(
|
||||
{
|
||||
"name": "access.cancel.confirm.tester",
|
||||
"model_id": cls.tester_model.id,
|
||||
"perm_read": 1,
|
||||
"perm_write": 1,
|
||||
"perm_create": 1,
|
||||
"perm_unlink": 1,
|
||||
}
|
||||
)
|
||||
|
||||
cls.test_record = cls.test_model.create({"name": "DOC-001"})
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
cls.loader.restore_registry()
|
||||
return super().tearDownClass()
|
||||
|
||||
def test_01_cancel_confirm_tester(self):
|
||||
"""Cancel a document, I expect cancel_reason.
|
||||
Then, set to draft, I expect cancel_reason is deleted.
|
||||
"""
|
||||
self.test_record.action_confirm()
|
||||
# Click cance, cancel confirm wizard will open. Type in cancel_reason
|
||||
res = self.test_record.action_cancel()
|
||||
ctx = res.get("context")
|
||||
self.assertEqual(ctx["cancel_method"], "action_cancel")
|
||||
self.assertEqual(ctx["default_has_cancel_reason"], "optional")
|
||||
wizard = Form(self.env["cancel.confirm"].with_context(**ctx))
|
||||
wizard.cancel_reason = "Wrong information"
|
||||
wiz = wizard.save()
|
||||
# Confirm cancel on wizard
|
||||
wiz.confirm_cancel()
|
||||
self.assertEqual(self.test_record.cancel_reason, wizard.cancel_reason)
|
||||
self.assertEqual(self.test_record.state, "cancel")
|
||||
# Set to draft
|
||||
self.test_record.action_draft()
|
||||
self.assertEqual(self.test_record.cancel_reason, False)
|
||||
self.assertEqual(self.test_record.state, "draft")
|
||||
# Check set no cancel reason, reason should be False
|
||||
# wizard.has_cancel_reason = "no" Invisible field cant write
|
||||
wiz = wizard.save()
|
||||
# Confirm cancel on wizard
|
||||
wiz.confirm_cancel()
|
||||
self.assertTrue(self.test_record.cancel_reason)
|
||||
|
||||
def test_02_cancel_confirm_tester(self):
|
||||
self.test_record.action_confirm()
|
||||
res = self.test_record.action_cancel()
|
||||
ctx = res.get("context")
|
||||
# Check set no cancel reason, reason should be "no"
|
||||
ctx["default_has_cancel_reason"] = "no"
|
||||
wizard = Form(self.env["cancel.confirm"].with_context(**ctx))
|
||||
self.assertEqual(wizard.has_cancel_reason, "no")
|
||||
wiz = wizard.save()
|
||||
# Confirm cancel on wizard
|
||||
wiz.confirm_cancel()
|
||||
self.test_record.action_confirm()
|
||||
self.assertFalse(self.test_record.cancel_reason)
|
||||
|
||||
def test_view_automatic(self):
|
||||
# We need to add a view in order to test fields_view_get()
|
||||
self.env["ir.ui.view"].create(
|
||||
{
|
||||
"model": self.test_record._name,
|
||||
"name": "Demo view",
|
||||
"arch": """<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name" />
|
||||
</group>
|
||||
</sheet>
|
||||
</form>""",
|
||||
}
|
||||
)
|
||||
with Form(self.test_record) as f:
|
||||
form = etree.fromstring(f._view["arch"])
|
||||
self.assertTrue(form.xpath("//field[@name='cancel_confirm']"))
|
||||
self.assertTrue(form.xpath("//field[@name='cancel_reason']"))
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<template id="cancel_reason_template">
|
||||
<div>
|
||||
<group colspan="4" attrs="{'invisible':[('cancel_reason', '=', False)]}">
|
||||
<field name="cancel_confirm" invisible="1" />
|
||||
<field name="cancel_reason" readonly="1" />
|
||||
</group>
|
||||
</div>
|
||||
</template>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import cancel_confirm
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright 2020 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 CancelConfirm(models.TransientModel):
|
||||
_name = "cancel.confirm"
|
||||
_description = "Cancel Confirm"
|
||||
|
||||
cancel_reason = fields.Text()
|
||||
has_cancel_reason = fields.Selection(
|
||||
selection=[
|
||||
("no", "None"),
|
||||
("optional", "Optional"),
|
||||
("required", "Required"),
|
||||
],
|
||||
default="no",
|
||||
required=True,
|
||||
)
|
||||
|
||||
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})
|
||||
res = getattr(docs, cancel_method)()
|
||||
return res
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_cancel_confirm_wizard" model="ir.ui.view">
|
||||
<field name="name">Cancel Confirmation</field>
|
||||
<field name="model">cancel.confirm</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Cancel Confirmation">
|
||||
<h3>Are you sure to cancel this document?</h3>
|
||||
<group>
|
||||
<field name="has_cancel_reason" invisible="1" />
|
||||
<field
|
||||
name="cancel_reason"
|
||||
attrs="{'invisible': [('has_cancel_reason', '=', 'no')],
|
||||
'required': [('has_cancel_reason', '=', 'required')]}"
|
||||
/>
|
||||
</group>
|
||||
<footer>
|
||||
<button
|
||||
name="confirm_cancel"
|
||||
string="Confirm"
|
||||
type="object"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_cancel_confirm_wizard" model="ir.actions.act_window">
|
||||
<field name="name">Cancel Confirmation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">cancel.confirm</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_cancel_confirm_wizard" />
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
# Architecture
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
U[Users] -->|HTTP| V[Views and QWeb Templates]
|
||||
V --> C[Controllers]
|
||||
V --> W[Wizards – Transient Models]
|
||||
C --> M[Models and ORM]
|
||||
W --> M
|
||||
M --> R[Reports]
|
||||
DX[Data XML] --> M
|
||||
S[Security – ACLs and Groups] -. enforces .-> M
|
||||
|
||||
subgraph Base_cancel_confirm Module - base_cancel_confirm
|
||||
direction LR
|
||||
M:::layer
|
||||
W:::layer
|
||||
C:::layer
|
||||
V:::layer
|
||||
R:::layer
|
||||
S:::layer
|
||||
DX:::layer
|
||||
end
|
||||
|
||||
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
|
||||
```
|
||||
|
||||
Notes
|
||||
- Views include tree/form/kanban templates and report templates.
|
||||
- Controllers provide website/portal routes when present.
|
||||
- Wizards are UI flows implemented with `models.TransientModel`.
|
||||
- Data XML loads data/demo records; Security defines groups and access.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Configuration
|
||||
|
||||
Refer to Odoo settings for base_cancel_confirm. Configure related models, access rights, and options as needed.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Controllers
|
||||
|
||||
This module does not define custom HTTP controllers.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Dependencies
|
||||
|
||||
This addon depends on:
|
||||
|
||||
- base
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# FAQ
|
||||
|
||||
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
|
||||
- Q: How to enable? A: Start server with --addon base_cancel_confirm or install in UI.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Install
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-server-ux-base_cancel_confirm"
|
||||
# or
|
||||
uv pip install odoo-bringout-oca-server-ux-base_cancel_confirm"
|
||||
```
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Models
|
||||
|
||||
Detected core models and extensions in base_cancel_confirm.
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
```
|
||||
|
||||
Notes
|
||||
- Classes show model technical names; fields omitted for brevity.
|
||||
- Items listed under _inherit are extensions of existing models.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Overview
|
||||
|
||||
Packaged Odoo addon: base_cancel_confirm. Provides features documented in upstream Odoo 16 under this addon.
|
||||
|
||||
- Source: OCA/OCB 16.0, addon base_cancel_confirm
|
||||
- License: LGPL-3
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Reports
|
||||
|
||||
This module does not define custom reports.
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
# Security
|
||||
|
||||
Access control and security definitions in base_cancel_confirm.
|
||||
|
||||
## Access Control Lists (ACLs)
|
||||
|
||||
Model access permissions defined in:
|
||||
- **[ir.model.access.csv](../base_cancel_confirm/security/ir.model.access.csv)**
|
||||
- 1 model access rules
|
||||
|
||||
## Record Rules
|
||||
|
||||
Row-level security rules defined in:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Security Layers"
|
||||
A[Users] --> B[Groups]
|
||||
B --> C[Access Control Lists]
|
||||
C --> D[Models]
|
||||
B --> E[Record Rules]
|
||||
E --> F[Individual Records]
|
||||
end
|
||||
```
|
||||
|
||||
Security files overview:
|
||||
- **[ir.model.access.csv](../base_cancel_confirm/security/ir.model.access.csv)**
|
||||
- Model access permissions (CRUD rights)
|
||||
|
||||
Notes
|
||||
- Access Control Lists define which groups can access which models
|
||||
- Record Rules provide row-level security (filter records by user/group)
|
||||
- Security groups organize users and define permission sets
|
||||
- All security is enforced at the ORM level by Odoo
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Troubleshooting
|
||||
|
||||
- Ensure Python and Odoo environment matches repo guidance.
|
||||
- Check database connectivity and logs if startup fails.
|
||||
- Validate that dependent addons listed in DEPENDENCIES.md are installed.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Usage
|
||||
|
||||
Start Odoo including this addon (from repo root):
|
||||
|
||||
```bash
|
||||
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon base_cancel_confirm
|
||||
```
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# Wizards
|
||||
|
||||
Transient models exposed as UI wizards in base_cancel_confirm.
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
class CancelConfirm
|
||||
```
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
[project]
|
||||
name = "odoo-bringout-oca-server-ux-base_cancel_confirm"
|
||||
version = "16.0.0"
|
||||
description = "Base Cancel Confirm - Odoo addon"
|
||||
authors = [
|
||||
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
|
||||
]
|
||||
dependencies = [
|
||||
"odoo-bringout-oca-ocb-base>=16.0.0",
|
||||
"requests>=2.25.1"
|
||||
]
|
||||
readme = "README.md"
|
||||
requires-python = ">= 3.11"
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Office/Business",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/bringout/0"
|
||||
repository = "https://github.com/bringout/0"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.metadata]
|
||||
allow-direct-references = true
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["base_cancel_confirm"]
|
||||
|
||||
[tool.rye]
|
||||
managed = true
|
||||
dev-dependencies = [
|
||||
"pytest>=8.4.1",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue