From f4e46b62d4f8d94bd4f9b5386a6fbc50bf6702ce Mon Sep 17 00:00:00 2001 From: Aungkokolin1997 Date: Wed, 23 Oct 2024 03:48:16 +0000 Subject: [PATCH] [ADD] product_view_inventory_no_search_default_my_account --- .../README.rst | 78 ++++ .../__init__.py | 1 + .../__manifest__.py | 12 + .../models/__init__.py | 1 + .../models/stock_quant.py | 15 + .../readme/CONTEXT.rst | 3 + .../readme/DESCRIPTION.rst | 1 + .../static/description/index.html | 420 ++++++++++++++++++ ..._view_inventory_no_search_default_my_count | 1 + .../setup.py | 6 + 10 files changed, 538 insertions(+) create mode 100644 product_view_inventory_no_search_default_my_count/README.rst create mode 100644 product_view_inventory_no_search_default_my_count/__init__.py create mode 100644 product_view_inventory_no_search_default_my_count/__manifest__.py create mode 100644 product_view_inventory_no_search_default_my_count/models/__init__.py create mode 100644 product_view_inventory_no_search_default_my_count/models/stock_quant.py create mode 100644 product_view_inventory_no_search_default_my_count/readme/CONTEXT.rst create mode 100644 product_view_inventory_no_search_default_my_count/readme/DESCRIPTION.rst create mode 100644 product_view_inventory_no_search_default_my_count/static/description/index.html create mode 120000 setup/product_view_inventory_no_search_default_my_count/odoo/addons/product_view_inventory_no_search_default_my_count create mode 100644 setup/product_view_inventory_no_search_default_my_count/setup.py diff --git a/product_view_inventory_no_search_default_my_count/README.rst b/product_view_inventory_no_search_default_my_count/README.rst new file mode 100644 index 000000000..20ffa1e5e --- /dev/null +++ b/product_view_inventory_no_search_default_my_count/README.rst @@ -0,0 +1,78 @@ +================================================= +Product View Inventory No Search Default My Count +================================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1176adbb981fec9b85986ae8501ba403c2b7b10d321c6d95f252fa0e9d5dd043 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fstock--logistics--warehouse-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-warehouse/tree/16.0/product_view_inventory_no_search_default_my_count + :alt: OCA/stock-logistics-warehouse +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-product_view_inventory_no_search_default_my_count + :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/stock-logistics-warehouse&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module removes the "My Counts" default filter from the inventory view. + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +Having the "My Counts" filter as a default for inventory users makes little sense +when your main use of the "On Hand" smart button of the product form is to simply display +the current stock situation. Not applying this filter by default saves users the hassle of removing it manually. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Quartile + +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/stock-logistics-warehouse `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_view_inventory_no_search_default_my_count/__init__.py b/product_view_inventory_no_search_default_my_count/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/product_view_inventory_no_search_default_my_count/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_view_inventory_no_search_default_my_count/__manifest__.py b/product_view_inventory_no_search_default_my_count/__manifest__.py new file mode 100644 index 000000000..f29f8b3bb --- /dev/null +++ b/product_view_inventory_no_search_default_my_count/__manifest__.py @@ -0,0 +1,12 @@ +# Copyright 2024 Quartile +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Product View Inventory No Search Default My Count", + "category": "Stock", + "version": "16.0.1.0.0", + "author": "Quartile, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "license": "AGPL-3", + "depends": ["stock"], + "installable": True, +} diff --git a/product_view_inventory_no_search_default_my_count/models/__init__.py b/product_view_inventory_no_search_default_my_count/models/__init__.py new file mode 100644 index 000000000..70f8e6c8d --- /dev/null +++ b/product_view_inventory_no_search_default_my_count/models/__init__.py @@ -0,0 +1 @@ +from . import stock_quant diff --git a/product_view_inventory_no_search_default_my_count/models/stock_quant.py b/product_view_inventory_no_search_default_my_count/models/stock_quant.py new file mode 100644 index 000000000..513a93ead --- /dev/null +++ b/product_view_inventory_no_search_default_my_count/models/stock_quant.py @@ -0,0 +1,15 @@ +# Copyright 2024 Quartile +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class StockQuant(models.Model): + _inherit = "stock.quant" + + @api.model + def action_view_inventory(self): + action = super().action_view_inventory() + if "search_default_my_count" in action.get("context", {}): + del action["context"]["search_default_my_count"] + return action diff --git a/product_view_inventory_no_search_default_my_count/readme/CONTEXT.rst b/product_view_inventory_no_search_default_my_count/readme/CONTEXT.rst new file mode 100644 index 000000000..a66dc4c75 --- /dev/null +++ b/product_view_inventory_no_search_default_my_count/readme/CONTEXT.rst @@ -0,0 +1,3 @@ +Having the "My Counts" filter as a default for inventory users makes little sense +when your main use of the "On Hand" smart button of the product form is to simply display +the current stock situation. Not applying this filter by default saves users the hassle of removing it manually. diff --git a/product_view_inventory_no_search_default_my_count/readme/DESCRIPTION.rst b/product_view_inventory_no_search_default_my_count/readme/DESCRIPTION.rst new file mode 100644 index 000000000..f061bb931 --- /dev/null +++ b/product_view_inventory_no_search_default_my_count/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module removes the "My Counts" default filter from the inventory view. diff --git a/product_view_inventory_no_search_default_my_count/static/description/index.html b/product_view_inventory_no_search_default_my_count/static/description/index.html new file mode 100644 index 000000000..45273e05e --- /dev/null +++ b/product_view_inventory_no_search_default_my_count/static/description/index.html @@ -0,0 +1,420 @@ + + + + + +Product View Inventory No Search Default My Count + + + +
+

Product View Inventory No Search Default My Count

+ + +

Beta License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runboat

+

This module removes the “My Counts” default filter from the inventory view.

+

Table of contents

+ +
+

Use Cases / Context

+

Having the “My Counts” filter as a default for inventory users makes little sense +when your main use of the “On Hand” smart button of the product form is to simply display +the current stock situation. Not applying this filter by default saves users the hassle of removing it manually.

+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Quartile
  • +
+
+
+

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/stock-logistics-warehouse project on GitHub.

+

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

+
+
+
+ + diff --git a/setup/product_view_inventory_no_search_default_my_count/odoo/addons/product_view_inventory_no_search_default_my_count b/setup/product_view_inventory_no_search_default_my_count/odoo/addons/product_view_inventory_no_search_default_my_count new file mode 120000 index 000000000..55ed26016 --- /dev/null +++ b/setup/product_view_inventory_no_search_default_my_count/odoo/addons/product_view_inventory_no_search_default_my_count @@ -0,0 +1 @@ +../../../../product_view_inventory_no_search_default_my_count \ No newline at end of file diff --git a/setup/product_view_inventory_no_search_default_my_count/setup.py b/setup/product_view_inventory_no_search_default_my_count/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/product_view_inventory_no_search_default_my_count/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)