Skip to content

Commit

Permalink
[MERGE] forward port branch 9.0 up to 4d1fc7e
Browse files Browse the repository at this point in the history
  • Loading branch information
KangOl committed Oct 24, 2016
2 parents a18fc55 + 4d1fc7e commit e721f3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addons/sale/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _track_subtype(self, init_values):
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.
Expand Down
5 changes: 2 additions & 3 deletions addons/sale/wizard/sale_make_invoice_advance.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ def _create_invoice(self, order, so_line, amount):
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.') % \
Expand Down

0 comments on commit e721f3e

Please sign in to comment.