Skip to Content
Menu
This question has been flagged
2 Replies
3928 Zobrazenia

I want to insert a partner while installing my custom module. For this i am writing a data file. My datafile record.

I have tried different ways to give value to purchase_warn field.

first use case:

<record model="res.partner" id="vendor_partner_system_cretaed">
             <field name="name">Vendorportal_system</field>
             <field name="purchase_warn" eval="[(1, ('No Message'))]"/>
        </record>

second use case:

<record model="res.partner" id="vendor_partner_system_cretaed">
             <field name="name">Vendorportal_system</field>
             <field name="purchase_warn" >No Message</field>
        </record>

third use case:

<record model="res.partner" id="vendor_partner_system_cretaed">
             <field name="name">Vendorportal_system</field>
             <field name="purchase_warn" ref="No Message"/>
        </record>

But no use case helps me. Can any one help me where i am doing mistake?

Avatar
Zrušiť
Best Answer

You try:

        <record model="res.partner" id="vendor_partner_system_cretaed">
             <field name="name">Vendorportal_system</field>
             <field name="purchase_warn">no-message</field>
        </record>

and be sure to add in __openerp__.py the

"depends" : [ ....., "warning" ],

Avatar
Zrušiť
Autor

Thank you zbik working fine.

Best Answer

If I'm not mistaken purchase_warn is a selection field with the following entries: [('no-message','No Message'), ('warning','Warning'), ('block','Blocking Message')].  So you should be entering any of the following values into that field: 'no-message', 'warning', 'block', like so: <field name="purchase_warn"/>no-message</field>

Avatar
Zrušiť
Autor

Thank you I van. It's working when we write the depends on "warning".