diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-10-24 15:06:45 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-10-24 15:06:45 +0200 |
| commit | e721f3eb9942e663a8037cc0a5cff342da64e5b9 (patch) | |
| tree | ca3385ba71ca35272e7cec9b4b25bf9a9772216b | |
| parent | a18fc55ffc96935b60ba08c85c45a6a22d176ff6 (diff) | |
| parent | 4d1fc7e390eea67a4db2a259b05b3779872ba034 (diff) | |
[MERGE] forward port branch 9.0 up to 4d1fc7e
| -rw-r--r-- | addons/sale/sale.py | 2 | ||||
| -rw-r--r-- | addons/sale/wizard/sale_make_invoice_advance.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 3783692b29b..b324b43177d 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -174,7 +174,7 @@ class SaleOrder(models.Model): return super(SaleOrder, self)._track_subtype(init_values) @api.multi - @api.onchange('partner_shipping_id') + @api.onchange('partner_shipping_id', 'partner_id') def onchange_partner_shipping_id(self): """ Trigger the change of fiscal position when the shipping address is modified. 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.') % \ |
