lp bug: https://launchpad.net/bugs/838887 fixed

bzr revid: fp@tinyerp.com-20110925221706-suqxfmodiwjpabsx
This commit is contained in:
Fabien Pinckaers 2011-09-26 00:17:06 +02:00
commit 1c97ceb4bc
2 changed files with 6 additions and 0 deletions

View File

@ -126,6 +126,8 @@ class final_invoice_create(osv.osv_memory):
taxes = []
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
if not account_id:
raise osv.except_osv(_("Configuration Error"), _("No income account defined for product '%s'") % product.name)
curr_line = {
'price_unit': -amount,
'quantity': 1.0,
@ -146,6 +148,8 @@ class final_invoice_create(osv.osv_memory):
taxes = product.taxes_id
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
if not account_id:
raise osv.except_osv(_("Configuration Error"), _("No income account defined for product '%s'") % product.name)
curr_line = {
'price_unit': account.amount_max - amount_total,
'quantity': 1.0,

View File

@ -155,6 +155,8 @@ class hr_timesheet_invoice_create(osv.osv_memory):
taxes = product.taxes_id
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
if not account_id:
raise osv.except_osv(_("Configuration Error"), _("No income account defined for product '%s'") % product.name)
curr_line = {
'price_unit': price,
'quantity': qty,