feat: Upgrade module to Odoo 19, updating manifest version and adapting product view inheritance to hide the update quantity button.

This commit is contained in:
Suherdy Yacob 2026-01-20 16:02:08 +07:00
parent 3061451097
commit 494cba631e
5 changed files with 18 additions and 27 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
# Python
__pycache__/
*.py[cod]
*$py.class
# OS
.DS_Store
Thumbs.db
# Editor
.vscode/
.idea/
# Odoo
*.pot

0
README.rst Normal file → Executable file
View File

0
__init__.py Normal file → Executable file
View File

2
__manifest__.py Normal file → Executable file
View File

@ -1,6 +1,6 @@
{
'name': 'Hide Update Quantity Button',
'version': '18.0.1.0.0',
'version': '19.0.1.0.0',
'category': 'Inventory',
'summary': 'Hide Update Quantity button for non-ERP managers',
'description': """

28
views/product_views.xml Normal file → Executable file
View File

@ -4,33 +4,9 @@
<record id="product_template_form_view_procurement_button_inherit" model="ir.ui.view">
<field name="name">product.template.form.view.procurement.button.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
<field name="inherit_id" ref="stock.view_template_property_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_update_quantity_on_hand']" position="attributes">
<attribute name="groups">base.group_erp_manager</attribute>
</xpath>
</field>
</record>
<!-- Inherit the product form view to modify the Update Quantity button visibility -->
<record id="product_form_view_procurement_button_inherit" model="ir.ui.view">
<field name="name">product.form.view.procurement.button.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="stock.product_form_view_procurement_button"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_update_quantity_on_hand']" position="attributes">
<attribute name="groups">base.group_erp_manager</attribute>
</xpath>
</field>
</record>
<!-- Inherit the easy edit product view to modify the Update Quantity button visibility -->
<record id="product_product_view_form_easy_inherit_stock_inherit" model="ir.ui.view">
<field name="name">product.product.view.form.easy.inherit.stock.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="stock.product_product_view_form_easy_inherit_stock"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_update_quantity_on_hand']" position="attributes">
<xpath expr="//a[@name='action_open_quants']" position="attributes">
<attribute name="groups">base.group_erp_manager</attribute>
</xpath>
</field>