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.

3

Set value for a Many2many field from data.xml file??

By
Sebin Siby
on 6/6/16, 2:46 AM 480 views

I want to create a new record which contains Many2many fields using data file. Can someone please point me to an example of how to set Many2many field from data file?

I tried the following code.


<record id="account_journal_check" model="account.journal">

    <field name="name">Check</field>

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

    <field name="code">BNK3</field>

    <field name="sequence_id">50</field>

    <field name="default_debit_account_id">186</field>

    <field name="default_credit_account_id">186</field>

    <field name="inbound_payment_method_ids">(4, [1])</field>

    <field name="outbound_payment_method_ids">(4, [2,3])</field>

    <field name="show_on_dashboard">True</field>

    <field name="bank_statements_source">manual</field>

    <field name="journal_user">True</field>

</record>


Here the fields "inbound_payment_method_ids" and "outbound_payment_method_ids" are the Many2many field. All other fields values get populated in my form. But these two fields values are not get populated.

Any Help?

1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 6/6/16, 6:36 AM

Hello,

You can check example here

Hope this could help

Thanks Ahmed M.Elmubarak, It helped

Sebin Siby
on 6/15/16, 2:28 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

1 follower(s)

Stats

Asked: 6/6/16, 2:46 AM
Seen: 480 times
Last updated: 9/6/16, 9:49 AM