[FIX] account: simplify report implem. for studio

If in web_studio we:

- duplicate "Invoices" report
- delete "Invoices" report

The duplication will not work anymore, since the report class
report.account.report_invoice_with_payments is shared but requires
account.report_invoice_with_payments (original report).

With this changeset, we forgo checking model type of report since it
should always be account.invoice anyway.

opw-2045435
closes #35349

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2019-07-31 14:05:55 +00:00
parent 4f90ce5f23
commit 32976c7f49
@@ -189,10 +189,9 @@ class ReportInvoiceWithPayment(models.AbstractModel):
@api.model
def _get_report_values(self, docids, data=None):
report = self.env['ir.actions.report']._get_report_from_name('account.report_invoice_with_payments')
return {
'doc_ids': docids,
'doc_model': report.model,
'docs': self.env[report.model].browse(docids),
'doc_model': 'account.invoice',
'docs': self.env['account.invoice'].browse(docids),
'report_type': data.get('report_type') if data else '',
}