From a3ea8255743c11b8bb8e19bebaa128eed7341941 Mon Sep 17 00:00:00 2001 From: krpat-odoo Date: Thu, 12 Feb 2026 18:55:27 +0530 Subject: [PATCH 1/2] [ADD] quantity_on_hand : Implemented the stat the button Show the forecast and the units on the stat button --- quantity_on_hand/__init__.py | 1 + quantity_on_hand/__manifest__.py | 11 +++++++++++ quantity_on_hand/models/__init__.py | 1 + quantity_on_hand/models/product_template.py | 19 +++++++++++++++++++ .../views/product_template_views.xml | 14 ++++++++++++++ 5 files changed, 46 insertions(+) create mode 100644 quantity_on_hand/__init__.py create mode 100644 quantity_on_hand/__manifest__.py create mode 100644 quantity_on_hand/models/__init__.py create mode 100644 quantity_on_hand/models/product_template.py create mode 100644 quantity_on_hand/views/product_template_views.xml diff --git a/quantity_on_hand/__init__.py b/quantity_on_hand/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/quantity_on_hand/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/quantity_on_hand/__manifest__.py b/quantity_on_hand/__manifest__.py new file mode 100644 index 00000000000..cafe388dd10 --- /dev/null +++ b/quantity_on_hand/__manifest__.py @@ -0,0 +1,11 @@ +{ + 'name': 'Quanity on Hand', + 'version': '1.0', + 'depends': ['stock','estate','estate_account'], + 'installable': True, + 'author': 'KRPAT', + 'data': [ + 'views/product_template_views.xml' + ], + 'license': 'LGPL-3' +} diff --git a/quantity_on_hand/models/__init__.py b/quantity_on_hand/models/__init__.py new file mode 100644 index 00000000000..e8fa8f6bf1e --- /dev/null +++ b/quantity_on_hand/models/__init__.py @@ -0,0 +1 @@ +from . import product_template diff --git a/quantity_on_hand/models/product_template.py b/quantity_on_hand/models/product_template.py new file mode 100644 index 00000000000..5025cf1d183 --- /dev/null +++ b/quantity_on_hand/models/product_template.py @@ -0,0 +1,19 @@ +from odoo import api, fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + is_multilocation = fields.Boolean(compute="_compute_is_multilocation") + + @api.depends("product_variant_ids.stock_quant_ids.location_id") + def _compute_is_multilocation(self): + for record in self: + internal_location_ids = { + loc.id + for loc in record.mapped( + "product_variant_ids.stock_quant_ids.location_id" + ) + if loc.usage == "internal" + } + record.is_multilocation = len(internal_location_ids) > 1 diff --git a/quantity_on_hand/views/product_template_views.xml b/quantity_on_hand/views/product_template_views.xml new file mode 100644 index 00000000000..e19570f3dcd --- /dev/null +++ b/quantity_on_hand/views/product_template_views.xml @@ -0,0 +1,14 @@ + + + + product.template.form.custom.inherit + product.template + + + + virtual_available < 0 + + + + + From 325908ca6104d1a8ef42c5d69bf1e46bccf7f8dd Mon Sep 17 00:00:00 2001 From: krpat-odoo Date: Mon, 16 Feb 2026 18:43:45 +0530 Subject: [PATCH 2/2] [ADD] Quantity On Hand : enable the Update button on track inventory Implement : Invisible if not multi-locations , visible on hover : Link to Hand Report --- quantity_on_hand/__manifest__.py | 16 ++++---- quantity_on_hand/models/product_template.py | 1 + .../views/product_template_views.xml | 38 ++++++++++++++++--- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/quantity_on_hand/__manifest__.py b/quantity_on_hand/__manifest__.py index cafe388dd10..ad879c1d0bd 100644 --- a/quantity_on_hand/__manifest__.py +++ b/quantity_on_hand/__manifest__.py @@ -1,11 +1,9 @@ { - 'name': 'Quanity on Hand', - 'version': '1.0', - 'depends': ['stock','estate','estate_account'], - 'installable': True, - 'author': 'KRPAT', - 'data': [ - 'views/product_template_views.xml' - ], - 'license': 'LGPL-3' + "name": "Quanity on Hand", + "version": "1.0", + "depends": ["stock", "product"], + "installable": True, + "author": "KRPAT", + "data": ["views/product_template_views.xml"], + "license": "LGPL-3", } diff --git a/quantity_on_hand/models/product_template.py b/quantity_on_hand/models/product_template.py index 5025cf1d183..8899f429a7b 100644 --- a/quantity_on_hand/models/product_template.py +++ b/quantity_on_hand/models/product_template.py @@ -16,4 +16,5 @@ def _compute_is_multilocation(self): ) if loc.usage == "internal" } + record.is_multilocation = len(internal_location_ids) > 1 diff --git a/quantity_on_hand/views/product_template_views.xml b/quantity_on_hand/views/product_template_views.xml index e19570f3dcd..584c806dcbc 100644 --- a/quantity_on_hand/views/product_template_views.xml +++ b/quantity_on_hand/views/product_template_views.xml @@ -1,13 +1,41 @@ - - product.template.form.custom.inherit + + + product.template.form.forecast.decor product.template - + - + virtual_available < 0 - + virtual_available == 0 + + + + + + + product.template.common.form.inherit + product.template + + + + + + + +