[FIX] base, report: fixes various bugs introduced when 'refactoring' reports

Commit https://github.com/odoo/odoo/commit/e80238042c9d93d492ea8b06b0041aced0d81dcd refactored and removed report
module. However it broke among other the feature allowing to customize
reports. This commit fixes first bugs preventing the 'choose template'
box to appear. Feature is still broken though.
This commit is contained in:
Thibault Delavallée
2017-05-11 11:13:55 +02:00
parent a60b3b6c8c
commit e6ba4e5f35
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo import api, fields, models, _
class BaseConfigSettings(models.TransientModel):
@@ -97,10 +98,10 @@ class BaseConfigSettings(models.TransientModel):
def edit_external_header(self):
return self._prepare_report_view_action('web.external_layout_' + self.external_report_layout)
@api.model
@api.multi
def change_report_template(self):
self.ensure_one()
template = self.env.ref('report.view_company_report_form', False)
template = self.env.ref('base.view_company_report_form')
return {
'name': _('Choose Your Document Layout'),
'type': 'ir.actions.act_window',
+1 -1
View File
@@ -676,7 +676,7 @@ class IrActionsReport(models.Model):
:param report_name: Name of the template to generate an action for
"""
if (self.env.uid == SUPERUSER_ID) and ((not self.env.user.company_id.external_report_layout) or (not self.env.user.company_id.logo)) and config:
template = self.env.ref('report.view_company_report_form', False)
template = self.env.ref('base.view_company_report_form')
return {
'name': _('Choose Your Document Layout'),
'type': 'ir.actions.act_window',