[FIX] point_of_sale: enable date search functionality in ticket screen

After commit https://github.com/odoo/odoo/commit/4c8fddd57029608bb616c2ff4761b7d41b674986 where `date_order` was transformed to
DateTime. This modification eliminates the need for deserializeDateTime
during the search process, ensuring accurate date-based search in the
ticket screen.

opw-3621659

closes odoo/odoo#145399

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
Pedram (PEBR)
2023-12-08 15:57:51 +00:00
parent 6e006c05ce
commit ba37217944
@@ -3,7 +3,7 @@
import { Order } from "@point_of_sale/app/store/models";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { deserializeDateTime, deserializeDate, formatDateTime } from "@web/core/l10n/dates";
import { deserializeDateTime, formatDateTime } from "@web/core/l10n/dates";
import { parseFloat } from "@web/views/fields/parsers";
import { _t } from "@web/core/l10n/translation";
@@ -642,7 +642,7 @@ export class TicketScreen extends Component {
modelField: "pos_reference",
},
DATE: {
repr: (order) => deserializeDate(order.date_order).toFormat("yyyy-MM-dd HH:mm a"),
repr: (order) => order.date_order.toFormat("yyyy-MM-dd HH:mm a"),
displayName: _t("Date"),
modelField: "date_order",
},