Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2797 Widoki

In odoo sales-->> products default loaded can be sold products.But when I close the can be sold filter the other products automatically loaded .



How to prevent loading other products?



<record id="product.product_template_action_all" 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="domain">[('sale_ok','=',True)]</field>
    <field name="search_view_id" ref="product.product_template_search_view"/>
    <field name="context">{}</field>
    <field name="help" type="html">
        <p class="oe_view_nocontent_create">
            Click to define a new product.
        </p>
    </field>
</record>

I tried like this it will not work.

How to fix this problem??

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

You are not getting the required result on applying the domain is that you have selected the wrong record.Add the domain in the record with id product_template_action.

<record id="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_template_kanban_view"/>
<field name="domain">[('sale_ok','=',True)]</field>
<field name="context">{"search_default_filter_to_sell":1}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product.
</p><p>
You must define a product for everything you sell, whether it's a physical product, a consumable or a service you offer to customers.
</p><p>
The product form contains information to simplify the sale process: price, notes in the quotation, accounting data, procurement methods, etc.
</p>
</field>
</record>

Thanks

Awatar
Odrzuć
Autor

Thanks for the answer.It works correctly

Powiązane posty Odpowiedzi Widoki Czynność
0
maj 17
2528
1
lip 19
4379
0
sie 17
2904
1
lut 17
7159
0
lut 17
3279