[FIX] account: crazy To Check checkbox in reconciliation widget
Reproduce: Add multiple lines in the reconciliation widget Try to create a new one and edit it Problem: A constraint checks that all the lines have the same value for To Check, but the value is not provided if another field changed. Since true !== undefined !== false, a warning was raised. Solution: Only fire check the constraint if to_check is in the values. closes odoo/odoo#33560 Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
This commit is contained in:
@@ -624,12 +624,12 @@ var StatementModel = BasicModel.extend({
|
||||
prop = this._formatQuickCreate(line);
|
||||
line.reconciliation_proposition.push(prop);
|
||||
}
|
||||
if (!line.reconciliation_proposition.slice(0,-1).every(function(prop) {return prop.to_check == values.to_check})) {
|
||||
if ('to_check' in values && !line.reconciliation_proposition.slice(0,-1).every(function(prop) {return prop.to_check == values.to_check})) {
|
||||
new CrashManager().show_warning({data: {
|
||||
exception_type: _t("Incorrect Operation"),
|
||||
message: _t("You cannot mix items with and without the 'To Check' checkbox ticked.")
|
||||
}});
|
||||
$('.create_to_check input').click();
|
||||
$('.create_to_check input:visible').prop('checked', !values.to_check).change();
|
||||
return $.when();
|
||||
}
|
||||
_.each(values, function (value, fieldName) {
|
||||
|
||||
Reference in New Issue
Block a user