parser.py 884 B

123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  2. from functools import partial
  3. from openerp.osv import osv
  4. from openerp import exceptions, _
  5. from reportlab.graphics.barcode import createBarcodeDrawing
  6. class PartnerReport(osv.AbstractModel):
  7. _name = 'report.eiru_ticket_sharon.partner_report'
  8. def render_html(self, cr, uid, ids, data=None, context=None):
  9. report_obj = self.pool['report']
  10. obj = self.pool['account.invoice']
  11. report = report_obj._get_report_from_name(
  12. cr, uid, 'eiru_ticket_sharon.partner_report')
  13. selected_orders = obj.browse(
  14. cr, uid, ids, context=context)
  15. docargs = {
  16. 'doc_ids': ids,
  17. 'doc_model': report.model,
  18. 'docs': selected_orders,
  19. }
  20. return report_obj.render(
  21. cr, uid, ids, 'eiru_ticket_sharon.partner_report',
  22. docargs, context=context)