[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) <whe@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
This commit is contained in:
Merlin (megu)
2022-03-30 16:34:10 +02:00
parent c31423a756
commit b0a614bfb9
-11
View File
@@ -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 = []