diff --git a/account_operating_unit/models/account_payment.py b/account_operating_unit/models/account_payment.py index 9a7497459a..15fe9edd0d 100644 --- a/account_operating_unit/models/account_payment.py +++ b/account_operating_unit/models/account_payment.py @@ -22,7 +22,7 @@ def _compute_operating_unit_id(self): def _get_counterpart_move_line_vals(self, invoice=False): res = super(AccountPayment, self)._get_counterpart_move_line_vals(invoice=invoice) - if invoice: + if len(invoice) == 1: res['operating_unit_id'] = invoice.operating_unit_id.id or False else: res['operating_unit_id'] = self.operating_unit_id.id or False