Skip to content

Commit

Permalink
Update fieldservice_maintenance/models/fsm_equipment.py
Browse files Browse the repository at this point in the history
Co-authored-by: Hpar <[email protected]>
  • Loading branch information
max3903 and hparfr authored Aug 24, 2023
1 parent e640f9d commit 59cec73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fieldservice_maintenance/models/fsm_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class FSMEquipment(models.Model):
@api.model
def create(self, vals):
maintenance_team_id = self.env["maintenance.team"].search(
[("company_id", "=", self.env.company.id)], limit=1
[["company_id", "in", (self.env.company.id, False)]],
limit=1,
)
)
if not maintenance_team_id:
raise ValidationError(_("At least one maintenance team must be created"))
Expand Down

0 comments on commit 59cec73

Please sign in to comment.