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

This domain probelm in a function not in view.

domain_before=(('type', '=', 'purchase')) is there, i want to append one more domain domain_append_1=('type','=','general') with "|" operator using domain.append() function.

Avatar
Annuleer
Beste antwoord

Purchase Order xml file override and add your domain and also python init file add depends purchase module.

Example,

<record model="ir.ui.view" id="purchase_order_domin_form">
    <field name="name">purchase.order.form.domain</field>
    <field name="model">purchase.order</field>
    <field name="inherit_id" ref="purchase.purchase_order_form"/>
    <field name="arch" type="xml">
      <xpath expr="//field[@name='pricelist_id']" position="replace">
        <field domain="['|',('type','=','purchase'),('type','=','general')]" name="pricelist_id" groups="product.group_purchase_pricelist" on_change="onchange_pricelist(pricelist_id, context)"/>
      </xpath>
     </field>
</record>

 

Avatar
Annuleer
Auteur

Thank you Prakash, This domain probelm in a function not in view. domain_before=(('type', '=', 'purchase')) is there, i want to append one more domain domain_append_1=('type','=','general') with "|" operator using domain.append() function. Please tell me the way

Beste antwoord

You can override search method of your target model. Then you can save existing target domain, remove from domain list. You need to delete because string '|' need to append in the begining of domain list. Append string '|' in domain list. After this you can append your desired domain tuple and the existing one sequentially.

 

 

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
dec. 21
6645
1
sep. 21
1960
3
aug. 24
10743
0
mrt. 24
1114
0
jun. 21
2410