From f2c37357cdeb30388c9272dcd67711351eeb33e8 Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Fri, 30 Mar 2018 18:29:22 +0200 Subject: [PATCH] Fall 5399: CR1 - Neues Feld Freigabenr. --- dev/scripts/interfaces/sst03_pg_create_quotation.py | 1 + ext/custom-addons/dp_custom/models/sale.py | 3 ++- ext/custom-addons/dp_custom/views/sale_views.xml | 9 +++++++++ .../dp_reports_account/models/account_invoice.py | 3 +++ ext/custom-addons/dp_reports_account/reports/invoice.xml | 2 +- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dev/scripts/interfaces/sst03_pg_create_quotation.py b/dev/scripts/interfaces/sst03_pg_create_quotation.py index 4ef103e9..33f92a86 100755 --- a/dev/scripts/interfaces/sst03_pg_create_quotation.py +++ b/dev/scripts/interfaces/sst03_pg_create_quotation.py @@ -29,6 +29,7 @@ values = { "date_order": "2017-11-21", "assembled": True, "line_id": "0000", + 'confirmation_nr': 'FR000001', "portal_id": "59-0001", "portal_delivery_id": "111112", "delivery_firstname": "Huber", diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index 2e26420f..43dbccef 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -50,6 +50,7 @@ class SaleOrder(models.Model): positions = fields.Integer(string='Positionen', compute='_compute_positions') num_items = fields.Integer(string='Anzahl der Artikel', compute='_compute_num_items') weight_total = fields.Float(string='Gesamtgewicht', compute='_compute_weight_total') + confirmation_nr = fields.Char('Freigabe-Nr.') @api.multi def _compute_weight_total(self): @@ -259,7 +260,7 @@ class SaleOrder(models.Model): def _get_specified_fields(self): return ['origin', 'client_order_ref', 'note', 'date_order', 'assembled', 'line_id', 'partner_id', 'fiscal_position_id', 'user_id', 'payment_term_id', 'partner_delivery_id', 'partner_invoice_id', - 'assembly_state'] + 'assembly_state', 'confirmation_nr'] @api.multi def write(self, vals): diff --git a/ext/custom-addons/dp_custom/views/sale_views.xml b/ext/custom-addons/dp_custom/views/sale_views.xml index 31f28bd8..ae3ee58b 100644 --- a/ext/custom-addons/dp_custom/views/sale_views.xml +++ b/ext/custom-addons/dp_custom/views/sale_views.xml @@ -39,6 +39,9 @@ + + + @@ -50,6 +53,9 @@ + + + @@ -61,6 +67,9 @@ + + + diff --git a/ext/custom-addons/dp_reports_account/models/account_invoice.py b/ext/custom-addons/dp_reports_account/models/account_invoice.py index 75950b9c..335c4d2f 100644 --- a/ext/custom-addons/dp_reports_account/models/account_invoice.py +++ b/ext/custom-addons/dp_reports_account/models/account_invoice.py @@ -24,4 +24,7 @@ class AccountInvoice(models.Model): for line in category['lines']: price_subtotal += line.price_subtotal category['price_subtotal'] = price_subtotal + sale_order = self.env['sale.order'].search([('name', '=', category['name'])]) + if sale_order: + category['confirmation_nr'] = sale_order.confirmation_nr return res diff --git a/ext/custom-addons/dp_reports_account/reports/invoice.xml b/ext/custom-addons/dp_reports_account/reports/invoice.xml index 8502ac58..d87ed139 100644 --- a/ext/custom-addons/dp_reports_account/reports/invoice.xml +++ b/ext/custom-addons/dp_reports_account/reports/invoice.xml @@ -104,7 +104,7 @@ - - + - -