Remove variable partner_id since i changed the validation of partners number.

This commit is contained in:
Fekete Mihai
2018-01-25 15:18:07 +02:00
parent a2d7d7dc64
commit ac109f0488

View File

@@ -47,12 +47,10 @@ class AccountMoveMakeNetting(models.TransientModel):
"operations on different accounts for the same partner.\n"
"In this case all selected entries belong to the same "
"account.\n Please use the 'Reconcile' function."))
partner_id = None
if len(move_lines.mapped('partner_id')) != 1:
raise exceptions.ValidationError(
_("All entries should have a partner and the partner must "
"be the same for all."))
partner_id = move_lines[0].partner_id
res = super(AccountMoveMakeNetting, self).default_get(fields)
res['move_line_ids'] = [(6, 0, move_lines.ids)]
balance = (sum(move_lines.mapped('debit')) -