Last active
November 1, 2022 22:11
-
-
Save ofelix03/59a0481277ca2a8f6c95d9cdd318b371 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): | |
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