Skip to content

Commit 1182c1c

Browse files
[12.0][FIX] Improved code of stage create method.
1 parent 34ed40d commit 1182c1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fieldservice/models/fsm_stage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def get_color_information(self):
7373
def create(self, vals):
7474
stages = self.env['fsm.stage'].search([])
7575
for stage in stages:
76-
if stage.stage_type == vals['stage_type'] and \
77-
stage.sequence == vals['sequence']:
76+
if stage.stage_type == vals.get('stage_type') and \
77+
stage.sequence == vals.get('sequence'):
7878
raise ValidationError(_("Cannot create FSM Stage because "
7979
"it has the same Type and Sequence "
8080
"of an existing FSM Stage."))

0 commit comments

Comments
 (0)