Hi, this is a simple issue on a simple example (with all data provided here). I'm using OpenERP 7.0-20130212-002145
I've created a very simple module as shown below (it adds one field named dtc_dc_ident to account.invoice object and view), and when I install it all goes fine, but when I update it (with no change at all) I get the following error (in the server log file):
2013-02-13 18:17:22,721 1448 ERROR test7 openerp.osv.orm: Can't find field 'dtc_dc_ident' in the following view parts composing the view of object model 'account.invoice':
- a_test_inherit.account.invoice.form
If I comment the line <field name="dtc_dc_ident" required="1"/> it works fine (and the field dtc_dc_ident is visible in the account.invoice object model)
This problem only arises on account.invoice, for example on hr.holidays all is OK.
Here is the module structure (4 files):
a_test
__init__.py __openerp__.py a_test_account_invoice.py a_test_account_invoice.xml
Here is the content of each file :
__init__.py
import a_test_account_invoice
__openerp__.py
{
"name" : "short description : a_test",
"version" : "1.0",
"author" : "Test DTC",
"website" : "none",
"category" : "Generic Modules/Others",
"depends" : ["base", "account" ],
"description" : "Description : A Test module",
"init_xml" : ["a_test_account_invoice.xml", ],
"demo_xml" : [],
"update_xml" : [],
"active": False,
"installable": True,
"application": True,
}
a_test_account_invoice.py
from osv import fields, osv
import os
import time
import pooler
import codecs
import datetime
import string
from tools.translate import _
class account_invoice(osv.osv):
_name = 'account.invoice'
_inherit = 'account.invoice'
_description = 'Invoice'
_columns = {
'dtc_dc_ident': fields.char('Identifiant DC', required=False, size=32),
}
account_invoice()
a_test_account_invoice.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="a_test_inherit_invoice_form" model="ir.ui.view">
<field name="name">a_test_inherit.account.invoice.form</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="dtc_dc_ident" required="1"/>
</field>
</field>
</record>
</data>
</openerp>
Not sure I'm allowed to push my post back up in this way... but I would like it if someone could test this and confirm what I get...
Thanks
No, this is not a good practice. Although I converted your "answer" into a comment.