Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
5818 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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

Risposta migliore

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
Abbandona
Autore

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

Post correlati Risposte Visualizzazioni Attività
3
mar 24
13750
1
dic 22
5618
0
apr 16
4011
0
mar 15
4920
45
apr 23
85487