Skip to content

[IMP] inventory: Improve stock info and UI in product form #887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 18.0
Choose a base branch
from

Conversation

arkp-odoo
Copy link

This change addresses UX consistency and operational safety for users managing inventory in multi-company environments. By conditionally disabling the "Quantity On Hand" field and hiding stock-related actions, we reduce the risk of unintended stock updates by users switching across companies.

Additionally, visual cues were introduced to help users interpret stock availability at a glance using decorations on forecast fields. Simplified labels and stat displays aim to streamline the interface and enhance clarity, especially for forecast-related buttons and values.

These updates prioritize user context awareness, clean visual hierarchy, and help prevent data inconsistencies in environments with multiple active companies.

This improvement refines the product template form view to offer better stock
visibility and user control, particularly for users operating in multi-company
environments. The default buttons such as Update Quantity On Hand and Print
Labels are hidden to reduce UI clutter and avoid confusion for non-storable or
consumable products. A computed field is_multicompany has been added to restrict
direct editing of stock quantities when the user is linked to multiple companies
helping maintain data consistency.

Additionally, the form now displays the current available quantity alongside its
unit of measure with a clear Update button, making it easier for users to
quickly act on stock changes. The Forecasted button label has also been
clarified with an inline quantity display. Visual decorations on the
virtual_available field indicate when stock is low or negative, allowing users
to identify stock issues at a glance. A custom server action has been added to
open the product replenish wizard, providing a fast and user-friendly way to
restock products. Overall, these changes streamline the inventory management
workflow and enhance the clarity and usability of the product form.
@robodoo
Copy link

robodoo commented Jul 24, 2025

Pull request status dashboard

Copy link

@maad-odoo maad-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR and commit title is not right.
As a new module is being added, it should be [ADD] instead of [IMP]
Also, the commit message and PR message is not structure properly.
Please follow the coding guidelines 🙏
Missing task id reference

@@ -0,0 +1 @@
from . import models

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing copyright statement
(throughout the whole diff)

def _compute_is_multicompany(self):
for record in self:
user = self.env.user
record.is_multicompany = len(user.company_ids) > 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use self.env.user directly as it used only once

Comment on lines +13 to +14
<xpath expr="//button[@invisible='not show_on_hand_qty_status_button']"
position="attributes">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<xpath expr="//button[@invisible='not show_on_hand_qty_status_button']"
position="attributes">
<xpath expr="//button[@invisible='not show_on_hand_qty_status_button']" position="attributes">

Comment on lines +18 to +19
<xpath expr="//field[@name='virtual_available']"
position='attributes'>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<xpath expr="//field[@name='virtual_available']"
position='attributes'>
<xpath expr="//field[@name='virtual_available']" position='attributes'>

Applies throughout the diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants