hr_timesheet_invoice: add test if lines have product
bzr revid: ced-1db81e0e9041e0b999e5ed972ca6653c45250e03
This commit is contained in:
parent
bcf8ecf5da
commit
c516938e5e
|
@ -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']))))
|
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():
|
for product_id,factor_id,qty in cr.fetchall():
|
||||||
product = pool.get('product.product').browse(cr, uid, product_id, context2)
|
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_name = ''
|
||||||
factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
|
factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
|
||||||
if factor.customer_name:
|
if factor.customer_name:
|
||||||
|
|
Loading…
Reference in New Issue