From a1fb7027de85c9827a034372035b33755d34db48 Mon Sep 17 00:00:00 2001 From: Juan Carlos B Date: Wed, 2 Aug 2023 16:53:42 +0200 Subject: [PATCH 1/2] [FIX] pos_partner_birthdate: update & save partner birthdate from PoS Interface. --- pos_partner_birthdate/__manifest__.py | 3 ++- pos_partner_birthdate/readme/CONTRIBUTORS.rst | 1 + .../static/src/js/ClientDetailsEdit.esm.js | 16 ++++++++++++++++ .../static/src/xml/ClientDetailsEdit.xml | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js diff --git a/pos_partner_birthdate/__manifest__.py b/pos_partner_birthdate/__manifest__.py index 19d7829744..044833a156 100644 --- a/pos_partner_birthdate/__manifest__.py +++ b/pos_partner_birthdate/__manifest__.py @@ -14,7 +14,8 @@ "depends": ["point_of_sale", "partner_contact_birthdate"], "assets": { "point_of_sale.assets": [ - "pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml" + "pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml", + "pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js", ] }, } diff --git a/pos_partner_birthdate/readme/CONTRIBUTORS.rst b/pos_partner_birthdate/readme/CONTRIBUTORS.rst index 6a9ca31839..ebfe9d7054 100644 --- a/pos_partner_birthdate/readme/CONTRIBUTORS.rst +++ b/pos_partner_birthdate/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Emanuel Cino +* Juan Carlos Bonilla Bravo diff --git a/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js b/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js new file mode 100644 index 0000000000..a3e1ea5ff6 --- /dev/null +++ b/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js @@ -0,0 +1,16 @@ +/** @odoo-module **/ +import PartnerDetailsEdit from "point_of_sale.PartnerDetailsEdit"; +import Registries from "point_of_sale.Registries"; + +const PartnerDetailsEditBirthdate = (OriginalPartnerDetailsEdit) => + class extends OriginalPartnerDetailsEdit { + setup() { + super.setup(); + this.changes = { + ...this.changes, + birthdate_date: this.props.partner.birthdate_date || "", + }; + } + }; + +Registries.Component.extend(PartnerDetailsEdit, PartnerDetailsEditBirthdate); diff --git a/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml b/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml index 14adb37778..20c06e024e 100644 --- a/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml +++ b/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml @@ -13,6 +13,7 @@ class="detail" name="birthdate_date" type="date" + t-model="changes.birthdate_date" t-on-change="captureChange" t-att-value="props.partner.birthdate_date || ''" placeholder="Birthdate" From f1184805065d3dbb8f51306aaf9b063066c6559d Mon Sep 17 00:00:00 2001 From: Juan Carlos B Date: Fri, 4 Aug 2023 11:18:00 +0200 Subject: [PATCH 2/2] [FIX] pos_partner_birthdate: bug on client creation in pos session when birthdate field is empty. --- pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js b/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js index a3e1ea5ff6..d64c1f9f13 100644 --- a/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js +++ b/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js @@ -8,7 +8,7 @@ const PartnerDetailsEditBirthdate = (OriginalPartnerDetailsEdit) => super.setup(); this.changes = { ...this.changes, - birthdate_date: this.props.partner.birthdate_date || "", + birthdate_date: this.props.partner.birthdate_date || null, }; } };