Skip to content

Commit

Permalink
[FIX] check move validate only when all lines are created
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Pigeon committed Sep 12, 2017
1 parent 3bbe6c2 commit b3117b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pos_payment_entries_globalization/models/pos_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def _create_globalization_counterpart_line(self, debit, credit, account_id,
'account_id': account_id,
'move_id': move.id
}
return self.env['account.move.line'].create(item_vals)
return self.env['account.move.line'].with_context(
check_move_validity=False).create(item_vals)

@api.model
def _create_reverse_line(self, line_to_reverse, move):
Expand Down Expand Up @@ -91,6 +92,7 @@ def _generate_globalization_entries(self):
if counterpart_credit:
self._create_globalization_counterpart_line(
0.0, counterpart_credit, global_account_id, move)
move._post_validate()
for lines in to_reconcile:
lines.reconcile()

Expand Down

0 comments on commit b3117b6

Please sign in to comment.