Skip to content
Snippets Groups Projects

[IMP] energy_selfconsumption: importation of selfconsumption inscriptions, supply points and distribution tables by CSV

All threads resolved!
Compare and Show latest version
9 files
+ 98
53
Compare changes
  • Side-by-side
  • Inline
Files
9
from odoo import fields, models
from odoo import fields, models, _
class SupplyPoint(models.Model):
@@ -6,9 +6,20 @@ class SupplyPoint(models.Model):
_description = "Energy Supply Point"
_inherit = ["mail.thread", "mail.activity.mixin"]
_sql_constraints = {
(
"unique_code_company_id",
"unique (code, company_id)",
_("A supply point with this code already exists."),
)
}
name = fields.Char(required=True)
code = fields.Char(string="CUPS", required=True)
owner_id = fields.Many2one("res.partner", string="Owner", required=True)
owner_id = fields.Many2one("res.partner", string="Owner", required=True,
help="Partner with the legal obligation of the supply point")
partner_id = fields.Many2one("res.partner", string="Partner", required=True,
help="Partner subscribed to the self-consumption project")
company_id = fields.Many2one(
"res.company", default=lambda self: self.env.company, readonly=True
)
Loading