Skip to content
Snippets Groups Projects
Commit 445f7e94 authored by Daniil Digtyar Vasilieva's avatar Daniil Digtyar Vasilieva :call_me:
Browse files

[IMP] add validation of distribution table in activation of self-consumption project

parent 90d40dec
No related branches found
No related tags found
3 merge requests!138Hotfix setup name error,!134Release v14.0.1.1.6,!126[IMP] Feature/add energy selfconsumption distribution table
......@@ -27,4 +27,6 @@ class Selfconsumption(models.Model):
raise ValidationError(_("Project must have a valid Code."))
if not record.power or record.power <= 0:
raise ValidationError(_("Project must have a valid Generation Power."))
if not record.distribution_table_id:
raise ValidationError(_("Must select a valid Distribution Table."))
record.write({"state": "active"})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment