Skip to content
Snippets Groups Projects

[IMP] energy_selfconsumption: invoicing acquired power

6 files
+ 86
2
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -114,8 +114,18 @@ class Selfconsumption(models.Model):
@@ -114,8 +114,18 @@ class Selfconsumption(models.Model):
raise ValidationError(_("Project must have a valid CIL."))
raise ValidationError(_("Project must have a valid CIL."))
if not record.power or record.power <= 0:
if not record.power or record.power <= 0:
raise ValidationError(_("Project must have a valid Generation Power."))
raise ValidationError(_("Project must have a valid Generation Power."))
record.write({"state": "active"})
return {
self.distribution_table_state("process", "active")
"name": _("Generate Contracts"),
 
"type": "ir.actions.act_window",
 
"view_mode": "form",
 
"res_model": "energy_selfconsumption.contract_generation.wizard",
 
"views": [(False, "form")],
 
"view_id": False,
 
"target": "new",
 
}
 
# Move state write to contract wizard
 
# record.write({"state": "active"})
 
# self.distribution_table_state("process", "active")
def action_selfconsumption_import_wizard(self):
def action_selfconsumption_import_wizard(self):
self.ensure_one()
self.ensure_one()
Loading