Hello I am able to bring two custom fields in project.project model. this is my custom_module.py code: #################################custom_module.py####################### from openerp.osv import fields, osv
class legacy_projects(osv.osv):
_inherit = "project.project"
_columns = {
'test': fields.integer('Test', size=11),
'test1':fields.char('umer', size=64)
}
_defaults ={ 'test': 0 }
legacy_projects(); ############################XML########################################### <openerp> <data> <record model="ir.ui.view" id="legacy_projects_project"> <field name="name">project.project.form</field> <field name="model">project.project</field> <field name="inherit_id" ref="project.edit_project"/> <field name="arch" type="xml"> <xpath expr="/form/sheet/group/group[2]/field[@name='partner_id']" position="after">
<field name="test" />
<field name="test1" />
</xpath>
</field>
</record>
</data> </openerp>
It works fyn and bringing two new fields in Project module. now in my custom_module.py file i want this file to be inherrited in other modules as well how can I do multiple inherritence in once .py file like After Default defintion should i start _inherit= "account.invoice" if yes then how to define it's Xml in the above given code kindly help me in it.. Thanks in Advance
I have tried this : .py file..........................from openerp.osv import fields, osv
class legacy_projects(osv.osv):
_inherit = "project.project"
_columns = {
}
_defaults ={ 'test': 0 'legacy_projects_id': 0, } _inherit = "account.invoice"
_columns = { 'test2' : fields.char('TESTING FIELD' , size=64),
legacy_projects();
and in xml created a new record in the same above xml file. <record model="ir.ui.view" id="account_invoice_view"> <field name="name">account.invoice.form</field> <field name="model">account.invoice</field> <field name="inherit_id" ref="account.invoice_form" /> <field name="arch" type="xml"> <xpath expr="/form/sheet/group/group[2]/field[@name='fiscal_position']" position="after">
then updated my module list then install Cutom_module:in project.project test and test1 fields appear but not in account.invoice nothing happens :S i dont know i think i 've messed it up.please help me in it.