Skip to Content
Menu
This question has been flagged
3 Replies
6144 Views

I have seen this issue brought up in 2018 and 2019 without a sufficient answer. I hope some of you can help.

Intended behavior:

We have inventory users, that we need to be able to validate inventory. They are in charge of decentral locations (Warehouses) for which they are responsible for inventory checks and adjustments. However we do not want to give them full admin rights to the inventory module.


Actual behavior:

User presses "Validate" button on an inventory adjustment. Error comes up: "Something went wrong! Only a stock manager can validate an inventory adjustment."


Previously suggested solutions have failed:

  • "Try changing domain restrictions for the validate button"

    • Doesn't work. Also all users can see the validate button already.

  • "Try Editing the view from debug mode, changing the restrictions on the validate button ( <button name="action_validate" string="Validate Inventory" type="object" attrs="{'invisible': ['|', ('state', '!=', 'confirm'), ('line_ids', '!=', [])]}" groups="stock.group_stock_manager"/>) from groups="stock.group_stock_manager" to groups="stock.group_stock_user" or by removing that attribute altogether." 

    • This does not work either. 


  1. Is there any way this can be done in 13e?


  1. And if not, can someone suggest a workaround that does not give all our inventory users full editing rights across the platform?

    1. Can we duplicate the admin role, and create a restricted version of this?

    2. Any other ideas?

Avatar
Discard
Best Answer

i think the easiest way can be: settings/user groups. add line for adjustment for this.


stock.valuation.adjustment.lines - object - Valuation Adjustment Lines (but test before production :) ).



Avatar
Discard
Best Answer

You need to override 'action_validate' function in Inventory class and make sure that 'group_stock_user' is in the check condition. Other than that,  group_stock_user group also needs to have account.move read access. This can be done via 

ir.model.access.csv

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_move_stock_user,account.move,account.model_account_move,stock.group_stock_user,1,0,0,0

stock_inventory.py

    def action_validate(self):

if not self.exists():

return

self.ensure_one()

if not self.user_has_groups('stock.group_stock_manager, stock.group_stock_user'):
        ....

Avatar
Discard
Best Answer

any command or any way to finish or validate my all SFMO and FGMO?

Avatar
Discard
Related Posts Replies Views Activity
0
Jun 21
2929
0
Nov 23
1576
0
Jan 25
2846
0
May 23
1858
0
May 23
1517