Guest User

module invoice description 2.6

a guest
May 10th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. from __future__ import with_statement
  2. from trytond.model import Workflow, ModelView, ModelSQL, fields
  3. from trytond.pool import Pool, PoolMeta
  4.  
  5. __all__ = ['Sale']
  6. __metaclass__ = PoolMeta
  7.  
  8. class Sale(Workflow, ModelSQL, ModelView):
  9.     'Sale'
  10.     __name__ = 'sale.sale'
  11.  
  12.  
  13.     @classmethod
  14.     def create_invoice(self, invoice_type):
  15.         invoice_id = super(Sale, self).create_invoice(sale, invoice_type)
  16.         pool = Pool()
  17.         Invoice = pool.get('account.invoice')
  18.         Sale = pool.get('sale.sale')
  19.         description = Sale.description
  20.         if invoice_id:
  21.             Invoice.write(invoice_id, {'description':description})
  22.         return invoice_id
Advertisement
Add Comment
Please, Sign In to add comment