Skip to content

Commit 05f4d5e

Browse files
committed
[IMP] account_einvoice_generate: post_install script to set is_invoice_report to True on the invoice repot "PDF without Payment"
1 parent d1cb7e8 commit 05f4d5e

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

account_einvoice_generate/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
from . import models
44
from . import wizards
5+
from .post_install import update_invoice_report_config

account_einvoice_generate/__manifest__.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"website": "https://github.com/OCA/edi",
1414
"depends": ["account"],
1515
"data": ["views/res_config_settings.xml"],
16+
"post_init_hook": "update_invoice_report_config",
1617
"installable": True,
1718
}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2024 Akretion France (https://www.akretion.com/)
2+
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
3+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4+
5+
# In v17, the method _is_invoice_report(report_ref) of ir.actions.report
6+
# was returning True for the 2 invoices reports.
7+
# In v18, a new boolean field is_invoice_report was added to ir.actions.report
8+
# but, surprisingly, it is set to True for report XMLID account.account_invoices
9+
# but left to False for report XMLID account.account_invoices_without_payment
10+
# (which is the report that users can access via the print menu).
11+
# This post_install script fixes this.
12+
def update_invoice_report_config(env):
13+
env.ref("account.account_invoices_without_payment").write(
14+
{"is_invoice_report": True}
15+
)

0 commit comments

Comments
 (0)