Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgarRetes committed Nov 22, 2024
1 parent af97dc5 commit 5f0c1f5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fieldservice_stage_validation/models/validate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ def validate_stage_fields(records):
for name in field_names:
if not values[0][name]:
lang_context = {"lang": records.env.context.get("lang", "en_US")}
user_model = records.env["res.users"].with_context(**lang_context)
# Asignar el contexto directamente a res.users
records.env.context = records.env.context.copy() # Asegurar que se copie el contexto
records.env.context.update(lang_context)

# Usar _() directamente para la traducción
raise ValidationError(
user_model._(
_(
"Cannot move to stage %(stage_name)s "
"until the %(name)s field is set.",
stage_name=stage.name,
Expand Down

0 comments on commit 5f0c1f5

Please sign in to comment.