Skip to content

Commit

Permalink
Merge branch '14.0' into TA#62879--precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
majouda authored Mar 4, 2024
2 parents 24d1c2c + 97d449a commit 8ac9e61
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"product_reference",
# "product_template_tags_stock_menu",
"product_reference_list_view",
"product_stock_read_access_actions",
"product_variant_button_complete_form",
"stock_barcode_upc",
],
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ COPY product_pricelist_direct_print_extended /mnt/extra-addons/product_pricelist
COPY product_purchase_order_link /mnt/extra-addons/product_purchase_order_link
COPY product_reference /mnt/extra-addons/product_reference
COPY product_reference_list_view /mnt/extra-addons/product_reference_list_view
COPY product_stock_read_access_actions /mnt/extra-addons/product_stock_read_access_actions
#COPY product_template_tags_stock_menu /mnt/extra-addons/product_template_tags_stock_menu
COPY product_variant_button_complete_form /mnt/extra-addons/product_variant_button_complete_form
COPY stock_barcode_upc /mnt/extra-addons/stock_barcode_upc
Expand Down
35 changes: 35 additions & 0 deletions product_stock_read_access_actions/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Product Stock Read Access Actions
=================================

Context:
--------

This module is a companion to the
`product_create_group <https://github.com/Numigi/odoo-product-addons/tree/14.0/product_create_group>`_ module.

Based onthe `base_extended_security <https://github.com/Numigi/odoo-base-addons/blob/14.0/base_extended_security/README.rst#action-buttons>`,

when a user has only read access to a specific model due to a Basic Rule, the action buttons on the form view are hidden.

After installing the module `product_create_group`, users with only Read access to Products and Product Templates will not see stock action buttons.

To allow these users to view the action buttons, we have added a hook provided by the `base_extended_security` module.


Description:
------------

As a user with group `Inventory/User` and with the `Manage Products and Variants` access unchecked.

I display the form view of a Product ou Product Variants, I am now able to see and click on the stock Smart Buttons.

.. image:: static/description/product_stock_smart_buttons.png


Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)

More information
----------------
* Meet us at https://bit.ly/numigi-com
4 changes: 4 additions & 0 deletions product_stock_read_access_actions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import models
16 changes: 16 additions & 0 deletions product_stock_read_access_actions/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
'name': 'Product Stock Read Access Actions',
'version': "14.0.1.0.0",
'author': 'Numigi',
'maintainer': 'Numigi',
'website': 'https://bit.ly/numigi-com',
'license': 'LGPL-3',
'category': 'stock, ',
'summary': 'Add access to product stock smart button.',
'depends': ['product_create_group', 'stock'],
'data': [],
'installable': True,
}
5 changes: 5 additions & 0 deletions product_stock_read_access_actions/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import product
from . import product_template
23 changes: 23 additions & 0 deletions product_stock_read_access_actions/models/product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).


from odoo import api, models


class ProductProduct(models.Model):
_inherit = "product.product"

@api.model
def get_read_access_actions(self):
res = super().get_read_access_actions()
additional_actions = [
"action_open_quants",
"action_product_forecast_report",
"action_view_stock_move_lines",
"action_view_orderpoints",
"action_open_product_lot",
"action_view_related_putaway_rules",
]
res.extend(additional_actions)
return res
24 changes: 24 additions & 0 deletions product_stock_read_access_actions/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).


from odoo import api, models


class ProductTemplate(models.Model):

_inherit = "product.template"

@api.model
def get_read_access_actions(self):
res = super().get_read_access_actions()
additional_actions = [
"action_open_quants",
"action_product_tmpl_forecast_report",
"action_view_stock_move_lines",
"action_view_orderpoints",
"action_open_product_lot",
"action_view_related_putaway_rules",
]
res.extend(additional_actions)
return res
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8ac9e61

Please sign in to comment.