Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
6162 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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 :) ).



Awatar
Odrzuć
Najlepsza odpowiedź

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'):
        ....

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
cze 21
2974
0
lis 23
1611
0
sty 25
2901
0
maj 23
1878
0
maj 23
1543