Skip to content

Instantly share code, notes, and snippets.

@ofelix03
Last active November 1, 2022 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ofelix03/59a0481277ca2a8f6c95d9cdd318b371 to your computer and use it in GitHub Desktop.
Save ofelix03/59a0481277ca2a8f6c95d9cdd318b371 to your computer and use it in GitHub Desktop.
@api.model
def create(self, vals):
if not self.check_access_rights('create', raise_exception=False):
raise ValidationError(_("Sorry! you don't have the right permission to create this record"))
# user has right permission, continue with operation
return super(Customer, self).create(vals)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment