This question has been flagged
2 Replies
4610 Views

I made changes in the FormView of res.partner.form and it works like I want. After that, I updated modules from launchpad and the changes was gone!

How can I update modules without loss the changes I made? I must redo it again every time?

I know now that the file XML where is stored the form also can be 'updated' but I'm sure it must be a way to work with no pain.

All the changes I made only add 'attrs' (required and visible) to some fields to make it required or not and visible or not if is_company is true.

attrs="{'invisible': [('is_company','=', True)]}

I don't need add new fields to de form (by now), so I wan't edit source code if I don't need. All changes are made through the web client.

Any comment?

Avatar
Discard
Best Answer

Miguel, you should never change an OpenERP source file, you should develop a custom module which inherits and modify the view.

This post is rather old but a simple valid example: https://simahawk.wordpress.com/2010/10/04/openerp-how-to-add-a-custom-field-to-an-object/

Best regards.

Avatar
Discard
Author

Thank you. I'll try. But I don't changed the source files. I edit the form directly in OpenERP.

Best Answer

If you do not want to write a module for that you can create a new view which inherits the original view.

Here is an example of the XML architecture of a new view if you want to change the field standard_price in product.product:

               <field name="standard_price" position="replace">
                   <field name="standard_price" invisible="1"/>
               </field>
Avatar
Discard
Author

If when I update modules in OpenERP the view don't reset to default view, maybe it can works for me.