İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4497 Görünümler

I have read a lot of examples on how to create search view and add fields.

I have created other inheritance and it works. It seems that search view is resisting. Could someone help me understand why the following code does not work?

Using debug mode, it will show under "Inherited Views", but a strange thing is that the screen comes out....abnormal

search or filter does not work




exproduct.nh_product.template_search_maker_stock
product.template
primary




filter_domain="['|', ('acs_product_factory_reference', 'ilike', self),
('seller_ids.product_code', 'ilike', self)]" />
context="{'acs_product_factory_reference': self}" filter_domain="[]"/>











I have tried everything without solution

Help would be much appreciated

Avatar
Vazgeç
Üretici

proper code is:
<record id="nh_product_template_search_form_view_maker_stock" model="ir.ui.view">
<field name="name">exproduct.nh_product.template_search_maker_stock</field>
<field name="model">product.template</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="stock.product_template_search_form_view_stock"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='attribute_line_ids']" position="after">
<separator/>
<field name="seller_ids" string="Supplier" context="{'seller_ids.product_code':self}"
filter_domain="['|', ('acs_product_factory_reference', 'ilike', self),
('seller_ids.product_code', 'ilike', self)]" />
<field name="acs_product_factory_reference" string="Maker"
context="{'acs_product_factory_reference': self}" filter_domain="[]"/>
</xpath>
<xpath expr="//search//filter[@name='real_stock_available']" position="before">
<separator/>
<filter name="nh_filter_with_stock" string="Has Stock" domain="[('acs_product_stock','&gt;',0)]"/>
<filter name="nh_filter_without_stock" string="Without Stock" domain="[('acs_product_stock', '&lt;=', 0)]"/>
</xpath>
</field>
</record>

Üretici En İyi Yanıt

Proper code of line:
<field name="mode">primary>

should be:
<field name="mode">extension>

By default, it should be set to extension as inherit_id is used,
but I was required to set it "manually".

Once that changed, the search view was recognized and it would work.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Kas 24
4207
2
Tem 23
3591
0
Ara 15
3141
1
Oca 24
1796
2
Ara 23
1591