diff --git a/odoo/addons/base/tests/test_reports.py b/odoo/addons/base/tests/test_reports.py index b783b4de671..7a550554736 100644 --- a/odoo/addons/base/tests/test_reports.py +++ b/odoo/addons/base/tests/test_reports.py @@ -12,16 +12,21 @@ _logger = logging.getLogger(__name__) @odoo.tests.tagged('post_install', '-at_install', 'post_install_l10n') class TestReports(odoo.tests.TransactionCase): def test_reports(self): - domain = [('report_type', 'like', 'qweb')] - for report in self.env['ir.actions.report'].search(domain): + invoice_domain = [('move_type', 'in', ('out_invoice', 'out_refund', 'out_receipt', 'in_invoice', 'in_refund', 'in_receipt'))] + specific_model_domains = { + 'account.report_original_vendor_bill': [('move_type', 'in', ('in_invoice', 'in_receipt'))], + 'account.report_invoice_with_payments': invoice_domain, + 'account.report_invoice': invoice_domain, + } + for report in self.env['ir.actions.report'].search([('report_type', 'like', 'qweb')]): report_model = 'report.%s' % report.report_name try: self.env[report_model] except KeyError: # Only test the generic reports here _logger.info("testing report %s", report.report_name) - report_model = self.env[report.model] - report_records = report_model.search([], limit=10) + report_model_domain = specific_model_domains.get(report.report_name, []) + report_records = self.env[report.model].search(report_model_domain, limit=10) if not report_records: _logger.info("no record found skipping report %s", report.report_name)