mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms: avoid document required document in users partners
This commit is contained in:
@@ -63,3 +63,15 @@ class ResUsers(models.Model):
|
||||
raise ValidationError(
|
||||
_("Some properties do not belong to the allowed companies")
|
||||
)
|
||||
|
||||
# Inherit Create and Write method to set context avoid_document_restriction
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
return super(
|
||||
ResUsers, self.with_context(avoid_document_restriction=True)
|
||||
).create(vals)
|
||||
|
||||
def write(self, vals):
|
||||
return super(
|
||||
ResUsers, self.with_context(avoid_document_restriction=True)
|
||||
).write(vals)
|
||||
|
||||
Reference in New Issue
Block a user