Skip to content

Commit

Permalink
[IMP] pos_partner_birthdate: Allow to search by birthdate
Browse files Browse the repository at this point in the history
  • Loading branch information
etobella committed Jan 4, 2024
1 parent 1766e39 commit 26d1f22
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions pos_partner_birthdate/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"pos_partner_birthdate/static/src/xml/screens.xml",
"pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js",
"pos_partner_birthdate/static/src/js/PartnerLine.esm.js",
"pos_partner_birthdate/static/src/js/PosDB.esm.js",
]
},
}
19 changes: 19 additions & 0 deletions pos_partner_birthdate/static/src/js/PosDB.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @odoo-module **/
import {PosDB} from "@point_of_sale/app/store/db";
import {formatDate} from "@web/core/l10n/dates";
import {patch} from "@web/core/utils/patch";
const {DateTime} = luxon;

patch(PosDB.prototype, {
_partner_search_string(partner) {
var result = super._partner_search_string(partner);
if (partner.birthdate_date) {
result =
result.substr(0, result.length - 1) +
"|" +
formatDate(DateTime.fromJSDate(new Date(partner.birthdate_date))) +
"\n";
}
return result;
},
});

0 comments on commit 26d1f22

Please sign in to comment.