summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2018-01-16 10:14:57 +0100
committerGoffin Simon <sig@odoo.com>2018-01-17 09:13:35 +0100
commit733ce266ef793652f5958c24e2a8a6f443432552 (patch)
tree753f1767a793d925079b7a0b39543761d5f00c9c
parent22e458775a1757e9952bfb498b0014906825358a (diff)
[FIX] base, hr_holidays: Printing leaves by department report with no logo
When calling the function report_action from write_company_and_print_report, it failed because all the required data from the transient model "hr.holidays.summary.dept" were lost. opw:803051
-rw-r--r--addons/hr_holidays/wizard/hr_holidays_summary_department.py2
-rw-r--r--odoo/addons/base/ir/ir_actions_report.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department.py b/addons/hr_holidays/wizard/hr_holidays_summary_department.py
index 82a398c3c4c..1d8cf868b46 100644
--- a/addons/hr_holidays/wizard/hr_holidays_summary_department.py
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_department.py
@@ -31,4 +31,4 @@ class HolidaysSummaryDept(models.TransientModel):
'model': 'hr.department',
'form': data
}
- return self.env.ref('hr_holidays.action_report_holidayssummary').report_action(departments, data=datas)
+ return self.env.ref('hr_holidays.action_report_holidayssummary').with_context(from_transient_model=True).report_action(departments, data=datas)
diff --git a/odoo/addons/base/ir/ir_actions_report.py b/odoo/addons/base/ir/ir_actions_report.py
index f4e3648b578..3d66287289a 100644
--- a/odoo/addons/base/ir/ir_actions_report.py
+++ b/odoo/addons/base/ir/ir_actions_report.py
@@ -678,7 +678,7 @@ class IrActionsReport(models.Model):
"""
discard_logo_check = self.env.context.get('discard_logo_check')
if (self.env.uid == SUPERUSER_ID) and ((not self.env.user.company_id.external_report_layout) or (not discard_logo_check and not self.env.user.company_id.logo)) and config:
- template = self.env.ref('base.view_company_report_form_with_print')
+ template = self.env.ref('base.view_company_report_form_with_print') if self.env.context.get('from_transient_model', False) else self.env.ref('base.view_company_report_form')
return {
'name': _('Choose Your Document Layout'),
'type': 'ir.actions.act_window',