# -*- encoding: utf-8 -*- from openerp import models, fields, api, tools, _ from openerp.exceptions import Warning class sale_order(models.Model): _inherit = 'sale.order' def print_quotation2(self, cr, uid, ids, context=None): ''' This function prints the sales order and mark it as sent, so that we can see more easily the next step of the workflow ''' assert len(ids) == 1, 'This option should only be used for a single id at a time' self.signal_workflow(cr, uid, ids, 'quotation_sent') return self.pool['report'].get_action(cr, uid, ids, 'new_pdf_formats.report_saleorder', context=context)