[FIX] hr_timehseet_invoice: allow use force product

bzr revid: mat@openerp.com-20130621122639-sfcb7q1pwquiz46l
This commit is contained in:
Martin Trigaux 2013-06-21 14:26:39 +02:00
parent ca2d1a1c37
commit 9caf5ef64c
1 changed files with 21 additions and 21 deletions

View File

@ -176,7 +176,7 @@ class account_analytic_line(osv.osv):
journal_types = {}
price = 0.0
for line in self.pool.get('account.analytic.line').browse(cr, uid, ids, context=context):
price = abs(line.amount)
price += abs(line.amount)
line_name = line.name
if line.journal_id.type not in journal_types:
journal_types[line.journal_id.type] = set()
@ -208,7 +208,6 @@ class account_analytic_line(osv.osv):
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
context2 = context.copy()
context2['lang'] = partner.lang
# set company_id in context, so the correct default journal will be selected
@ -248,7 +247,8 @@ class account_analytic_line(osv.osv):
ctx = context.copy()
ctx.update({'uom': uom})
if price <= 0.0 :
# check force product
if price <= 0.0 or data.get('product'):
price = self._get_invoice_price(cr, uid, account, product_id, user_id, qty, ctx)
general_account = product.property_account_income or product.categ_id.property_account_income_categ