I have to check the product type of each line in the sale.order.line before invoicing. So in the sale.py I have added the code under action_invoice_create(self, grouped=False, final=False) method (line 342 of source code).
But the code doesn't enter the print condition according to the product type. How to correct?
if group_key not in invoices:
if 'product_id.product_tmpl_id.type' == 'service':
print 'Service product'
elif 'product_id.product_tmpl_id.type' == 'stockable':
print 'Stockable product'
else:
print 'Service product'