[FIX]pos_partner_birthdate: fixed the issue of if we have a lot of customers and we search a customer using the birthdate with the button search more, result not found.
https://github.com/OCA/pos/issues/1328
Hi @ecino, some modules you are maintaining are being modified, check this out!
cc @vehi-invitu
thanks for the PR, we tested here in french at GMT-10 and with several format input (ddmmyyyy or dd/mm/yyyy), it doesn't seem to work as expected Can you do it language and format date proof ? At least ddmmyyyy and dd/mm/yyyy for french and mmyyyyyy or mm/dd/yyyy for english Please be aware of timezone because if we are at another timezone than UTC, the date might move +/-1 day
As example @etobella did it like this https://github.com/OCA/pos/blob/dfa4435ade024e6d940f3dd3bcc078733a637312/pos_partner_birthdate/static/src/js/PosDB.esm.js#L9 and it works well with the classical search
This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖
Small, suggestion, why don't you ask Odoo to add a hook in order to modify the domain filter? this way, you don't need to have this big change.
I made other PRs asking for hooks and they accepted it without an issue: odoo/odoo#150914
https://github.com/odoo/odoo/pull/202641
Maybe we can merge this one and wait for https://github.com/odoo/odoo/pull/202641 to improve it Otherwise, we do a PR to OCB and improve it now @etobella WDYT ?
@legalsylvain WDYT on that one please ?
please @parvezqureshi can you rebase because of runboat ?
please @parvezqureshi can you rebase because of runboat ?
Rebased
Small, suggestion, why don't you ask Odoo to add a hook in order to modify the domain filter? this way, you don't need to have this big change. I made other PRs asking for hooks and they accepted it without an issue: odoo/odoo#150914
PR has been rejected by Odoo and I proposed to do a PR to OCB... In that case, this fix will only work with OCB... or we can merge as it is... and improve it in next version PSC wdyt ?
Odoo answered this part has been changed in further versions, so we can merge this and then improve in next versions @legalsylvain
I wouldn't have a problem merging like this, but please add some comments mentioning we're fully overwriting the core method and why.
Add comments before and after the modified lines to make it easier for devs working in future migrations to identify the actual patch.
Alternatively, there's a way to do this without a complete overwrite. It's not as clean as if Odoo had a hook method, but it works just fine: you can temporarily monkey-patch the this.orm.silent.call method with a method that injects your new domain leaves. Call super in a try..finally block, reverting the monkey patch after its called.