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

In my current OpenERP project all products have three part numbers - the customer's part number, the OEM part number and our internal part number. I was able to add another field for the OEM part number via a custom module without issue, but was wondering if it is possible to make that field searchable from the default search under Products, without having to select 'OEM Part Number' in Advanced Search. I thought it might have something to do with adding 'select=True' in the column definition, but that didn't seem to work. It would be even better if that field was also an option when entering the product name into a Sales Order. Thanks!

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

The search view has an XML definition, and you need to add the name of the field to it, the same way you added the new field to the XML definition of the form (or tree) view of products.

Look for product.product_search_form_view, inherit and add your new field:

<field name="YOUR_NEW_FIELD"/>

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

That was very helpful, Ray, thanks.

Yes in did.

Any tips on how to get custom fields in the "Advance Search" under the "Reporting" menu?

ผู้เขียน คำตอบที่ดีที่สุด

Hi Sudarsan, not sure what your level of familiarity is with custom openerp modules, but here is what my code looks like to inherit the product search form:


    <record id="product_search_form_view" model="ir.ui.view">
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<search string="Product">
<field name="x_EC_num"/>
<field name="x_cust_desc"/>
<field name="x_cust_num"/>
</search>
</field>
</record>

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

How to Inherit the product serch form.I tried but Iam not getting result .Iam Sudarsan new to Odoo. Any vedio is there to help for these process

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

Added an answer with my code, hope that helps.