Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
6166 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
čvn 21
2974
0
lis 23
1612
0
led 25
2907
0
kvě 23
1881
0
kvě 23
1545