Odoo Help

0

How to change existing model record by use of xml data?

By
Antanas
on 7/26/13, 2:03 PM 6,003 views

Hello,

Is it possible to change existing model records by use of xml data file? Let's say there is a record in 'auditrail.rule' where it's field 'log_deletes' is True. Is it possible to change value of this field with xml data file (I mean .xml which is declared in __openerp__.py 'data' key)?

3
Ray Carnes
On 7/27/13, 6:17 PM
<record id="THE XML ID OF THE RECORD YOU WANT TO CHANGE" >
    <model="THE MODEL THAT HOLDS THE RECORD">
    <field name="THE NAME OF THE FIELD TO CHANGE">THE NEW VALUE</field>
</record>

So something like:

<record id="XML ID OF YOUR RECORD - EXPORT THE RECORD TO GET ONE IF IT IS FALSE" 
    <model="audittrail.rule">
    <field name="log_deletes">False</field>
</record>

The record ID of the demo record is audittrail.demo_audittrail_rule

Thank you!

Antanas
on 7/28/13, 4:00 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 7/26/13, 2:03 PM
Seen: 6003 times
Last updated: 3/16/15, 8:10 AM