sale_order.py 654 B

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