bemade_fsm, fsm_equipment: fixes #109

Updated report template to use display_name and converted the
_compute_complete_name function to _compute_display_name in
fsm.equipment model.
This commit is contained in:
Marc Durepos 2024-09-06 08:27:31 -04:00
parent 8007912746
commit 1a042a720f
5 changed files with 7 additions and 6 deletions

View file

@ -20,7 +20,7 @@
########################################################################################
{
"name": "Improved Field Service Management",
"version": "17.0.0.4.0",
"version": "17.0.0.4.1",
"summary": (
"Adds functionality necessary for managing field service operations at Durpro."
),

View file

@ -288,7 +288,7 @@
<h3 t-if="intervention.equipment_ids">Equipment:
<t t-foreach="intervention.equipment_ids" t-as="equipment_id">
<span
t-out="equipment_id.complete_name + (', ' if not equipment_id_last else '')"
t-out="equipment_id.display_name + (', ' if not equipment_id_last else '')"
/>
</t>
</h3>

View file

@ -15,7 +15,8 @@
</h1>
</xpath>
<xpath expr="//page[@name='extra_info']" position="after">
<page string="Field Service" name="field_service" translate="True">
<page string="Equipment and Contacts" name="equipment_contacts"
translate="True">
<group name="equipment_and_contacts">
<field
name="equipment_ids"

View file

@ -19,7 +19,7 @@
#
{
"name": "FSM Equipment",
"version": "17.0.0.1.1",
"version": "17.0.0.1.2",
"summary": "Add the notion of client equipment for Field Service",
"category": "Services/Field Service",
"author": "Bemade Inc.",

View file

@ -84,8 +84,8 @@ class Equipment(models.Model):
}
@api.depends("code", "name")
def _compute_complete_name(self):
def _compute_display_name(self):
for rec in self:
tag_part = "[%s] " % rec.code if rec.code else ""
name = rec.name or ""
rec.complete_name = tag_part + name
rec.display_name = tag_part + name