Skip to content

[17.0][ADD] Add pos_partner_birthdate_warning module #1333

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

Draft
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions pos_partner_birthdate_warning/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
=============================
POS Partner Birthdate Warning
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a7e57dda136a17f1f09419221c8e5b52523d147b935e8575002b803e24787aca
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/17.0/pos_partner_birthdate_warning
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_partner_birthdate_warning
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module enhances Odoo's Point of Sale (POS) by introducing an age
verification system. When a customer is selected, their age (based on
their date of birth) is checked against the predefined **"Age Warning"**
threshold set in the POS configuration.

If the customer's age is **less than or equal** to this threshold, their
name will be displayed in **red** on the POS interface to alert the
cashier.

Use Cases
---------

**Case 1: Alcohol Sales**
~~~~~~~~~~~~~~~~~~~~~~~~~

- **"Age Warning" threshold set to 18 years**.
- A customer born on **June 5, 2010**, is selected in **March 2025**.
- **Age**: 2025 - 2010 = **14 years old**.
- **Result**: Their name appears in **red**, warning the cashier.

**Case 2: Customer is of Legal Age**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- **"Age Warning" threshold set to 18 years**.
- A customer born on **February 2, 2003**, is selected in **March
2025**.
- **Age**: 2025 - 2003 = **22 years old**.
- **Result**: No warning, as the customer is above the age limit.

**Case 3: Gaming Center (No entry for under 16s)**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- **"Age Warning" threshold set to 16 years**.
- A customer born on **July 15, 2009**, is selected in **March 2025**.
- **Age**: 2025 - 2009 = **15 years old** (birthday in July).
- **Result**: Their name appears in **red** because they are not yet 16.

**Table of contents**

.. contents::
:local:

Configuration
=============

1. Go to POS Settings
2. In the POS Interface section there is the Age Warning setting
3. Enter the age warning

The warning will appear in POS interface for the customer with this age
or younger.

Usage
=====

Open the POS interface and if the age warning setting apply to the
customer, the customer's name will appear in red color.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_partner_birthdate_warning%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Invitu

Contributors
------------

- Vehiana Tepuhiarii <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/17.0/pos_partner_birthdate_warning>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions pos_partner_birthdate_warning/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions pos_partner_birthdate_warning/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2025 Invitu SARL
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "POS Partner Birthdate Warning",
"summary": "Display customer's age in POS interface according to the age setting",
"version": "17.0.0.1.0",
"category": "Point of sale",
"website": "https://github.com/OCA/pos",
"author": "Invitu, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["pos_partner_birthdate"],
"data": [
"views/res_config_settings.xml",
],
}
2 changes: 2 additions & 0 deletions pos_partner_birthdate_warning/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import res_config_settings
from . import res_company
7 changes: 7 additions & 0 deletions pos_partner_birthdate_warning/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

age_warning = fields.Integer()
14 changes: 14 additions & 0 deletions pos_partner_birthdate_warning/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2025 Invitu SARL
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

age_warning = fields.Integer(
related="company_id.age_warning",
readonly=False,
help="Choose the age max for the warning",
)
3 changes: 3 additions & 0 deletions pos_partner_birthdate_warning/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions pos_partner_birthdate_warning/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Go to POS Settings
2. In the POS Interface section there is the Age Warning setting
3. Enter the age warning

The warning will appear in POS interface for the customer with this age or younger.
1 change: 1 addition & 0 deletions pos_partner_birthdate_warning/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Vehiana Tepuhiarii \<<[email protected]>\>
25 changes: 25 additions & 0 deletions pos_partner_birthdate_warning/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
This module enhances Odoo's Point of Sale (POS) by introducing an age verification system.
When a customer is selected, their age (based on their date of birth) is checked against the
predefined **"Age Warning"** threshold set in the POS configuration.

If the customer's age is **less than or equal** to this threshold, their name
will be displayed in **red** on the POS interface to alert the cashier.

## Use Cases
### **Case 1: Alcohol Sales**
- **"Age Warning" threshold set to 18 years**.
- A customer born on **June 5, 2010**, is selected in **March 2025**.
- **Age**: 2025 - 2010 = **14 years old**.
- **Result**: Their name appears in **red**, warning the cashier.

### **Case 2: Customer is of Legal Age**
- **"Age Warning" threshold set to 18 years**.
- A customer born on **February 2, 2003**, is selected in **March 2025**.
- **Age**: 2025 - 2003 = **22 years old**.
- **Result**: No warning, as the customer is above the age limit.

### **Case 3: Gaming Center (No entry for under 16s)**
- **"Age Warning" threshold set to 16 years**.
- A customer born on **July 15, 2009**, is selected in **March 2025**.
- **Age**: 2025 - 2009 = **15 years old** (birthday in July).
- **Result**: Their name appears in **red** because they are not yet 16.
1 change: 1 addition & 0 deletions pos_partner_birthdate_warning/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Open the POS interface and if the age warning setting apply to the customer, the customer's name will appear in red color.
Loading