Using 4.2.0: So here is what I tried but does not seem to work yet:
Created a module 'res_company' that contains the following: res_company_view.xml: <?xml version="1.0"?> <terp> <data> <!-- THIS GLOBAL TREE/FORM IS FOR RES COMPANY --> <record model="ir.ui.view" id="res_company_tree"> <field name="name">res.company.tree</field> <field name="model">res.company</field> <field name="type">tree</field> <field name="arch" type="xml"> <tree string="Company"> <field name="name"/> <field name="parent_id"/> <field name="child_ids"/> <field name="partner_id"/> <field name="rml_header1"/> <field name="rml_footer1"/> <field name="rml_footer2"/> <field name="currency_id"/> </tree> </field> </record> <record model="ir.ui.view" id="res_company_form"> <field name="name">res.company.form</field> <field name="model">res.company</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="Company"> <field name="name"/> <field name="parent_id"/> <field name="child_ids"/> <field name="partner_id"/> <field name="rml_header1"/> <field name="rml_footer1"/> <field name="rml_footer2"/> <field name="currency_id"/> </form> </field> </record> <record model="ir.actions.act_window" id="action_res_company"> <field name="name">Company</field> <field name="res_model">res.company</field> <field name="view_type">form</field> </record> <record model="ir.actions.act_window.view" id="action_res_company_tree_view1"> <field name="sequence" eval="1"/> <field name="view_mode">tree</field> <field name="view_id" ref="res_company_tree"/> <field name="act_window_id" ref="action_res_company"/> </record> <record model="ir.actions.act_window.view" id="action_res_company_tree_view2"> <field name="sequence" eval="2"/> <field name="view_mode">form</field> <field name="view_id" ref="res_company_form"/> <field name="act_window_id" ref="action_res_company"/> </record> <!-- NO MENU NEEDED, EVERYTHING WORKS FROM Administration/Configuration/Base/'Define Main Company' --> </data> </terp> __init__.py: empty __terp__.py: { "name" : "res_company", "version" : "1.0", "depends" : ["base"], "author" : "Gerry Reno", "description": """Provides global views for res_company that you can inherit and modify in other modules. """, "website" : "", "category" : "Base", "init_xml" : [ ], "demo_xml" : [ ], "update_xml" : [ "res_company_view.xml", ], # "translations" : { # "fr": "i18n/french_fr.csv" # }, "active": False, "installable": True } =================================================================== Now in two existing modules I did this type of thing where I added a 'test1' field in one module and a 'test2' field in the second module: Added a res_company_view.xml file: <?xml version="1.0"?> <terp> <data> <!-- THIS TREE/FORM IS FOR RES COMPANY --> <record model="ir.ui.view" id="res_company_tree"> <field name="name">res.company.tree.inherit</field> <field name="model">res.company</field> <field name="inherit_id" ref="res_company.res_company_tree" /> <field name="type">tree</field> <field name="arch" type="xml"> <tree string="Company"> <field name="name" position="after"> <field name="test1"/> </field> </tree> </field> </record> <record model="ir.ui.view" id="res_company_form"> <field name="name">res.company.form.inherit</field> <field name="model">res.company</field> <field name="inherit_id" ref="res_company.res_company_form" /> <field name="type">form</field> <field name="arch" type="xml"> <form string="Company"> <field name="name" position="after"> <field name="test1"/> </field> </form> </field> </record> <record model="ir.actions.act_window" id="action_res_company"> <field name="name">Company</field> <field name="res_model">res.company</field> <field name="view_type">form</field> </record> <record model="ir.actions.act_window.view" id="action_res_company_tree_view1"> <field name="sequence" eval="1"/> <field name="view_mode">tree</field> <field name="act_window_id" ref="action_res_company"/> </record> <record model="ir.actions.act_window.view" id="action_res_company_tree_view2"> <field name="sequence" eval="2"/> <field name="view_mode">form</field> <field name="view_id" ref="res_company_form"/> <field name="act_window_id" ref="action_res_company"/> </record> <!-- NO ADDITIONAL MENU NEEDED, EVERYTHING WORKS FINE FROM Administration/Configuration/Base/'Define Main Company' --> </data> </terp> I added a res_company.py inheriting from res_company and adding the new field 'test1' and I verified that both 'test1' and 'test2' fields were added to res_company table. I then added the res_company_view.xml reference into __terp__.py. =================================================================== When I install the module 'res_company' and update my other two modules, I see no change in the res.company view under Administration/Configuration/Base/'Define Main Company' . Just the same old default view for both tree and form. I read the dev book section on view inheritance and it seems like this should work but it is not working. What am I doing wrong here? ???? Regards, Gerry _______________________________________________ Tinyerp-users mailing list http://tiny.be/mailman/listinfo/tinyerp-users
