콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3989 화면

I  need a custom search in product form based on some attribute name of products

Suppose My Product name is Apple black ABC 12345 .I know only some attributes from the products like black ABC .When I enter  black ABC  in the product search view it should shown related product wl shown based on my attribute name(black ABC,).How to create  a custom Search for this task

This is my code-----------

 <record id="product_template_search_custom_view" model="ir.ui.view">
            <field name="name">product.template.customsearch</field>
            <field name="model">product.template</field>
             <field name="inherit_id" ref="product.product_template_search_view"/>
             <field name="arch" type="xml">
             
             
              <xpath expr="/search/field[@name='name']" position="before">
                
               <field name="ean13" string="EAN 13 Baarcode" domain="[('sale_ok','=',1)]"/>
                  <field name="attribute_ield"/> #how to add that search
                 
             </xpath>
             
             
             
            </field>
        </record>

아바타
취소
베스트 답변

In Py class.. write a orm method called "name_search", in that you achieve the search however you want...

Refer for such methods in Standard objects, like res_partner etc..

아바타
취소
작성자

can you give one example..