hr_timesheet_invoice: add test if lines have product

bzr revid: ced-1db81e0e9041e0b999e5ed972ca6653c45250e03
This commit is contained in:
ced 2007-07-11 15:10:09 +00:00
parent bcf8ecf5da
commit c516938e5e
1 changed files with 2 additions and 0 deletions

View File

@ -72,6 +72,8 @@ class invoice_create(wizard.interface):
cr.execute("SELECT product_id,to_invoice,sum(unit_amount) FROM account_analytic_line as line WHERE account_id = %d and id IN (%s) GROUP BY product_id,to_invoice" % (account.id, ','.join(map(str,data['ids']))))
for product_id,factor_id,qty in cr.fetchall():
product = pool.get('product.product').browse(cr, uid, product_id, context2)
if not product:
raise wizard.except_wizard('Error', 'At least on line have no product !')
factor_name = ''
factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
if factor.customer_name: