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
3 files
+ 11
4
Compare changes
  • Side-by-side
  • Inline
Files
3
  • 1. Improve PS name calculation: Changed the calculation logic for PS names
       follow the format "First Name Last Name - Address". This helps the user with searching for PS.
    
    2. The name field of the supply point form: is auto-filled using the name of the owner - street. This is related to the previous point.
    
    3. Optimize PSA view: Removed name display in PSA view for
       Avoid duplication when displayed in modal forms. This improves vision
       interface consistency.
from odoo import _, fields, models
from odoo import _, api, fields, models
class SupplyPoint(models.Model):
@@ -14,7 +14,7 @@ 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",
@@ -53,3 +53,11 @@ class SupplyPoint(models.Model):
"supply_point_id",
readonly=True,
)
@api.depends("owner_id", "street")
def _compute_supply_point_name(self):
for record in self:
if record.owner_id and record.street:
record.name = f"{record.owner_id.name} - {record.street}"
else:
record.name = _("New Supply Point")
Loading