modified Contact View to more Odoo Style

This commit is contained in:
gitea 2025-05-04 18:47:47 +00:00
parent 63337a28bd
commit ea6d809020
2 changed files with 40 additions and 18 deletions

View File

@ -10,13 +10,19 @@ body:
## 🧪 POS-Test: Feedbackformular
Bitte gib uns Rückmeldung zu den einzelnen Funktionen. Beschreibe ggf. Probleme oder Auffälligkeiten.
- type: textarea
id: sonstiges
attributes:
label: Sonstiges Feedback oder Fehler
description: Alles andere, was dir beim Test aufgefallen ist (z.B. Layout, Ladezeiten, Fehlermeldungen).
- type: textarea
id: nutzerauswahl
attributes:
label: Nutzer auswählen
description: Funktioniert die Auswahl des Nutzers im POS wie erwartet?
placeholder: z.B. Nutzer nicht auffindbar, Anzeige langsam etc.
placeholder: z.B. Nutzer nicht auffindbar, Anzeige langsam etc.
- type: textarea
id: haftung
@ -60,8 +66,4 @@ body:
label: Backend-Funktionen
description: Können Maschinen und Einweisungen im Backend wie erwartet verwaltet werden?
- type: textarea
id: sonstiges
attributes:
label: Sonstiges Feedback oder Fehler
description: Alles andere, was dir beim Test aufgefallen ist (z.B. Layout, Ladezeiten, Fehlermeldungen).

View File

@ -168,32 +168,52 @@ class ResPartner(models.Model):
def _compute_machine_access_html(self):
areas = self.env['ows.machine.area'].search([], order="name")
for partner in self:
html = "<div style='display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;'>"
html = "<div class='tab-content'><div class='tab-pane active' id='machine_access_tab'>"
html += "<div class='o_group'>"
for area in areas:
html += f"<div class='o_group' style='margin-bottom: 1em;'>"
html += f"<table class='o_group o_inner_group'>"
html += f"<thead><tr><th>{area.name}</th><th></th><th>Datum</th><th>Gültig bis</th></tr></thead><tbody>"
html += "<table class='o_group o_inner_group o_group_col_6'><tbody>"
# Bereichsüberschrift
html += f"""
<tr>
<td colspan="3" style="width: 100%;">
<div class="o_horizontal_separator">{area.name}</div>
</td>
</tr>
<tr>
<td class="o_td_label"><label class="o_form_label"></label></td>
<td class="o_td_label"><label class="o_form_label">Datum</label></td>
<td class="o_td_label"><label class="o_form_label">Gültig bis</label></td>
</tr>
"""
machines = self.env['ows.machine'].search([('area_id', '=', area.id)], order="name")
for machine in machines:
access = self.env['ows.machine.access'].search([
('partner_id', '=', partner.id),
('machine_id', '=', machine.id),
], limit=1)
icon = "<span class='fa fa-check text-success'></span>" if access else "<span class='fa fa-times text-danger'></span>"
date_granted = access.date_granted.strftime('%Y-%m-%d') if access and access.date_granted else ""
date_expiry = access.date_expiry.strftime('%Y-%m-%d') if access and access.date_expiry else ""
date_granted = access.date_granted.strftime('%Y-%m-%d') if access and access.date_granted else "-"
date_expiry = access.date_expiry.strftime('%Y-%m-%d') if access and access.date_expiry else "-"
html += f"""
<tr>
<td class='o_td_label'><label>{machine.name}</label></td>
<td class='o_td_field'>{icon}</td>
<td class='o_td_field'>{date_granted}</td>
<td class='o_td_field'>{date_expiry}</td>
<td class="o_td_label"><label class="o_form_label">{icon} {machine.name}</label></td>
<td class="o_td_field">{date_granted}</td>
<td class="o_td_field">{date_expiry}</td>
</tr>
"""
html += "</tbody></table></div>"
html += "</div>"
html += "</tbody></table>"
html += "</div></div></div>"
partner.machine_access_html = html
@api.model
def migrate_existing_partners(self):
"""