From fe34db34bc864146c0f289af8ffbce30e1acbf8b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 8 Aug 2016 17:10:45 +0200 Subject: [PATCH] [IMP] point_of_sale: create a partner with empty fields When creating a partner, the fields where the information is not specified were filled with an empty string value. The empty string value is not ideal as prevents to use filters like "email not set" and forces to use more complexe domain "... or email = ''" Instead, set the value false for the fields were nothing is provided (same behaviour as backend web client). Remove the fields.barcode overwrite to empty string as it is probably an unintentional side effect of 3b33e5c3. opw-684902 --- addons/point_of_sale/static/src/js/screens.js | 3 +-- addons/point_of_sale/static/src/xml/pos.xml | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 978b0fb8a03..b6c9560e2ed 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1182,7 +1182,7 @@ var ClientListScreenWidget = ScreenWidget.extend({ var fields = {}; this.$('.client-details-contents .detail').each(function(idx,el){ - fields[el.name] = el.value; + fields[el.name] = el.value || false; }); if (!fields.name) { @@ -1196,7 +1196,6 @@ var ClientListScreenWidget = ScreenWidget.extend({ fields.id = partner.id || false; fields.country_id = fields.country_id || false; - fields.barcode = fields.barcode || ''; new Model('res.partner').call('create_from_ui',[fields]).then(function(partner_id){ self.saved_client_details(partner_id); diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index ba04fba9582..1b11e1e03e3 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -316,15 +316,15 @@
Street - +
City - +
Postcode - +
Country @@ -372,11 +372,21 @@
Address - + + + + + N/A +
Email - + + + + + N/A +
Phone