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

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 ?

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit