Skip to content
Snippets Groups Projects

[REL] 14.0.2.0.0

Merged Daniil Digtyar Vasilieva requested to merge release/14.0.1.1.14 into 14.0
6 files
+ 16
6
Compare changes
  • Side-by-side
  • Inline
Files
6
from odoo import fields, models, _
from odoo import _, api, fields, models
class SupplyPoint(models.Model):
@@ -14,12 +14,20 @@ class SupplyPoint(models.Model):
)
}
name = fields.Char(required=True)
name = fields.Char(compute="_compute_supply_point_name", store=True)
code = fields.Char(string="CUPS", 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")
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
)
@@ -40,5 +48,16 @@ class SupplyPoint(models.Model):
"res.country", string="Country", ondelete="restrict", required=True
)
supply_point_assignation_ids = fields.One2many('energy_selfconsumption.supply_point_assignation','supply_point_id',
readonly=True)
supply_point_assignation_ids = fields.One2many(
"energy_selfconsumption.supply_point_assignation",
"supply_point_id",
readonly=True,
)
@api.depends("partner_id", "street")
def _compute_supply_point_name(self):
for record in self:
if record.partner_id and record.street:
record.name = f"{record.partner_id.name} - {record.street}"
else:
record.name = _("New Supply Point")
Loading