Help

2

Extending the Product Search in Quotation and Sales Order

Avatar
Cetin

Hello together,

for creation a salesline or quotationline , for product selection the "Search More" Button can be used from the list. In the opened window "Search: Product" I would like add a field which I have added for the product.

I have activated the debug mode, but where I can customize the "Search More" View?

Best regards Cetin

Avatar
Discard
4 Answers
0
Avatar
Akhil P Sivan
Best Answer

Hi,

You can put the following code in your xml file:

<record id="multiprice_search_form_view_inherited" model="ir.ui.view">
<field name="name">multiprice.search.form.inherited</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product_multiprices.multiprice_search_form_view"/>
<field name="arch" type="xml">

<field name="name" position="after">
<field name="name" string="Your Search Term" filter_domain="[('your_field','ilike',self)]"/>

</field>
</field>
</record>

Here, your_field is the field you added in product.template model. Then it should appear in "Search more" as you expected in quotation or sale order lines


If you want to do this from front end, you may do the following:

Create a new view with following data and rest keep as default:

View Name: product.template.search.inherited

View Type: Search

Object: product.template

Inherited View: product.template.search

View inheritance mode: Extension View

Then under Architecture tab, put the following code:

<?xml version="1.0"?>
<field name="name" position="after">

<field name="name" string="Your Search Term" filter_domain="[('your_field','ilike',self)]"/>
</field>
Avatar
Discard
0
Avatar
Atul Arvind
Best Answer

Override the name_search method in case you need to extend the search for m2o type field.

You need to over ride the name_search method of product.product model.

  1. Inherit the model product.product
  2. Override the name_search method as you want.

Note: name_search method will return list with id and name like [(id, 'name')]

1 Comment
Avatar
Discard
Avatar
Jessica Dowd
-

How can I change it in the view? Do you know what the view's name is?