diff --git a/account_invoice_restrict_linked_so/README.rst b/account_invoice_restrict_linked_so/README.rst new file mode 100644 index 00000000000..819fb63e4ed --- /dev/null +++ b/account_invoice_restrict_linked_so/README.rst @@ -0,0 +1,87 @@ +================================ +Restrict Invoice created from SO +================================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-OCA%2Faccount--invoicing-lightgray.png?logo=github + :target: https://github.com/OCA/account-invoicing/tree/14.0/account_invoice_restrict_linked_so + :alt: OCA/account-invoicing +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-invoicing-14-0/account-invoicing-14-0-account_invoice_restrict_linked_so + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/95/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Restricts editing the Product, Quantity and Unit Price columns for invoice lines that originated in Sales Orders. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +On a Sales Order, an Invoice can be generated. + +On the Invoice generated from a Sales Orders, for the lines generated from the SO, the Product, Quantity and Unit Price fields should not be editable. + +Changing these requires deleting (or cancelling) the draft invoice, correcting the data in the source Sales Order, and then redoing the Invoice creation. + +Note that other columns can be edited, such as taxes or accounts, and that additional lines could be manually added and fully editable. + +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 +~~~~~~~ + +* Open Source Integrators + +Contributors +~~~~~~~~~~~~ + +* `Open Source Integrators `: + + * Daniel Reis + * Chandresh Thakkar + +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. + +This module is part of the `OCA/account-invoicing `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_invoice_restrict_linked_so/__init__.py b/account_invoice_restrict_linked_so/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/account_invoice_restrict_linked_so/__manifest__.py b/account_invoice_restrict_linked_so/__manifest__.py new file mode 100644 index 00000000000..c6c00d47204 --- /dev/null +++ b/account_invoice_restrict_linked_so/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright (C) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Restrict Invoice created from SO", + "summary": "Restricts editing the Product, Quantity and Unit Price " + "columns for invoice lines that originated in Sales Orders.", + "version": "15.0.1.0.1", + "category": "Accounting", + "author": "Open Source Integrators, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-invoicing", + "license": "AGPL-3", + "depends": ["sale_management"], + "data": [ + "views/account_move.xml", + ], + "installable": True, + "maintainer": "dreispt", +} diff --git a/account_invoice_restrict_linked_so/i18n/account_invoice_restrict_linked_so.pot b/account_invoice_restrict_linked_so/i18n/account_invoice_restrict_linked_so.pot new file mode 100644 index 00000000000..4d8b20f912f --- /dev/null +++ b/account_invoice_restrict_linked_so/i18n/account_invoice_restrict_linked_so.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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" diff --git a/account_invoice_restrict_linked_so/i18n/sl.po b/account_invoice_restrict_linked_so/i18n/sl.po new file mode 100644 index 00000000000..f44e85edf6a --- /dev/null +++ b/account_invoice_restrict_linked_so/i18n/sl.po @@ -0,0 +1,15 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3;\n" diff --git a/account_invoice_restrict_linked_so/readme/CONTRIBUTORS.rst b/account_invoice_restrict_linked_so/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..b7af586b0b2 --- /dev/null +++ b/account_invoice_restrict_linked_so/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Open Source Integrators `: + + * Daniel Reis + * Chandresh Thakkar diff --git a/account_invoice_restrict_linked_so/readme/DESCRIPTION.rst b/account_invoice_restrict_linked_so/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..259fe6771cd --- /dev/null +++ b/account_invoice_restrict_linked_so/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Restricts editing the Product, Quantity and Unit Price columns for invoice lines that originated in Sales Orders. diff --git a/account_invoice_restrict_linked_so/readme/USAGE.rst b/account_invoice_restrict_linked_so/readme/USAGE.rst new file mode 100644 index 00000000000..384d61d1e12 --- /dev/null +++ b/account_invoice_restrict_linked_so/readme/USAGE.rst @@ -0,0 +1,7 @@ +On a Sales Order, an Invoice can be generated. + +On the Invoice generated from a Sales Orders, for the lines generated from the SO, the Product, Quantity and Unit Price fields should not be editable. + +Changing these requires deleting (or cancelling) the draft invoice, correcting the data in the source Sales Order, and then redoing the Invoice creation. + +Note that other columns can be edited, such as taxes or accounts, and that additional lines could be manually added and fully editable. diff --git a/account_invoice_restrict_linked_so/static/description/icon.png b/account_invoice_restrict_linked_so/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/account_invoice_restrict_linked_so/static/description/icon.png differ diff --git a/account_invoice_restrict_linked_so/static/description/index.html b/account_invoice_restrict_linked_so/static/description/index.html new file mode 100644 index 00000000000..4c91da6a96c --- /dev/null +++ b/account_invoice_restrict_linked_so/static/description/index.html @@ -0,0 +1,431 @@ + + + + + + +Restrict Invoice created from SO + + + +
+

Restrict Invoice created from SO

+ + +

Beta License: AGPL-3 OCA/account-invoicing Translate me on Weblate Try me on Runbot

+

Restricts editing the Product, Quantity and Unit Price columns for invoice lines that originated in Sales Orders.

+

Table of contents

+ +
+

Usage

+

On a Sales Order, an Invoice can be generated.

+

On the Invoice generated from a Sales Orders, for the lines generated from the SO, the Product, Quantity and Unit Price fields should not be editable.

+

Changing these requires deleting (or cancelling) the draft invoice, correcting the data in the source Sales Order, and then redoing the Invoice creation.

+

Note that other columns can be edited, such as taxes or accounts, and that additional lines could be manually added and fully editable.

+
+
+

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

+
    +
  • Open Source Integrators
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/account-invoicing project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_invoice_restrict_linked_so/views/account_move.xml b/account_invoice_restrict_linked_so/views/account_move.xml new file mode 100644 index 00000000000..1cbbd7e99b7 --- /dev/null +++ b/account_invoice_restrict_linked_so/views/account_move.xml @@ -0,0 +1,39 @@ + + + + + account.move.form.inherit + account.move + + + + + + + {'readonly':[('sale_line_ids','!=',[])]} + + + {'readonly':[('sale_line_ids','!=',[])]} + + + {'readonly':[('sale_line_ids','!=',[])]} + + + + + diff --git a/setup/account_invoice_restrict_linked_so/odoo/addons/account_invoice_restrict_linked_so b/setup/account_invoice_restrict_linked_so/odoo/addons/account_invoice_restrict_linked_so new file mode 120000 index 00000000000..0abb545c48e --- /dev/null +++ b/setup/account_invoice_restrict_linked_so/odoo/addons/account_invoice_restrict_linked_so @@ -0,0 +1 @@ +../../../../account_invoice_restrict_linked_so \ No newline at end of file diff --git a/setup/account_invoice_restrict_linked_so/setup.py b/setup/account_invoice_restrict_linked_so/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/account_invoice_restrict_linked_so/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)