[FIX] website_form: replace False and None by ""
In python false is written `False` however JSON only support the notation `false` otherwise JSON.parse fails Again in python a null value is written `None` however `None` is `null` in JSON notation A solution to this incompatibility problem between python and javascript can be to replace `False` and `None`by empty strings on the javascript side. closes odoo/odoo#34995 Signed-off-by: Romain Libert (rli) <rli@odoo.com>
This commit is contained in:
@@ -57,7 +57,7 @@ odoo.define('website_form.animation', function (require) {
|
||||
// Because, using t-att- inside form make it non-editable
|
||||
var $values = $('[data-for=' + this.$target.attr('id') + ']');
|
||||
if ($values.length) {
|
||||
var values = JSON.parse($values.data('values').replace(/'/g, '"'));
|
||||
var values = JSON.parse($values.data('values').replace('False', '""').replace('None', '""').replace(/'/g, '"'));
|
||||
var fields = _.pluck(this.$target.serializeArray(), 'name');
|
||||
_.each(fields, function (field) {
|
||||
if (_.has(values, field)) {
|
||||
|
||||
Reference in New Issue
Block a user