[FIX] sale,l10n_de_sale: Add the proforma in the title for din5008 sale report
Step to reproduce: - install sale, accounting and l10n_de - activate proforma in sale settings - set the template to external_layout_din5008 in the settings (use developer mod) - create sales order or quotation - print it as a proforma Current behavior: - the proforma is missing from the title in the document Behaviour after PR: - the proforma is in the document title The l10n_de_sale module was missing the case scenario of a proforma sales report and the sale module only gives the information of a proforma report in the xml context. Then we add the case scenario and propagate the proforma info from the sale module also in the python context using the proforma variable. opw-2796603 closes odoo/odoo#88153 X-original-commit: 14e0f84abeba8453930522047df3610940d6aa9a Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -72,6 +72,12 @@ msgstr ""
|
||||
msgid "Order No."
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_din5008_sale
|
||||
#: code:addons/l10n_din5008_sale/models/sale.py:0
|
||||
#, python-format
|
||||
msgid "Pro Forma Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_din5008_sale
|
||||
#: code:addons/l10n_din5008_sale/models/sale.py:0
|
||||
#, python-format
|
||||
|
||||
@@ -33,7 +33,9 @@ class SaleOrder(models.Model):
|
||||
|
||||
def _compute_l10n_din5008_document_title(self):
|
||||
for record in self:
|
||||
if record.state in ('draft', 'sent'):
|
||||
if self._context.get('proforma'):
|
||||
record.l10n_din5008_document_title = _('Pro Forma Invoice')
|
||||
elif record.state in ('draft', 'sent'):
|
||||
record.l10n_din5008_document_title = _('Quotation')
|
||||
else:
|
||||
record.l10n_din5008_document_title = _('Sales Order')
|
||||
|
||||
@@ -192,6 +192,7 @@
|
||||
<template id="report_saleorder_pro_forma">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="is_pro_forma" t-value="True"/>
|
||||
<t t-set="docs" t-value="docs.with_context(proforma=True)"/>
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user