Last active
November 5, 2022 21:13
-
-
Save ofelix03/820e80fb894e635ede9e7d7599dac6d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@api.model | |
def create(self, vals): | |
try: | |
# if user has right permission, continue with create operation | |
return super(Customer, self).create(vals) | |
except AccessError: | |
raise ValidationError(_("Sorry! you don't have the right permission to create this record")) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment