From 4def9ef90a834190e357bd989c5caf62bb02fe37 Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Thu, 28 Dec 2017 14:13:14 +0100 Subject: [PATCH] Dokumentenvorlagen: Angebot --- ext/custom-addons/dp_custom/__manifest__.py | 1 + .../dp_custom/models/res_company.py | 4 +- ext/custom-addons/dp_custom/models/sale.py | 12 ++ .../dp_custom/views/res_company_views.xml | 15 ++ .../dp_reports/models/res_company.py | 6 +- .../dp_reports/reports/report_templates.xml | 64 ++++++--- .../dp_reports_sale/reports/sale.xml | 132 +++++++++++------- setup/lib/config_tza.py | 1 + 8 files changed, 161 insertions(+), 74 deletions(-) create mode 100644 ext/custom-addons/dp_custom/views/res_company_views.xml diff --git a/ext/custom-addons/dp_custom/__manifest__.py b/ext/custom-addons/dp_custom/__manifest__.py index e3b580ca..53c3eef9 100644 --- a/ext/custom-addons/dp_custom/__manifest__.py +++ b/ext/custom-addons/dp_custom/__manifest__.py @@ -51,6 +51,7 @@ 'views/material_type_views.xml', 'views/product_views.xml', 'views/ir_attachment_views.xml', + 'views/res_company_views.xml', 'security/ir.model.access.csv', ], 'installable': True, diff --git a/ext/custom-addons/dp_custom/models/res_company.py b/ext/custom-addons/dp_custom/models/res_company.py index 52c78e23..68d330a3 100644 --- a/ext/custom-addons/dp_custom/models/res_company.py +++ b/ext/custom-addons/dp_custom/models/res_company.py @@ -21,12 +21,14 @@ import os import base64 -from odoo import models, api +from odoo import models, api, fields class Company(models.Model): _inherit = 'res.company' + eori_nr = fields.Char(string='EORI-Nr') + @api.model def set_company_logo(self, company, logo): filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), logo) diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index 1f7ad61f..e1781312 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -42,6 +42,18 @@ class SaleOrder(models.Model): quote_name = fields.Char(compute='_compute_quote_name') internal_notes = fields.Text() assembly_notes = fields.Text() + earliest_scheduled_date = fields.Datetime(compute='_compute_earliest_scheduled_date') + + @api.multi + def _compute_earliest_scheduled_date(self): + for record in self: + earliest_scheduled_date = False + for picking in record.picking_ids: + if not earliest_scheduled_date or earliest_scheduled_date > fields.Datetime.from_string( + picking.scheduled_date): + earliest_scheduled_date = fields.Datetime.from_string(picking.scheduled_date) + if earliest_scheduled_date: + record.earliest_scheduled_date = earliest_scheduled_date @api.multi def _compute_quote_name(self): diff --git a/ext/custom-addons/dp_custom/views/res_company_views.xml b/ext/custom-addons/dp_custom/views/res_company_views.xml new file mode 100644 index 00000000..aa6beb28 --- /dev/null +++ b/ext/custom-addons/dp_custom/views/res_company_views.xml @@ -0,0 +1,15 @@ + + + + + res_company_form_view + res.company + + + + + + + + + diff --git a/ext/custom-addons/dp_reports/models/res_company.py b/ext/custom-addons/dp_reports/models/res_company.py index ef716a98..2e79e80a 100644 --- a/ext/custom-addons/dp_reports/models/res_company.py +++ b/ext/custom-addons/dp_reports/models/res_company.py @@ -1,9 +1,9 @@ +# -*- coding: utf-8 -*- - -from odoo import models, fields, api +from odoo import models, fields class Company(models.Model): _inherit = 'res.company' - external_report_layout = fields.Selection(selection_add=[("custom", "Custom")]) + external_report_layout = fields.Selection(selection_add=[("custom", "Custom")], default='custom') diff --git a/ext/custom-addons/dp_reports/reports/report_templates.xml b/ext/custom-addons/dp_reports/reports/report_templates.xml index 5ed9b315..01c32838 100644 --- a/ext/custom-addons/dp_reports/reports/report_templates.xml +++ b/ext/custom-addons/dp_reports/reports/report_templates.xml @@ -9,11 +9,13 @@ diff --git a/ext/custom-addons/dp_reports_sale/reports/sale.xml b/ext/custom-addons/dp_reports_sale/reports/sale.xml index 566ff58b..43cda36d 100644 --- a/ext/custom-addons/dp_reports_sale/reports/sale.xml +++ b/ext/custom-addons/dp_reports_sale/reports/sale.xml @@ -7,7 +7,9 @@
-
+
+ Kundendaten +
@@ -18,49 +20,69 @@
+
+ Email: + +
+ Telefon: +
-
-
-
-
+
+ Lieferadresse +
+ + + +
+ +
+ + +
+ +
+
+
Kundennr.:
-
+
Ihre UID:
-
+
Ihre Referenz:
-
+
Angebotsdatum:
-
+
+ Lieferdatum: + +
+
Gültig bis:
-
+
Bestelldatum:
-
+
Ansprechpartner:
-
+
Email:
-
+
Telefon:
@@ -94,36 +116,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +
+

+ Zolltarif Nr.: + +

+ + + + + + + + + + + + + + + + + + + +
- -
+
@@ -160,11 +194,15 @@

-

- - -
-
+

+ Lieferkonditionen: + +
+

+

+ Zahlungskonditionen: + +

diff --git a/setup/lib/config_tza.py b/setup/lib/config_tza.py index 863eac1a..76765ba6 100644 --- a/setup/lib/config_tza.py +++ b/setup/lib/config_tza.py @@ -23,6 +23,7 @@ class ConfigTZA(Config): 'vat': 'ATU 54619104', 'vat_check_vies': True, 'logo': '../ext/custom-addons/dp_custom/static/src/img/logo.png', + 'eori_nr': 'ATEOSI 0000 11273', #'favicon_backend': '../ext/custom-addons/dp_custom/static/src/img/favicon.ico', #'favicon_backend_mimetype': 'image/x-icon' }