I have tips to customize module, that should be at least consist of 4 files, 
let use your example :
1. __init__.py
import rb_employee

2. __terp__.py
the customized view should be called and updated from this file
{
   "name" : "the name of custom modul",
   "version" : "1.0",
   "author" : "the author",
   "category" : "human resource",
   "depends" : ["hr"],
   "demo_xml" : [],
   "update_xml" : ["rb_employee_view.xml",],  
   "active": True,
   "installable": True
}

3. rb_employee.py
class rad_rb_employee(osv.osv):
    _name = 'hr.employee'
    _inherit = 'hr.employee'
    _columns = {
        'hod_id' : fields.many2one('hr.employee', 
'Head of the department')
    }
rad_rb_employee() 

4. rb_employee_view.xml
<?xml version="1.0"?>
<terp>
&nbsp; &nbsp;<data>
&nbsp; &nbsp;&nbsp; &nbsp;<record model="ir.ui.view" id="view_employee_rb">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; <field name="name">hr.employee.rb</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; <field name="model">hr.employee</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; <field name="type">form</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; <field name="inherit_id" ref="hr.view_employee_form"/>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; <field name="arch" type="xml">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field name="company_id" position="after">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 
&nbsp;&nbsp; &nbsp; <field name="hod_id"/>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; </field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </record>
&nbsp; &nbsp;</data>
</terp>


to custimize view, consider this code :
<field name="inherit_id" ref="hr.view_employee_form"/>

It's mean, that view view_employee_rb is inherited from view_employee_form on 
hr module, so :

hr ---> is the module name
view_employee_form -----> is the ID of parent view (see employe form view on hr 
module)

I don't test this customized modul, but it's just skeleton. And that was what 
I've done to customizing a module

hope this help.....




-------------------- m2f --------------------

--
http://www.openerp.com/forum/viewtopic.php?p=27297#27297

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users

Reply via email to