modified Contact View to more Odoo Style
This commit is contained in:
parent
63337a28bd
commit
ea6d809020
|
|
@ -10,13 +10,19 @@ body:
|
||||||
## 🧪 POS-Test: Feedbackformular
|
## 🧪 POS-Test: Feedbackformular
|
||||||
|
|
||||||
Bitte gib uns Rückmeldung zu den einzelnen Funktionen. Beschreibe ggf. Probleme oder Auffälligkeiten.
|
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
|
- type: textarea
|
||||||
id: nutzerauswahl
|
id: nutzerauswahl
|
||||||
attributes:
|
attributes:
|
||||||
label: Nutzer auswählen
|
label: Nutzer auswählen
|
||||||
description: Funktioniert die Auswahl des Nutzers im POS wie erwartet?
|
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
|
- type: textarea
|
||||||
id: haftung
|
id: haftung
|
||||||
|
|
@ -60,8 +66,4 @@ body:
|
||||||
label: Backend-Funktionen
|
label: Backend-Funktionen
|
||||||
description: Können Maschinen und Einweisungen im Backend wie erwartet verwaltet werden?
|
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).
|
|
||||||
|
|
|
||||||
|
|
@ -168,32 +168,52 @@ class ResPartner(models.Model):
|
||||||
def _compute_machine_access_html(self):
|
def _compute_machine_access_html(self):
|
||||||
areas = self.env['ows.machine.area'].search([], order="name")
|
areas = self.env['ows.machine.area'].search([], order="name")
|
||||||
for partner in self:
|
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:
|
for area in areas:
|
||||||
html += f"<div class='o_group' style='margin-bottom: 1em;'>"
|
html += "<table class='o_group o_inner_group o_group_col_6'><tbody>"
|
||||||
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>"
|
# 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")
|
machines = self.env['ows.machine'].search([('area_id', '=', area.id)], order="name")
|
||||||
|
|
||||||
for machine in machines:
|
for machine in machines:
|
||||||
access = self.env['ows.machine.access'].search([
|
access = self.env['ows.machine.access'].search([
|
||||||
('partner_id', '=', partner.id),
|
('partner_id', '=', partner.id),
|
||||||
('machine_id', '=', machine.id),
|
('machine_id', '=', machine.id),
|
||||||
], limit=1)
|
], limit=1)
|
||||||
icon = "<span class='fa fa-check text-success'></span>" if access else "<span class='fa fa-times text-danger'></span>"
|
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_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_expiry = access.date_expiry.strftime('%Y-%m-%d') if access and access.date_expiry else "-"
|
||||||
|
|
||||||
html += f"""
|
html += f"""
|
||||||
<tr>
|
<tr>
|
||||||
<td class='o_td_label'><label>{machine.name}</label></td>
|
<td class="o_td_label"><label class="o_form_label">{icon} {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_granted}</td>
|
<td class="o_td_field">{date_expiry}</td>
|
||||||
<td class='o_td_field'>{date_expiry}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
"""
|
"""
|
||||||
html += "</tbody></table></div>"
|
|
||||||
html += "</div>"
|
html += "</tbody></table>"
|
||||||
|
|
||||||
|
html += "</div></div></div>"
|
||||||
partner.machine_access_html = html
|
partner.machine_access_html = html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def migrate_existing_partners(self):
|
def migrate_existing_partners(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user