parser.py 882 B

1234567891011121314151617181920212223242526
  1. # -*- coding: utf-8 -*-
  2. from functools import partial
  3. from openerp.osv import osv
  4. from openerp import exceptions, _
  5. class MoconaReport(osv.AbstractModel):
  6. _name = 'report.project_features_dental_mocona.mocona_report'
  7. def render_html(self, cr, uid, ids, data=None, context=None):
  8. report_obj = self.pool['report']
  9. report_mocona_obj = self.pool['project.task']
  10. report = report_obj._get_report_from_name(
  11. cr, uid, 'project_features_dental_mocona.mocona_report')
  12. selected_orders = report_mocona_obj.browse(
  13. cr, uid, ids, context=context)
  14. docargs = {
  15. 'doc_ids': ids,
  16. 'doc_model': report.model,
  17. 'docs': selected_orders,
  18. }
  19. return report_obj.render(
  20. cr, uid, ids, 'project_features_dental_mocona.mocona_report',
  21. docargs, context=context)