Browse Source

Merge pull request #270 from astirpe/patch-1

[10.0][FIX] mis_builder: local variable 'ctx' referenced before assignment
pull/272/head
Eric @ Elico Corp 8 years ago
committed by GitHub
parent
commit
3409cc9ff2
  1. 2
      mis_builder/report/mis_report_instance_qweb.py

2
mis_builder/report/mis_report_instance_qweb.py

@ -14,10 +14,10 @@ class Report(models.Model):
@api.model @api.model
def get_pdf(self, docids, report_name, html=None, data=None): def get_pdf(self, docids, report_name, html=None, data=None):
ctx = self.env.context.copy()
if docids: if docids:
report = self._get_report_from_name(report_name) report = self._get_report_from_name(report_name)
obj = self.env[report.model].browse(docids)[0] obj = self.env[report.model].browse(docids)[0]
ctx = self.env.context.copy()
if hasattr(obj, 'landscape_pdf') and obj.landscape_pdf: if hasattr(obj, 'landscape_pdf') and obj.landscape_pdf:
ctx.update({'landscape': True}) ctx.update({'landscape': True})
return super(Report, self.with_context(ctx)).get_pdf( return super(Report, self.with_context(ctx)).get_pdf(

Loading…
Cancel
Save