-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[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
base: 18.0
Are you sure you want to change the base?
Conversation
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
<xpath expr="//button[@invisible='not show_on_hand_qty_status_button']" | ||
position="attributes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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"> |
<xpath expr="//field[@name='virtual_available']" | ||
position='attributes'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<xpath expr="//field[@name='virtual_available']" | |
position='attributes'> | |
<xpath expr="//field[@name='virtual_available']" position='attributes'> |
Applies throughout the diff
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.