Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5823 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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>
Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 24
13758
1
thg 12 22
5624
0
thg 4 16
4020
0
thg 3 15
4927
45
thg 4 23
85507