summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2016-10-24 11:17:45 +0200
committerOlivier Dony <odo@openerp.com>2016-10-24 13:58:29 +0200
commit4d1fc7e390eea67a4db2a259b05b3779872ba034 (patch)
tree2ea5646958bf12d46bf04d4f8b30c2a011bed57f
parenta3d6e7f2ff216e2b3672fa1579d331801f9d5c0e (diff)
[FIX] sale: missing account mapping in advance invoice
The `map_account()` method expects a browse_record as parameter, and returns a browse_record (possibly the argument if no mapping happened). It was being called with an account ID instead, so fiscal position mapping would never match, and would always return the argument itself.
-rw-r--r--addons/sale/wizard/sale_make_invoice_advance.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py
index a543f598148..925877b75e7 100644
--- a/addons/sale/wizard/sale_make_invoice_advance.py
+++ b/addons/sale/wizard/sale_make_invoice_advance.py
@@ -65,9 +65,8 @@ class SaleAdvancePaymentInv(models.TransientModel):
if self.product_id.id:
account_id = self.product_id.property_account_income_id.id
if not account_id:
- prop = ir_property_obj.get('property_account_income_categ_id', 'product.category')
- prop_id = prop and prop.id or False
- account_id = order.fiscal_position_id.map_account(prop_id)
+ inc_acc = ir_property_obj.get('property_account_income_categ_id', 'product.category')
+ account_id = order.fiscal_position_id.map_account(inc_acc).id if inc_acc else False
if not account_id:
raise UserError(
_('There is no income account defined for this product: "%s". You may have to install a chart of account from Accounting app, settings menu.') % \