[FIX] account: open balance account when partner change

`line.amount` is `undefined`, leading to an incorrect account selected.

opw-1878890
This commit is contained in:
Nicolas Martinelli
2018-09-13 11:44:21 +02:00
committed by Nicolas Martinelli
parent ad584540d4
commit dee5ce3be1
@@ -760,7 +760,7 @@ var StatementModel = BasicModel.extend({
}).then(function (result) {
if (result.length > 0) {
var line = self.getLine(handle);
self.lines[handle].st_line.open_balance_account_id = line.amount < 0 ? result[0]['property_account_payable_id'][0] : result[0]['property_account_receivable_id'][0];
self.lines[handle].st_line.open_balance_account_id = line.balance.amount < 0 ? result[0]['property_account_payable_id'][0] : result[0]['property_account_receivable_id'][0];
}
});
},