Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

Extending the Product Search in Quotation and Sales Order

By
Cetin
on 1/1/14, 3:56 PM 1,359 views

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

0

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 11/12/15, 8:21 AM

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>
0

Atul Arvind

--Atul Arvind--
1854
| 3 3 5
India
--Atul Arvind--

Hello, 

I am odoo Enthusiast/Consultant from Baroda, Gujarat, India. Working with odoo from v5 to v9 and other opensource technology since 4+ years. Having Strong Expertise in

Requirement gathering & Gap Analysis

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration

Implementation

I am also active on StackOverflow.

or 


Atul Arvind
On 1/1/14, 4:14 PM

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')]

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

Limitless Virtual Enterprise, Jessica Dowd
on 11/12/15, 4:18 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 1/1/14, 3:56 PM
Seen: 1359 times
Last updated: 11/12/15, 8:25 AM