I want to update some values in hr.employee to my custom one2many field. How can i add these in a button click?
class hr_employee(osv.osv):
_inherit = 'hr.employee'
_columns = {
'own_location' : fields.many2one('location.location','Own location'),
'location_line_ids': fields.one2many('employee.location', 'location_line_id', 'location'),
}
class employee_location(osv.osv):
_name='employee.location'
_columns={
'current_location':fields.char('Current location'),
'new_location':fields.many2one('location.location','New location'),
'location_line_id':fields.many2one('hr.employee','Employee location',ondelete='cascade'),
}
def employee_transfer(self, cr, uid, ids, context=None):
## How can add one2many values using this function
xml
<button name="location_transfer" type="object" string="(Location Transfer)" context="{'name':name}"/>
I want to update 'own_location' many2one field value in 'current_location' & 'new_location' using a button click?
How can i update one2many field values using button click?