'Initialize the value of the given column for existing rows.
Overridden here because we need to have different default values
for barcode and pin for every employee.'

@api.model_cr_context
def _init_column(self, column_name):

    if (column_name not in ['barcode', 'pin']):
        super(HrEmployee, self)._init_column(column_name)
    else:
        default_compute = self._fields[column_name].default
        query = ('SELECT    id    FROM    "%s"    WHERE    "%s"    is    NULL' % (self._table, column_name))
        self.env.cr.execute(query)
        employee_ids = self.env.cr.fetchall()
        for employee_id in employee_ids:
            default_value = default_compute(self)
            query = ('UPDATE    "%s"    SET    "%s"=%%s    WHERE    id    =    %s' % (self._table, column_name, employee_id[0]))
            self.env.cr.execute(query, (default_value,))
