[FIX] account: fix to_check warning being thrown when opening reconciliation widget

In the reconciliation widget, we added a to_check functionality. However in some cases, the propositions don't have a default value for
to_check, which result in a warning being thrown when doing a comparison to ensure that all lines have the same to_check value.
This commit add a default value to to_check for all propositions (when loading the data and when performing a quick create).

closes odoo/odoo#33824

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
This commit is contained in:
Cedric Snauwaert
2019-06-03 09:47:00 +00:00
parent a0bd33e0e5
commit d773715046
@@ -994,6 +994,7 @@ var StatementModel = BasicModel.extend({
prop.label = prop.name;
prop.account_id = self._formatNameGet(prop.account_id || line.account_id);
prop.is_partially_reconciled = prop.amount_str !== prop.total_amount_str;
prop.to_check = !!prop.to_check;
});
}
},
@@ -1128,7 +1129,7 @@ var StatementModel = BasicModel.extend({
'link': values.link,
'display': true,
'invalid': true,
'to_check': values.to_check,
'to_check': values.to_check || false,
'__tax_to_recompute': true,
'is_tax': values.is_tax,
'__focus': '__focus' in values ? values.__focus : true,
@@ -1614,6 +1615,7 @@ var ManualModel = StatementModel.extend({
prop.debit = prop.debit !== 0 ? 0 : tmp_value;
prop.amount = -prop.amount;
prop.journal_id = self._formatNameGet(prop.journal_id || line.journal_id);
prop.to_check = !!prop.to_check;
});
}
},