Skip to content
Snippets Groups Projects
Commit 16748c71 authored by Daniil Digtyar Vasilieva's avatar Daniil Digtyar Vasilieva :call_me: Committed by Enrico Stano
Browse files

[IMP] energy_selfconsumption: raise error on supply point not found

parent bc91794b
No related branches found
No related tags found
2 merge requests!187Release 14.0.1.1.13,!155[IMP] energy_selfconsumption: importation of selfconsumption inscriptions, supply points and distribution tables by CSV
......@@ -90,7 +90,7 @@ class DistributionTableImportWizard(models.TransientModel):
def get_supply_point_id(self, code):
supply_point = self.env['energy_selfconsumption.supply_point'].search([('code', '=', code)])
if not supply_point:
return False
raise ValidationError(_('There isn\'t any supply point with this code: {code}').format(code=code))
return supply_point.id
def get_coefficient(self, coefficient):
......
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