[FIX] l10n_fr: enable invoice name on each page

Steps to reproduce:
- create an invoice with a certain number of items so that when printed there are multiple pages

Issue:
- the invoice name does not appear on each page
According to the French legislation it is mandatory

See https://entreprendre.service-public.fr/vosdroits/F31808

Solution:
- set a config parameter specifically for l10n_fr in stable
- set it in account directly for Master
To allow the footer of the invoice to contain the name (and therefore the number) of the invoice

opw-3199906

closes odoo/odoo#124989

X-original-commit: 7b071c995f1c9587cf4de56d6d1a632ea39db8ac
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
This commit is contained in:
Yolann Sabaux
2023-06-15 16:02:26 +02:00
parent 960de00ea2
commit a9d56620d2
4 changed files with 23 additions and 0 deletions
@@ -49,8 +49,12 @@ class IrActionsReport(models.Model):
def _render_qweb_pdf(self, report_ref, res_ids=None, data=None):
# Check for reports only available for invoices.
# + append context data with the display_name_in_footer parameter
if self._get_report(report_ref).report_name in ('account.report_invoice_with_payments', 'account.report_invoice'):
invoices = self.env['account.move'].browse(res_ids)
if self.env['ir.config_parameter'].sudo().get_param('account.display_name_in_footer'):
data = data and dict(data) or {}
data.update({'display_name_in_footer': True})
if any(x.move_type == 'entry' for x in invoices):
raise UserError(_("Only invoices could be printed."))
+1
View File
@@ -35,6 +35,7 @@ configuration of their taxes and fiscal positions manually.
],
'data': [
'data/account_chart_template_data.xml',
'data/account_data.xml',
'views/l10n_fr_view.xml',
'data/tax_report_data.xml',
'data/res_country_data.xml',
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<record forcecreate="True" id="display_name_in_footer_param" model="ir.config_parameter">
<field name="key">account.display_name_in_footer</field>
<field name="value">True</field>
</record>
</data>
</odoo>
+9
View File
@@ -333,6 +333,9 @@
of
<span class="topage"/>
</div>
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
<span t-field="o.name"/>
</div>
</div>
</div>
</template>
@@ -375,6 +378,9 @@
<div t-if="report_type == 'pdf'">
Page: <span class="page"/> / <span class="topage"/>
</div>
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
<span t-field="o.name"/>
</div>
</div>
</div>
</template>
@@ -470,6 +476,9 @@
<div t-if="report_type == 'pdf'" class="text-muted">
Page: <span class="page"/> / <span class="topage"/>
</div>
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
<span t-field="o.name"/>
</div>
</div>
</div>
</template>