From 5cdbfffcaaecdae63b68f6631fedc2eea83bc2cb Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Thu, 14 May 2020 11:49:23 +0200 Subject: [PATCH] New field "editor = order_processor"; rework printout layout --- ext/custom-addons/dp_custom/models/res_users.py | 1 + ext/custom-addons/dp_custom/models/sale.py | 11 ++++++++++- .../dp_custom/security/security.xml | 8 ++++++++ .../dp_custom/views/res_users_views.xml | 1 + .../dp_custom/views/sale_views.xml | 6 ++++++ .../dp_reports/data/paperformat.xml | 4 ++-- .../static/src/less/report_backend.less | 17 +++++++++++++++++ .../dp_reports_account/reports/invoice.xml | 2 +- .../dp_reports_purchase/reports/purchase.xml | 2 +- .../reports/purchasequotation.xml | 2 +- .../dp_reports_sale/reports/sale.xml | 2 +- .../reports/report_production.xml | 2 +- 12 files changed, 50 insertions(+), 8 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/res_users.py b/ext/custom-addons/dp_custom/models/res_users.py index 6691194d..1ae1ff23 100644 --- a/ext/custom-addons/dp_custom/models/res_users.py +++ b/ext/custom-addons/dp_custom/models/res_users.py @@ -8,6 +8,7 @@ class Users(models.Model): _inherit = 'res.users' clerk_name = fields.Char('Sachbearbeiter-ID', size=20, help='ID als Sachbearbeiter im PG9 (max. 20 Zeichen)') + editor_name = fields.Char('Auftragsbearbeiter-ID', size=20, help='ID als Auftragsbearbeiter im PG9 (max. 20 Zeichen)') @api.model def create(self, vals): diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index 055b6b57..d295e8d4 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -71,7 +71,13 @@ class SaleOrder(models.Model): weight_total = fields.Float(string='Gesamtgewicht', compute='_compute_weight_total') confirmation_nr = fields.Char('Freigabenummer',track_visibility='onchange') order_type = fields.Selection(ORDER_TYPES, string='Auftragsart', default='M') - clerk_id = fields.Many2one('res.users', string='Sachbearbeiter', domain=[('clerk_name', '!=', '')],track_visibility='onchange') + + clerk_id = fields.Many2one('res.users', string='Sachbearbeiter', + domain=[('clerk_name', '!=', '')],track_visibility='onchange') + editor_id = fields.Many2one('res.users', string='Auftragsbearbeiter', + default=lambda self: self.env.user if self.env.user.editor_name else '', + domain=[('editor_name', '!=', '')],track_visibility='onchange') + desired_delivery_date = fields.Date(string='Wunschlieferdatum') delivery_date_warning = fields.Boolean(compute='_compute_dlv_date_warn', store=False) warn_vat_date = fields.Boolean(compute='_get_vat_warn_date', store=False, default=False) @@ -601,6 +607,9 @@ class SaleOrder(models.Model): new_vals['assembly_state'] = 'approved' new_vals['message_post'] = 'PG9 autoreleased' + if self.editor_id == '' and self.env.user.editor_name: + self.editor_id = self.env.user.editor_name + self.write(new_vals) return super(SaleOrder, self).action_confirm() diff --git a/ext/custom-addons/dp_custom/security/security.xml b/ext/custom-addons/dp_custom/security/security.xml index e7524720..f300a89a 100644 --- a/ext/custom-addons/dp_custom/security/security.xml +++ b/ext/custom-addons/dp_custom/security/security.xml @@ -16,6 +16,14 @@ Ändern des PG-Status erlauben Ändern des PG-Status erlauben + + Ist Auftragsbearbeiter + Ist Auftragsbearbeiter + + + Ist Sachbearbeiter + Ist Sachbearbeiter + Ändern des Flags 'Preisliste im Portal verwaltet' erlauben Ändern des Flags 'Preisliste im Portal verwaltet' erlauben diff --git a/ext/custom-addons/dp_custom/views/res_users_views.xml b/ext/custom-addons/dp_custom/views/res_users_views.xml index 91ddfc2c..5f8a243a 100644 --- a/ext/custom-addons/dp_custom/views/res_users_views.xml +++ b/ext/custom-addons/dp_custom/views/res_users_views.xml @@ -7,6 +7,7 @@ + diff --git a/ext/custom-addons/dp_custom/views/sale_views.xml b/ext/custom-addons/dp_custom/views/sale_views.xml index 02c8dcca..b01a07da 100644 --- a/ext/custom-addons/dp_custom/views/sale_views.xml +++ b/ext/custom-addons/dp_custom/views/sale_views.xml @@ -24,6 +24,11 @@ style="padding-left:30px;padding-right:30px;background-color:red;"/>
+ +
+
+ + @@ -251,6 +256,7 @@ + diff --git a/ext/custom-addons/dp_reports/data/paperformat.xml b/ext/custom-addons/dp_reports/data/paperformat.xml index 753dec31..07871062 100644 --- a/ext/custom-addons/dp_reports/data/paperformat.xml +++ b/ext/custom-addons/dp_reports/data/paperformat.xml @@ -7,8 +7,8 @@ 0 0 Portrait - 40 - 20 + 35 + 15 10 0 diff --git a/ext/custom-addons/dp_reports/static/src/less/report_backend.less b/ext/custom-addons/dp_reports/static/src/less/report_backend.less index ed6753d6..1f9b7f47 100644 --- a/ext/custom-addons/dp_reports/static/src/less/report_backend.less +++ b/ext/custom-addons/dp_reports/static/src/less/report_backend.less @@ -86,12 +86,21 @@ thead.table-header { color: white; } +/* tbody.sale-tbody, tbody.invoice-tbody, tbody.stock-tbody { background-color: #E6E7E9; margin-top: 0; margin-bottom: 0; border-bottom: 2px solid #A72523; } +*/ + +tbody.sale-tbody, tbody.invoice-tbody, tbody.stock-tbody { + background-color: #FFFFFF; + margin-top: 0; + margin-bottom: 0; + border-bottom: 2px solid #A72523; +} tbody.production-tbody { background-color: #FFFFFF; @@ -100,11 +109,19 @@ tbody.production-tbody { border-bottom: 2px solid #000000; } +/* tbody.totals-tbody { background-color: #E6E7E9; margin-top: 0; margin-bottom: 0; } +*/ + +tbody.totals-tbody { + background-color: #FFFFFF; + margin-top: 0; + margin-bottom: 0; +} tr.border_lower_black { border-bottom: 2px solid #000000; diff --git a/ext/custom-addons/dp_reports_account/reports/invoice.xml b/ext/custom-addons/dp_reports_account/reports/invoice.xml index 3ac87095..8da5d57d 100644 --- a/ext/custom-addons/dp_reports_account/reports/invoice.xml +++ b/ext/custom-addons/dp_reports_account/reports/invoice.xml @@ -54,7 +54,7 @@
- Ansprechpartner: + Auftragsbearbeiter: diff --git a/ext/custom-addons/dp_reports_purchase/reports/purchase.xml b/ext/custom-addons/dp_reports_purchase/reports/purchase.xml index 81ab8968..e0219d00 100644 --- a/ext/custom-addons/dp_reports_purchase/reports/purchase.xml +++ b/ext/custom-addons/dp_reports_purchase/reports/purchase.xml @@ -38,7 +38,7 @@ t-options='{"format": "dd.MM.yyyy"}'/>
- Ansprechpartner: + Auftragsbearbeiter:
- Ansprechpartner: + Auftragsbearbeiter:
- Ansprechpartner: + Auftragsbearbeiter: diff --git a/ext/custom-addons/tz_reports_production/reports/report_production.xml b/ext/custom-addons/tz_reports_production/reports/report_production.xml index 6a811dee..0905d8bb 100644 --- a/ext/custom-addons/tz_reports_production/reports/report_production.xml +++ b/ext/custom-addons/tz_reports_production/reports/report_production.xml @@ -46,7 +46,7 @@ - Ansprechpartner: + Auftragsbearbeiter: