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

I need to filter by warehouse inside products tree view. I did this but no changes happended, any help: 


xml version="1.0" encoding="UTF-8" ?>


id="view_product_filter_inherit" model="ir.ui.view">
name="name">view.move.search.inherit
name="model">product.template
name="inherit_id" ref="product.product_template_search_view"/>
name="arch" type="xml">
expr="//search" position="inside">
name="location_id" string="Product Warehouse" filter_domain="[('location_id.name', 'ilike', self)]"/>





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

You can't use location_id field in the search view because it's store=False

Go To stock > models > product.py in that find class ProductTemplate here you will get location_id field declaration

location_id = fields.Many2one('stock.location', 'Location', store=False)

 

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

What should I use then? Can you help me with it please or provide a piece of code?

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 18
44318
4
thg 11 23
3732
2
thg 11 23
3473
7
thg 4 21
20951
1
thg 10 20
5180