'check that the field is created from the menu and not from an database update
otherwise the database update can crash:'

@api.model
def _check_write(self):

    if self.env.context.get('manual'):
        global_state = self._get_global_state()
        if (global_state == 'anonymized'):
            raise UserError(_('The    database    is    currently    anonymized,    you    cannot    create,    modify    or    delete    fields.'))
        elif (global_state == 'unstable'):
            raise UserError(_('The    database    anonymization    is    currently    in    an    unstable    state.    Some    fields    are    anonymized,    while    some    fields    are    not    anonymized.    You    should    try    to    solve    this    problem    before    trying    to    create,    write    or    delete    fields.'))
    return True
