This question has been flagged
5064 Views

Hello, I want to add a custom field in Create Project forms. My code is post below but it's wrong because my field dont appear.What is wrong?

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
    <record id="project_project_extend" model="ir.ui.view">
        <field name="name">project.project.extended</field>
        <field name="model">project.project</field>
        <field name="inherit_id" ref="project.edit_project"/>
        <field name="arch" type="xml">
            <field name="user_id" position="after">
                <field name="my_field"/>
            </field>
        </field>
    </record>       
</data>

</openerp>

Avatar
Discard

Have you updated/installed the module in which you have written this code?

Author

Yes with OpenERP server restart, log out, log in and update module. On update module there are no errors. In ir_ui_view my model doesn't appears.. :(

I think you might have to check that you are inheriting the right view. The view you inherited exists in project.project but i think that might not be the one you require. Use the xpath to define the field location that might help too

Author

I try with xpath with this syntax but doesn't work (<xpath expr='//field[@name="user_id"]' position='before'>) I want to add in forum with name 'project.project.form' and id='edit_project'. This form belongs 'project' module and are define in 'project_view.xml'.

Give the rights of 'Technical Features' to the user which enable the menu 'Update module List' in 'Settings->Modules' menu. After this you can view your module in 'ir_module_module' object. Install your custom module. You can view your custom field after 'user_id'.