You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
970 B

9 years ago
  1. # -*- coding: utf-8 -*-
  2. # © 2014-2015 ACSONE SA/NV (<http://acsone.eu>)
  3. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
  4. import logging
  5. from openerp import api, models
  6. _logger = logging.getLogger(__name__)
  7. class Report(models.Model):
  8. _inherit = "report"
  9. @api.v7
  10. def get_pdf(self, cr, uid, ids, report_name, html=None, data=None,
  11. context=None):
  12. if ids:
  13. report = self._get_report_from_name(cr, uid, report_name)
  14. obj = self.pool[report.model].browse(cr, uid, ids,
  15. context=context)[0]
  16. context = context.copy()
  17. if hasattr(obj, 'landscape_pdf') and obj.landscape_pdf:
  18. context.update({'landscape': True})
  19. return super(Report, self).get_pdf(cr, uid, ids, report_name,
  20. html=html, data=data,
  21. context=context)