Hello there,
We are on Odoo 8.
It is really not the first time that I try to update a record in the database.
I have declared the file in my __openerp__.py file, like I always do.
In my custom module, I have put this code :
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="account.account_financial_report_profitloss_toreport0" model="account.financial.report">
<field name="name">Effacer</field>
<field name="parent_id" eval="4" />
</record>
</data>
</openerp>
I have unchecked the "non updatable" checkbox of the record "account_financial_report_profitloss_toreport0" in external identifiers before tu update my module.
I see in the log that my custom .xml file is well read.
But nothing happens!!!
Is this something special with this record? Why it is impossible to update?
I did it 1000 times before...
EDIT #1
I tried with the field "sign" also declared. No success... No update...
<record id="account.account_financial_report_profitloss_toreport0" model="account.financial.report">
<field name="name">Effacer</field>
<field name="sign" eval="1" />
<field name="parent_id" eval="4" />
</record>
I suppose your problem is a field named "sign" in this model, it is required.
Hello my old friend Zbik! Are you saying that I should also declare the field "sign" in my custom XML record even if I don't really want to change the value of this field? When a field is "required", we always have to include it to update a record?
No. I understood that you are creating a new record. If you do an update and it does not work, then this record is probably already marked in ir.model.data as noupdate = 1. Verify it directly in database.
noupdate was already to False for this record. It is the first thing I have verified. It is not the problem.
id=4 exist and is active? a better solution is:
<field name="parent_id" ref="account.HERE_NAME_ID_4"/>, probably this should be
<field name="parent_id" ref="account.account_financial_report_liabilitysum0"/>
PS 1. noupdate = False is unexpected, original record account_financial_report_profitloss_toreport0 has noupdate=1
PS 2. module depends is set ok?
Is it by chance another module does not overwrite this record as well?
I have cut and pasted once again in my custom XML file and it worked. I have absolutely no idea of what was the problem. Big thanks for your help!