~donkirkby/openobject-addons/stock-serial

« back to all changes in this revision

Viewing changes to sale/sale.py

  • Committer: Jay(Open ERP)
  • Date: 2010-04-29 15:31:04 UTC
  • Revision ID: jvo@tinyerp.com-20100429153104-ulg4ju5xan1ang8i
[FIX] Account_analytic_default : Invoice creation from SO corected

Show diffs side-by-side

added added

removed removed

Lines of Context:
417
417
            for line in o.order_line:
418
418
                if (line.state in states) and not line.invoiced:
419
419
                    lines.append(line.id)
420
 
            if not lines:
421
 
                 raise osv.except_osv(_('Warning'),_('Invoice cannot be created for this Sale Order due to one of the following reasons:\n1.The state is not in %s!\n2.The Sale Order Lines are Invoiced!')%(states,))
422
420
            created_lines = self.pool.get('sale.order.line').invoice_line_create(cr, uid, lines)
423
421
            if created_lines:
424
422
                invoices.setdefault(o.partner_id.id, []).append((o, created_lines))