Hello everyone , i created a module to inherit from the Sale module , the field i changed appers just fine on the interface here is my module :
ventes.py
from osv import fields,osv
import time
from datetime import datetime
from tools.translate import _
class ventes(osv.osv):
_inherit='sale.order'
_columns = {
'prenom': fields.many2one('patient','Patient', required=True),
}
ventes()
ventes_view.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_sales_inherit">
<field name="name">sale.order.form.inherit</field>
<field name="model">sale.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="sale.view_order_form">form</field>
<field name="arch" type="xml">
<field name="name" position="after">
<label for="prenom" class="oe_edit_only"/>
<h1>
<field name="prenom"/>
</h1>
</field>
<field name="partner_id" position="replace"/>
</field>
</record>
</data>
</openerp>
the problem is when i create a sale order , in the place of the client names i get the patients name ( witch is what i was looking for ) but the problem is when i want to add a product to that sale order i get the following error:
Error: Could not get field with name 'parent.partner_id' for onchange 'product_uom_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, context)'
Plz help me, i dont know how to make it work with my patient's id and not the partner_id ??!!