Commit 431e2cfa by Arturo Jasso Origel

se agregaron cambios y permisos

parent d665d15f
......@@ -320,17 +320,19 @@ class HelpdeskTicket(models.Model):
})
def write(self,vals):
if "stage_id" in vals:
if self.description == '<p><br></p>' or self.description==False:
raise ValidationError (_("Para cambiar de etapa, es necesario agregar una descripción"))
if 'description' in vals and (vals["description"] != "" or self.description != False)and vals['description'] != '<p><br></p>' and (self.is_support == True or self.is_erp == True or self.is_emergency == True):
min_description = int(self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.description_min_lenght'))
description = self.get_description_len(vals["description"])
if len(description)-11 < min_description:
raise ValidationError (_("Favor de agregar al menos "+str(min_description)+" caracteres a la descripción"))
return super(HelpdeskTicket, self).write(vals)
if self.is_support == True or self.is_erp == True or self.is_emergency == True:
if "stage_id" in vals:
if self.description == '<p><br></p>' or self.description==False:
raise ValidationError (_("Para cambiar de etapa, es necesario agregar una descripción"))
if 'description' in vals and vals["description"] != "" and self.description != False and vals['description'] != '<p><br></p>':
min_description = int(self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.description_min_lenght'))
description = self.get_description_len(vals["description"])
_logger.info(description)
if description-11 < min_description:
raise ValidationError (_("Favor de agregar al menos "+str(min_description)+" caracteres a la descripción"))
return super(HelpdeskTicket, self).write(vals)
else:
return super(HelpdeskTicket, self).write(vals)
def action_approve(self):
if self.description == '<p><br></p>' or self.description==False:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment