pos icon indicating copy to clipboard operation
pos copied to clipboard

[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.

Open parvezqureshi opened this issue 9 months ago • 12 comments

https://github.com/OCA/pos/issues/1328

parvezqureshi avatar Mar 12 '25 11:03 parvezqureshi

Hi @ecino, some modules you are maintaining are being modified, check this out!

OCA-git-bot avatar Mar 12 '25 11:03 OCA-git-bot

cc @vehi-invitu

cvinh avatar Mar 12 '25 23:03 cvinh

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

cvinh avatar Mar 13 '25 01:03 cvinh

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). 🤖

OCA-git-bot avatar Mar 17 '25 11:03 OCA-git-bot

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

cvinh avatar Mar 20 '25 08:03 cvinh

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 ?

cvinh avatar Apr 16 '25 03:04 cvinh

@legalsylvain WDYT on that one please ?

cvinh avatar May 14 '25 06:05 cvinh

please @parvezqureshi can you rebase because of runboat ?

cvinh avatar May 14 '25 06:05 cvinh

please @parvezqureshi can you rebase because of runboat ?

Rebased

parvezqureshi avatar May 14 '25 06:05 parvezqureshi

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

odoo/odoo#202641

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 ?

cvinh avatar Jun 04 '25 16:06 cvinh

Odoo answered this part has been changed in further versions, so we can merge this and then improve in next versions @legalsylvain

cvinh avatar Sep 18 '25 06:09 cvinh

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.

ivantodorovich avatar Oct 23 '25 11:10 ivantodorovich