Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
1858 Weergaven

Hello,

if I use the fiel "Vendor Product Code", how can I search for this number in the product search?



If I put this number in the search field and I pick any of the 3 search option it gives me no result, how can I search for this number?


thank you :)

Avatar
Annuleer
Auteur

thanks, but I don't have "Vendors" neither "Vendor Product Code" in the list of "add custom filters"... 

Beste antwoord

Hi there,

I needed to do the exact same thing, and figured out how following these steps:

  1. Create a view that inherits the Search View for product.template

2. Add the following code:
<data>

  <xpath expr="//search[1]/field[@name='name']" position="after">

    <field name="seller_ids" string="Vendor Part Number" filter_domain="[('seller_ids.product_code','ilike', self)]"/>

  </xpath>

</data>


This will give you a search option on the main products page. 

Avatar
Annuleer
Auteur

Hello Sanford,
thank you so much, this solution helped me a lot!
I have one more question: how do I set it up to search for the "Vendor Name"?

Hi Paul,

You can try the following addition:

<xpath expr="//search[1]/field[@name='name']" position="after">
<field name="seller_ids" string="Vendor Part Number" filter_domain="[('seller_ids.name','ilike', self)]"/>
</xpath>

I changed "seller_ids.product_code" to "seller_ids.name", which is the field for the Vendor on each pricelist entry. If this doesnt work, you can also try "seller_ids.name.name", which would specifically callout the Vendor's "Name" field.

I hope this helps!

Auteur

Thank you again!
It didn't immediately work, but after trying a bit this code works for both fields: vendor code + name:

<data>
<xpath expr="//search[1]/field[@name='name']" position="after">
<field name="seller_ids" string="LieferantenArt.Nummer2" filter_domain="[('seller_ids.product_code','ilike', self)]"/>
<field name="seller_ids" string="Lieferantenname" filter_domain="[('seller_ids.partner_id.name','ilike', self)]"/>
</xpath>
</data>

Beste antwoord

Hi Paul, 

Without Studio, you can use "Add custom filter" in the search bar and save the search. 

Vendors > Vendor Product Code       !=      (leave empty) 

This will show all products with a vendor product code. 

or

Vendors > Vendor Product Code       "=" or "contains"     (vendor product code) 

This will only show product(s) with the vendor product code entered. 

Avatar
Annuleer