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..d64c1f9f13 --- /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 || null, + }; + } + }; + +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"