From b0a614bfb914831bf226cb6ce012f659997d92b4 Mon Sep 17 00:00:00 2001 From: "Merlin (megu)" Date: Wed, 9 Mar 2022 11:39:39 +0000 Subject: [PATCH] [FIX] l10n_de_stock: delivery slip template data Delivery slip with the document layout `external_layout_din5008` should not contain two times the order number and shipping date Steps to reproduce: 1. Install Sales and Inventory apps and l10n_de module 2. Select the german company 3. Create and confirm a sale order with and specify a customer and a product 4. Open the delivery through the Delivery smart button 5. Print the Delivery Slip 6. The order and shipping date are displayed two times; once on the top right, another time under the document title Solution: Remove `l10n_din5008_template_data` because it's a redundant information The order number and shipping date that it previously contained were already displayed in the report template https://github.com/odoo/odoo/blob/ec90e9bfee208761f8247b55260895990b7614ed/addons/stock/report/report_deliveryslip.xml#L49-L53 so `l10n_de_template_data` should be removed and this is the simplest way without touching din5008_report.xml opw-2761919 closes odoo/odoo#87573 X-original-commit: 4ebcc46098b3849098184f3efb67032862d88062 Signed-off-by: William Henrotin (whe) Signed-off-by: Guillaume Merlin (megu) --- addons/l10n_din5008_stock/models/stock.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/addons/l10n_din5008_stock/models/stock.py b/addons/l10n_din5008_stock/models/stock.py index 5342ffed4c6..7cad27b9145 100644 --- a/addons/l10n_din5008_stock/models/stock.py +++ b/addons/l10n_din5008_stock/models/stock.py @@ -5,19 +5,8 @@ from odoo.tools import format_date class StockPicking(models.Model): _inherit = 'stock.picking' - l10n_din5008_template_data = fields.Binary(compute='_compute_l10n_din5008_template_data') l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses') - def _compute_l10n_din5008_template_data(self): - for record in self: - record.l10n_din5008_template_data = data = [] - if record.origin: - data.append((_("Order"), record.origin)) - if record.state == 'done': - data.append((_("Shipping Date"), format_date(self.env, record.date_done))) - else: - data.append((_("Shipping Date"), format_date(self.env, record.scheduled_date))) - def _compute_l10n_din5008_addresses(self): for record in self: record.l10n_din5008_addresses = data = []