I want to add a new field in a model. I create it in the python file:
class SaleOrderExt(models.Model):
_inherit = ['sale.order']
my_new_field = fields.Char()
and then I am going to show it in the view form:
<?xml version="1.0" encoding="utf-8"?> <openerp> <data> <record id="view_order_form_extend" model="ir.ui.view"> <field name="name">view.order.form.extend</field> <field name="model">sale.order</field> <field name="inherit_id" ref="sale_stock.view_order_form_inherit_sale_stock"/>
<field name="arch" type="xml"> <xpath expr="//field[@name='picking_policy']" position="after">
<field name="my_new_field"/>
</xpath> </field> </record> </data> </openerp>
When I install the module for the first time, the field appears and everything works fine. The problem comes when I try to update the module.
It gives an exception that says that field product_tmpl_id
doesn't exist.
How can it be possible? The first installation worked fine...
Look Odoo Customization: https://learnopenerp.tumblr.com/
@Sehrish ??? Did you read all the post?