Monday 1 February 2016

One2One fields in Odoo-9


01-b.png

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 -

  1. class hr_employee(osv.osv):
  2.    _inherit = 'hr.employee'
  3.    _columns = {
  4.        'partner_id': fields.many2one('res.partner','Partner'),
  5.    }
  6.    def onchange_partner_id(self, cr, uid, ids, partner, context=None):
  7.        self.pool.get('res.partner').write(cr, uid, [partner], {'employee_id': ids[0]})
  8.        return True
  9.     
  10. 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.

2 comments:

  1. Enpersol is an Odoo consultants Company in indore proficient in business process reenginerring and optimization. Enpersol is an Odoo partners Company provide best Odoo services in pune.

    ReplyDelete

  2. I really impressed with your interesting blog and found some information about odoo .Thanks for sharing for odoo partners

    ReplyDelete