Folder_addSaleInvoice.py 1 KB
Newer Older
1
## Script (Python) "Folder_addSaleInvoice"
Jean-Paul Smets's avatar
Jean-Paul Smets committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=folder, id
##title=
##
product = container.manage_addProduct[ 'ERP5' ]

product.addTransaction(id) 
my_transaction = folder[id]

product = my_transaction.manage_addProduct[ 'ERP5' ]

context.portal_types.constructContent(type_name= 'Sale Invoice Transaction Line',
                           container=my_transaction,
19
                           id='income')
Jean-Paul Smets's avatar
Jean-Paul Smets committed
20 21
context.portal_types.constructContent(type_name= 'Sale Invoice Transaction Line',
                           container=my_transaction,
22
                           id='receivable')
Jean-Paul Smets's avatar
Jean-Paul Smets committed
23 24
context.portal_types.constructContent(type_name= 'Sale Invoice Transaction Line',
                           container=my_transaction,
25 26 27 28
                           id='collected_vat')
income=my_transaction.income
receivable=my_transaction.receivable
collected_vat=my_transaction.collected_vat
Jean-Paul Smets's avatar
Jean-Paul Smets committed
29 30

return my_transaction