-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '14.0' into TA#62879--precommit
- Loading branch information
Showing
10 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
24
product_stock_read_access_actions/models/product_template.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Binary file added
BIN
+88.3 KB
...ct_stock_read_access_actions/static/description/product_stock_smart_buttons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.