跳至內容
選單
此問題已被標幟
3 回覆
756 瀏覽次數

Hello,

When i click on Inventory module, i've got all warehouses displayed.

I want a default filter to display only stock.picking.type whose warehouse_id = the default warehouse (property_warehouse_id) of the current user

I tried to add the following filter in the search view but it doesn't work

filter string="Mon Entrepôt" name="my_warehouse" domain="[('warehouse_id', '=', user.property_warehouse_id.id)]"


I tried to change user with uid, to add .id at the end or not, but nothing works

Is anybody has an idea ?

頭像
捨棄
最佳答案

It is possible to do this in Odoo Studio?

  1. Creating the custom field (ManyToMany)
  2. How has to be the domain? 

​I try with [('stock.picking.type.warehouse_id.x_studio_warehouse_users.id', '=' , user_id.id)] and does not work.


Cheers

頭像
捨棄
最佳答案

You need to add custom fields(res.users) on the stock picking type and I’ve already implemented them for me. I will share the details with you for review. You can try it on your side, I hope this will be helpful.

// PYTHON CODE

// Search View Code

// Action Context Pass Value

頭像
捨棄
最佳答案

Hi Vincent, 

I am also met with the same challenge as per your question. 

May I know whether you have found a solution for this?

Thank you.

頭像
捨棄