From ea6d8090202fcb4b1a83b5db2cb988349fe97766 Mon Sep 17 00:00:00 2001 From: gitea Date: Sun, 4 May 2025 18:47:47 +0000 Subject: [PATCH] modified Contact View to more Odoo Style --- .gitea/ISSUE_TEMPLATE/odoo-test-feedback.yml | 14 ++++--- models/ows_models.py | 44 ++++++++++++++------ 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/.gitea/ISSUE_TEMPLATE/odoo-test-feedback.yml b/.gitea/ISSUE_TEMPLATE/odoo-test-feedback.yml index 3211930..7466c59 100644 --- a/.gitea/ISSUE_TEMPLATE/odoo-test-feedback.yml +++ b/.gitea/ISSUE_TEMPLATE/odoo-test-feedback.yml @@ -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). + diff --git a/models/ows_models.py b/models/ows_models.py index d199185..1bf2fec 100644 --- a/models/ows_models.py +++ b/models/ows_models.py @@ -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 = "
" + html = "
" + html += "
" + for area in areas: - html += f"
" - html += f"" - html += f"" + html += "
{area.name}DatumGültig bis
" + + # Bereichsüberschrift + html += f""" + + + + + + + + + """ + 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 = "" if access 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_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""" - - - - + + + """ - html += "
+
{area.name}
+
{icon}{date_granted}{date_expiry}{date_granted}{date_expiry}
" - html += "
" + + html += "" + + html += "
" partner.machine_access_html = html + + @api.model def migrate_existing_partners(self): """