Skip to content

Commit

Permalink
[FIX] fix in _prepare_invoice method when compare the fiscal position…
Browse files Browse the repository at this point in the history
… company with the force company (#24)
  • Loading branch information
nicomacr authored and jjscarafia committed Nov 1, 2018
1 parent 9882e64 commit 81d1090
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sale_multic_fix/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ def _prepare_invoice(self):
company_id=company_id,
force_company=company_id))._prepare_invoice()
res['company_id'] = company_id
if self.env['account.fiscal.position'].browse(
res['fiscal_position_id']).company_id != company_id:
so_fiscal_position = self.env['account.fiscal.position'].browse(
res['fiscal_position_id'])
if so_fiscal_position.company_id and\
so_fiscal_position.company_id.id != company_id:
res['fiscal_position_id'] = self.with_context(
force_company=company_id).partner_invoice_id\
.property_account_position_id.id
Expand Down

0 comments on commit 81d1090

Please sign in to comment.