[FIX] pos_restaurant: resume shop when pos_restaurant is installed

This is a followup to the fix made in
99615ff6cc.
When calling JSON.stringify to undefined, it results to undefined, thus,
it is necessary to check if the value is undefined before JSON.parse'ing
it.

closes odoo/odoo#42812

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
Joseph Caburnay
2020-01-07 07:25:06 +00:00
parent b6714ee01d
commit 861a712d50
@@ -333,7 +333,7 @@ models.Order = models.Order.extend({
},
init_from_JSON: function(json){
_super_order.init_from_JSON.apply(this,arguments);
this.saved_resume = JSON.parse(json.multiprint_resume);
this.saved_resume = json.multiprint_resume && JSON.parse(json.multiprint_resume);
},
});