Boolean field, fail when loading data xml files.

Asked by ginsmar

I'm loading our partner data with xml files, for example:

        <record id="res_partner_1" model="res.partner">
            <field name="name">Alternate</field>
            <field name="ref">ALTERNATE</field>
            <field name="lang">es_ES</field>
            <field name="vat">ESG08557985</field>
            <field name="title">ltd</field>
            <field name="vat_subjected">1</field>
            <field name="customer">False</field>
            <field name="supplier">True</field>
        </record>

The result is ever customer and supplier True both.

If you write next below, customer and supplier are True both too:
            <field name="customer">0</field>
            <field name="supplier">1</field>

Only writting next below I can get the correct result:
            <field name="customer" eval="0"></field>
            <field name="supplier" eval="1"></field>

I don't know if it's a bug, but can drive you crazy at first.

Best Regards,
Gins
"OpenERP is a beast, difficult to master, but when mastered, you become a beast"

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Jay Vora (Serpent Consulting Services)
Solved:
Last query:
Last reply:
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#1

Hello Ginsmar,

You are right, its definitely not a bug.

Here is a thing in openerp that,by default any value is set to False.
If you have set boolean to be 1 in _defaults,its a different scenario.

If you want to set customer to be False, you do not need to write it in xml file..

Setting eval=SOMETHING will work well undoubtedly as it means 'set this value to this field'.

Hope this helps.

Thank you.

Revision history for this message
ginsmar (ginsmar) said :
#2

Hello Jay. Thanks for your attention.
The problem is that default value of customer at partner object is 1.
Then you need write in xml file if you want to a customer to be false.
Regards

2009/10/28 Jay (Open ERP) <email address hidden>

> Your question #87206 on OpenObject Server changed:
> https://answers.launchpad.net/openobject-server/+question/87206
>
> Status: Open => Answered
>
> Jay (Open ERP) proposed the following answer:
> Hello Ginsmar,
>
> You are right, its definitely not a bug.
>
> Here is a thing in openerp that,by default any value is set to False.
> If you have set boolean to be 1 in _defaults,its a different scenario.
>
> If you want to set customer to be False, you do not need to write it in
> xml file..
>
> Setting eval=SOMETHING will work well undoubtedly as it means 'set this
> value to this field'.
>
> Hope this helps.
>
> Thank you.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/openobject-server/+question/87206/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/openobject-server/+question/87206
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Best Jay Vora (Serpent Consulting Services) (jayvora) said :
#3

Yes,

I agree. At this point of time, you will need to use eval="0".

Kindly close this thread of question. If you want this as an improvement,please create a blueprint.
Thank you.

Revision history for this message
ginsmar (ginsmar) said :
#4

Thanks Jay (Open ERP), that solved my question.