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.

1

How to remove can be sold filter in product of openerp

By
Thazin Khaing
on 12/24/13, 6:36 AM 2,780 views

I want to remove can be sold filter in product and want to add next default filter for product .what should i do? Any body answer me...

Inherit the search view of product and replace that filter with blank.

Anil R. Kesariya
on 12/24/13, 7:12 AM

Like this....<xpath expr="/search/filter[@name='filter_to_sell']" position="replace"> <filter/>

Thazin Khaing
on 12/24/13, 7:16 AM

ok....How to add next default filter

Thazin Khaing
on 12/24/13, 7:17 AM
5

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 12/24/13, 7:47 AM

It's just overview how you can inherit the search view and put new filter default,

first inherit the search view in which your filter resides like,

<record id="inherited_product_search_form_view" model="ir.ui.view">
            <field name="name">product.search.form.inherit</field>
            <field name="model">product.product</field>
            <field name="type">search</field>
            <field name="inherit_id" ref="product.product_search_form_view"/>
            <field name="arch" type="xml">
                <xpath expr="//filter[string='can be sold']" position= 'replace'><!--need to find the x-path -->
                    <filter string="Default filter" name="new_filter" icon="terp-accessories-archiver-minus" domain="[NEW DOMAIN]"/>
                </xpath>
            </field>
            </record>

then you need to update the action like

<record id="product.product_normal_action_sell" model="ir.actions.act_window">
    <field name="name">Products</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">product.product</field>
    <field name="view_mode">tree,form,kanban</field>
    <field name="view_type">form</field>
    <field name="context">{"search_default_new_filter":1}</field>
    <field name="view_id" ref="product_product_tree_view"/>  
    <field name="search_view_id" ref="product_search_form_view"/>            
    <field name="help">You must define a Product for everything you buy or sell. Products can be raw materials, stockable products, consumables or services. The Product form contains detailed information about your products related to procurement logistics, sales price, product category, suppliers and so on.</field>
</record>

Hope This will help!

Thanks a lot....I OK

Thazin Khaing
on 12/26/13, 4:58 AM
0
Susai
On 1/5/16, 2:34 AM

Inherit  product search view like this::


</record>

</field>

</xpath> 

<xpath expr="//filter[@name='filter_to_sell']" position= 'replace'>

<field name="arch" type="xml"> 

<field name="inherit_id" ref="product.product_template_search_view"/>

<field name="type">search</field> 

<field name="model">product.template</field>

<field name="name">product.search.form.inherit</field> 

<record id="inherited_product_search_form_view" model="ir.ui.view">


Then the action is just remove the context

<record id="product.product_template_action" model="ir.actions.act_window">

<field name="name">Products</field>

<field name="type">ir.actions.act_window</field>

<field name="res_model">product.template</field>

<field name="view_mode">kanban,tree,form</field>

<field name="view_type">form</field>

<field name="view_id" ref="product.product_template_kanban_view"/>

</record>

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: 12/24/13, 6:36 AM
Seen: 2780 times
Last updated: 1/5/16, 2:34 AM