From f5e79f3c1d7f072827fff3e0eb75cc309cc0c72c Mon Sep 17 00:00:00 2001 From: "Tatsuki Kanda (Quratile)" <101688144+kanda999@users.noreply.github.com> Date: Fri, 18 Aug 2023 18:36:12 +0900 Subject: [PATCH] [3665][ADD] purchase_create_invoice_restrict (#41) * [3665][ADD] purchase_create_invoice_restrict --- purchase_create_invoice_restrict/README.rst | 54 +++ .../__manifest__.py | 13 + purchase_create_invoice_restrict/i18n/ja.po | 21 + .../readme/DESCRIPTION.rst | 3 + .../security/purchase_security.xml | 7 + .../static/description/index.html | 408 ++++++++++++++++++ .../views/purchase_order_views.xml | 50 +++ .../addons/purchase_create_invoice_restrict | 1 + .../purchase_create_invoice_restrict/setup.py | 6 + 9 files changed, 563 insertions(+) create mode 100644 purchase_create_invoice_restrict/README.rst create mode 100644 purchase_create_invoice_restrict/__manifest__.py create mode 100644 purchase_create_invoice_restrict/i18n/ja.po create mode 100644 purchase_create_invoice_restrict/readme/DESCRIPTION.rst create mode 100644 purchase_create_invoice_restrict/security/purchase_security.xml create mode 100644 purchase_create_invoice_restrict/static/description/index.html create mode 100644 purchase_create_invoice_restrict/views/purchase_order_views.xml create mode 120000 setup/purchase_create_invoice_restrict/odoo/addons/purchase_create_invoice_restrict create mode 100644 setup/purchase_create_invoice_restrict/setup.py diff --git a/purchase_create_invoice_restrict/README.rst b/purchase_create_invoice_restrict/README.rst new file mode 100644 index 00000000..7ef17f4a --- /dev/null +++ b/purchase_create_invoice_restrict/README.rst @@ -0,0 +1,54 @@ +================================ +Purchase Create Invoice Restrict +================================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-qrtl%2Faxls--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/axls-custom/tree/16.0/purchase_create_invoice_restrict + :alt: qrtl/axls-custom + +|badge1| |badge2| |badge3| + +This module adds a new group group_create_bill_allowed, and hides "Create Bill" button of the purchase order form for users without group_account_invoice or group_create_bill_allowed. + +This functionality intends to prevent the situation where purchase users accidentally create vendor bills from purchase orders, when bills are supposed to be created by authorized users. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Quartile Limited + +Maintainers +~~~~~~~~~~~ + +This module is part of the `qrtl/axls-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/purchase_create_invoice_restrict/__manifest__.py b/purchase_create_invoice_restrict/__manifest__.py new file mode 100644 index 00000000..2b0c47f6 --- /dev/null +++ b/purchase_create_invoice_restrict/__manifest__.py @@ -0,0 +1,13 @@ +# Copyright 2023 Quartile Limited +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Purchase Create Invoice Restrict", + "version": "16.0.1.0.0", + "author": "Quartile Limited", + "website": "https://www.quartile.co", + "category": "Purchase", + "license": "AGPL-3", + "depends": ["purchase"], + "data": ["views/purchase_order_views.xml", "security/purchase_security.xml"], + "installable": True, +} diff --git a/purchase_create_invoice_restrict/i18n/ja.po b/purchase_create_invoice_restrict/i18n/ja.po new file mode 100644 index 00000000..fcc238cf --- /dev/null +++ b/purchase_create_invoice_restrict/i18n/ja.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_create_invoice_restrict +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-16 08:45+0000\n" +"PO-Revision-Date: 2023-08-16 08:45+0000\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: purchase_create_invoice_restrict +#: model:res.groups,name:purchase_create_invoice_restrict.group_create_bill_allowed +msgid "Allow Bill Creation" +msgstr "仕入先請求書作成可能" diff --git a/purchase_create_invoice_restrict/readme/DESCRIPTION.rst b/purchase_create_invoice_restrict/readme/DESCRIPTION.rst new file mode 100644 index 00000000..8f1bfedd --- /dev/null +++ b/purchase_create_invoice_restrict/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module adds a new group group_create_bill_allowed, and hides "Create Bill" button of the purchase order form for users without group_account_invoice or group_create_bill_allowed. + +This functionality intends to prevent the situation where purchase users accidentally create vendor bills from purchase orders, when bills are supposed to be created by authorized users. diff --git a/purchase_create_invoice_restrict/security/purchase_security.xml b/purchase_create_invoice_restrict/security/purchase_security.xml new file mode 100644 index 00000000..1e9883f9 --- /dev/null +++ b/purchase_create_invoice_restrict/security/purchase_security.xml @@ -0,0 +1,7 @@ + + + + Allow Bill Creation + + + diff --git a/purchase_create_invoice_restrict/static/description/index.html b/purchase_create_invoice_restrict/static/description/index.html new file mode 100644 index 00000000..bcb515e7 --- /dev/null +++ b/purchase_create_invoice_restrict/static/description/index.html @@ -0,0 +1,408 @@ + + + + + + +Purchase Create Invoice Restrict + + + +
+

Purchase Create Invoice Restrict

+ + +

Beta License: AGPL-3 qrtl/axls-custom

+

This module adds a new group group_create_bill_allowed, and hides “Create Bill” button of the purchase order form for users without group_account_invoice or group_create_bill_allowed.

+

This functionality intends to prevent the situation where purchase users accidentally create vendor bills from purchase orders, when bills are supposed to be created by authorized users.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Quartile Limited
  • +
+
+
+

Maintainers

+

This module is part of the qrtl/axls-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/purchase_create_invoice_restrict/views/purchase_order_views.xml b/purchase_create_invoice_restrict/views/purchase_order_views.xml new file mode 100644 index 00000000..cf01ec8c --- /dev/null +++ b/purchase_create_invoice_restrict/views/purchase_order_views.xml @@ -0,0 +1,50 @@ + + + + purchase.order.form + purchase.order + + + + purchase_create_invoice_restrict.group_create_bill_allowed,account.group_account_invoice + + + purchase_create_invoice_restrict.group_create_bill_allowed,account.group_account_invoice + + + + + purchase.order.inherit.purchase.order.tree + purchase.order + + + + purchase_create_invoice_restrict.group_create_bill_allowed,account.group_account_invoice + + + + + purchase.order.view.tree + purchase.order + + + + purchase_create_invoice_restrict.group_create_bill_allowed,account.group_account_invoice + + + + diff --git a/setup/purchase_create_invoice_restrict/odoo/addons/purchase_create_invoice_restrict b/setup/purchase_create_invoice_restrict/odoo/addons/purchase_create_invoice_restrict new file mode 120000 index 00000000..5f796fb8 --- /dev/null +++ b/setup/purchase_create_invoice_restrict/odoo/addons/purchase_create_invoice_restrict @@ -0,0 +1 @@ +../../../../purchase_create_invoice_restrict \ No newline at end of file diff --git a/setup/purchase_create_invoice_restrict/setup.py b/setup/purchase_create_invoice_restrict/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/purchase_create_invoice_restrict/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)