summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay (Open ERP) <jvo@tinyerp.com>2009-09-14 17:30:17 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2009-09-14 17:30:17 +0530
commit9bee299b7fd0c8afe6ae2f2d574fc8945dcc97d7 (patch)
tree31687baf4ece0730d3dccd24ee9b3fd6c19cf45a
parentf30db50e9a96b9f90dbae12e78c2dd3a19a9c5e3 (diff)
[FIX] hr_timesheet_invoice : Invoicing analytic entries wizard corrected for product
lp bug: https://launchpad.net/bugs/427982 fixed bzr revid: jvo@tinyerp.com-20090914120017-n04v3zplm78d1shu
-rw-r--r--addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
index 2b769cd1eae..6a7d878d1ae 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -92,19 +92,25 @@ class invoice_create(wizard.interface):
"AND id IN (" + ','.join([str(x) for x in data['ids']]) + ") " \
"AND to_invoice IS NOT NULL " \
"GROUP BY product_id,to_invoice", (account.id,))
+
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 one line has no product !'))
factor_name = ''
factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
- if factor.customer_name:
- factor_name = product.name+' - '+factor.customer_name
+
+ if not data['form']['product']:
+ if factor.customer_name:
+ factor_name = product.name+' - '+factor.customer_name
+ else:
+ factor_name = product.name
else:
- factor_name = product.name
+ factor_name = pool.get('product.product').name_get(cr, uid, [data['form']['product']], context=context)[0][1]
+
if account.pricelist_id:
pl = account.pricelist_id.id
- price = pool.get('product.pricelist').price_get(cr,uid,[pl], product_id, qty or 1.0, account.partner_id.id)[pl]
+ price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['form']['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
else:
price = 0.0
@@ -125,7 +131,7 @@ class invoice_create(wizard.interface):
'account_id': account_id,
'account_analytic_id': account.id,
}
-
+
#
# Compute for lines
#