Skip to content

[17.0][ADD] Add pos_partner_birthdate_warning module #1338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

parvezqureshi
Copy link

No description provided.

Copy link
Contributor

@cvinh cvinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you simply load res_partner.age field that is already computed in partner_contact_birthdate instead of recompute it ? Is it because it's not stored ?

@parvezqureshi
Copy link
Author

Why don't you simply load res_partner.age field that is already computed in partner_contact_birthdate instead of recompute it ? Is it because it's not stored ?

@cvinh @vehi-invitu They failed in some cases like the one below.

Customer:

  • Birthdate = 20-Mar-2007
  • Current Date = 19-Mar-2025
  • In the POS screen, the age displays as 17y

Issue:

If the session is closed on 21-Mar-2025 or later, the age should update to 18y on 20-Mar-2025.
However, if the POS screen is not refreshed, it will still display 17y, even after the birthday has passed.

Conclusion:

res_partner.age does not correctly handle cases where the session is not closed daily, leading to outdated age calculations on the POS screen

@cvinh
Copy link
Contributor

cvinh commented May 13, 2025

@parvezqureshi can you please rebase (as runboat is stuck)

@parvezqureshi parvezqureshi force-pushed the 17.0_pos_partner_birthdate_warning branch from dd800da to a4d8c27 Compare May 13, 2025 09:16
@parvezqureshi
Copy link
Author

@parvezqureshi can you please rebase (as runboat is stuck)

Rebased

Copy link
Contributor

@cvinh cvinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.
Here's are steps that do not work as expected (warning is bypassed) :

  • the partner does not have a birthdate
  • we edit the partner and add the birthdate.
  • we save the partner and it's immediatly selected in the pos order without the warning

@cvinh
Copy link
Contributor

cvinh commented May 13, 2025

I just realize that this module should be renamed to pos_customer_age_warning ... or pos_customer_birthdate_age_warning...

pos_customer_birthdate_warning is meant to warn if it's the customer's birthday ...

WDYT ? @legalsylvain

@parvezqureshi parvezqureshi force-pushed the 17.0_pos_partner_birthdate_warning branch from a4d8c27 to 53c00b9 Compare May 13, 2025 12:26
Pierrick Brun and others added 20 commits May 13, 2025 17:57
This can help perfs when there are templates with a lot of variants.

Also this adds a "confirm" button that can be a practical alternative to
the variant selection.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-14.0/pos-14.0-pos_product_template
Translate-URL: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_product_template/
Currently translated at 100.0% (9 of 9 strings)

Translation: pos-14.0/pos-14.0-pos_product_template
Translate-URL: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_product_template/it/
Currently translated at 100.0% (9 of 9 strings)

Translation: pos-14.0/pos-14.0-pos_product_template
Translate-URL: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_product_template/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-17.0/pos-17.0-pos_product_template
Translate-URL: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_product_template/
legalsylvain and others added 27 commits May 13, 2025 17:57
Currently translated at 37.5% (3 of 8 strings)

Translation: pos-14.0/pos-14.0-pos_margin
Translate-URL: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_margin/it/
Currently translated at 37.5% (3 of 8 strings)

Translation: pos-14.0/pos-14.0-pos_margin
Translate-URL: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_margin/it/
Currently translated at 100.0% (8 of 8 strings)

Translation: pos-16.0/pos-16.0-pos_margin
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_margin/it/
Currently translated at 100.0% (3 of 3 strings)

Translation: pos-17.0/pos-17.0-pos_partner_vat_valid
Translate-URL: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_partner_vat_valid/it/
@parvezqureshi parvezqureshi force-pushed the 17.0_pos_partner_birthdate_warning branch from 53c00b9 to 6d05ca7 Compare May 14, 2025 10:18
@parvezqureshi
Copy link
Author

supersede #1382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.