Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2314 มุมมอง

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)]"/>





อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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)

 

อวตาร
ละทิ้ง
ผู้เขียน

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 18
44345
Remove Search Box on /shop page แก้ไขแล้ว
4
พ.ย. 23
3771
2
พ.ย. 23
3518
7
เม.ย. 21
21007
filter with related model field แก้ไขแล้ว
1
ต.ค. 20
5201