Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5682 Lượt xem

Hi

User group "Inventory/Administrator" can, via product smart button, update product quantity in field "inventory_quantity". I'm trying to give that access to user group "Inventory/User". However, even though I give that group exactly the same access rights as Administrator, I'm not able to update product quantity. Somehow the field "inventory_quantity" is not visible for User, instead, field "available_quantity" is shown. Why is that?


Does anyone have any idea how I can give product quantity update rights for group "Inventory/User"?


//Rickard

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can't see the field  inventory_quantity because its only shown for Inventory Admin group, see the definition of the field:

inventory_quantity = fields.Float('Inventoried Quantity', compute='_compute_inventory_quantity',inverse='_set_inventory_quantity', groups='stock.group_stock_manager')


odoo/stock_quant.py at 14.0 · odoo/odoo (github.com)

You need to override it to add Inventory User group 

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks CorTex.
It seems like this override can't be done via xml, is that correct?

No you can do it through python

Câu trả lời hay nhất

I did this by updating the following models to check if user has  stock.group_stock_user or not

'product.product'  action_open_quants function 

'stock.quant'  _is_inventory_mode function and  inventory_quantity variable

also the button needs to have the group in the groups attribute as well.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 10 24
2314
3
thg 7 22
6488
1
thg 8 25
1028
1
thg 6 25
888
1
thg 6 25
912