merge
lp bug: https://launchpad.net/bugs/838887 fixed bzr revid: fp@tinyerp.com-20110925221706-suqxfmodiwjpabsx
This commit is contained in:
commit
1c97ceb4bc
|
@ -126,6 +126,8 @@ class final_invoice_create(osv.osv_memory):
|
||||||
taxes = []
|
taxes = []
|
||||||
|
|
||||||
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, 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 = {
|
curr_line = {
|
||||||
'price_unit': -amount,
|
'price_unit': -amount,
|
||||||
'quantity': 1.0,
|
'quantity': 1.0,
|
||||||
|
@ -146,6 +148,8 @@ class final_invoice_create(osv.osv_memory):
|
||||||
taxes = product.taxes_id
|
taxes = product.taxes_id
|
||||||
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
|
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
|
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 = {
|
curr_line = {
|
||||||
'price_unit': account.amount_max - amount_total,
|
'price_unit': account.amount_max - amount_total,
|
||||||
'quantity': 1.0,
|
'quantity': 1.0,
|
||||||
|
|
|
@ -155,6 +155,8 @@ class hr_timesheet_invoice_create(osv.osv_memory):
|
||||||
taxes = product.taxes_id
|
taxes = product.taxes_id
|
||||||
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
|
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
|
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 = {
|
curr_line = {
|
||||||
'price_unit': price,
|
'price_unit': price,
|
||||||
'quantity': qty,
|
'quantity': qty,
|
||||||
|
|
Loading…
Reference in New Issue