There is one field that since v6 and above was deleted and no longer used, ie one2one relations field.
If we tried to make it in v6 the error will definitely occurs. OpenERP provides a solution 'combine' to the field many2one but here there is little difference. If the automatic update feature table one2one is a 'destination' when we enter from the table 'source' while it did not happen on the field many2one.
For example you can see below code -
-
class hr_employee(osv.osv):
-
_inherit = 'hr.employee'
-
_columns = {
-
'partner_id': fields.many2one('res.partner','Partner'),
-
}
-
-
def onchange_partner_id(self, cr, uid, ids, partner, context=None):
-
self.pool.get('res.partner').write(cr, uid, [partner], {'employee_id': ids[0]})
-
return True
-
-
hr_employee()
-
To view the full article about One2One fields in Odoo-9 please visit Findnerd.
You can also post tech blogs at Findnerd. Also visit Findnerd for such more tech Blogs like Android,Java, Javascript,C,C++,Ios Development Blogs etc.
|