Skip to content

Commit f4bdb3a

Browse files
vehi-invituparvezqureshi
authored andcommitted
[17.0][ADD] Add pos_partner_birthdate_warning module
1 parent 90d4d7d commit f4bdb3a

18 files changed

+908
-0
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
=============================
2+
POS Partner Birthdate Warning
3+
=============================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:a7e57dda136a17f1f09419221c8e5b52523d147b935e8575002b803e24787aca
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
20+
:target: https://github.com/OCA/pos/tree/17.0/pos_partner_birthdate_warning
21+
:alt: OCA/pos
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_partner_birthdate_warning
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module enhances Odoo's Point of Sale (POS) by introducing an age
32+
verification system. When a customer is selected, their age (based on
33+
their date of birth) is checked against the predefined **"Age Warning"**
34+
threshold set in the POS configuration.
35+
36+
If the customer's age is **less than or equal** to this threshold, their
37+
name will be displayed in **red** on the POS interface to alert the
38+
cashier.
39+
40+
Use Cases
41+
---------
42+
43+
**Case 1: Alcohol Sales**
44+
~~~~~~~~~~~~~~~~~~~~~~~~~
45+
46+
- **"Age Warning" threshold set to 18 years**.
47+
- A customer born on **June 5, 2010**, is selected in **March 2025**.
48+
- **Age**: 2025 - 2010 = **14 years old**.
49+
- **Result**: Their name appears in **red**, warning the cashier.
50+
51+
**Case 2: Customer is of Legal Age**
52+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53+
54+
- **"Age Warning" threshold set to 18 years**.
55+
- A customer born on **February 2, 2003**, is selected in **March
56+
2025**.
57+
- **Age**: 2025 - 2003 = **22 years old**.
58+
- **Result**: No warning, as the customer is above the age limit.
59+
60+
**Case 3: Gaming Center (No entry for under 16s)**
61+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62+
63+
- **"Age Warning" threshold set to 16 years**.
64+
- A customer born on **July 15, 2009**, is selected in **March 2025**.
65+
- **Age**: 2025 - 2009 = **15 years old** (birthday in July).
66+
- **Result**: Their name appears in **red** because they are not yet 16.
67+
68+
**Table of contents**
69+
70+
.. contents::
71+
:local:
72+
73+
Configuration
74+
=============
75+
76+
1. Go to POS Settings
77+
2. In the POS Interface section there is the Age Warning setting
78+
3. Enter the age warning
79+
80+
The warning will appear in POS interface for the customer with this age
81+
or younger.
82+
83+
Usage
84+
=====
85+
86+
Open the POS interface and if the age warning setting apply to the
87+
customer, the customer's name will appear in red color.
88+
89+
Bug Tracker
90+
===========
91+
92+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
93+
In case of trouble, please check there if your issue has already been reported.
94+
If you spotted it first, help us to smash it by providing a detailed and welcomed
95+
`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**>`_.
96+
97+
Do not contact contributors directly about support or help with technical issues.
98+
99+
Credits
100+
=======
101+
102+
Authors
103+
-------
104+
105+
* Invitu
106+
107+
Contributors
108+
------------
109+
110+
- Vehiana Tepuhiarii <[email protected]>
111+
- `SerpentCS <https://www.serpentcs.com>`__:
112+
113+
- Parvez Qureshi <[email protected]>
114+
115+
Maintainers
116+
-----------
117+
118+
This module is maintained by the OCA.
119+
120+
.. image:: https://odoo-community.org/logo.png
121+
:alt: Odoo Community Association
122+
:target: https://odoo-community.org
123+
124+
OCA, or the Odoo Community Association, is a nonprofit organization whose
125+
mission is to support the collaborative development of Odoo features and
126+
promote its widespread use.
127+
128+
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/17.0/pos_partner_birthdate_warning>`_ project on GitHub.
129+
130+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2025 Invitu SARL
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "POS Partner Birthdate Warning",
5+
"summary": "Display customer's age in POS interface according to the age setting",
6+
"version": "17.0.0.1.0",
7+
"category": "Point of sale",
8+
"website": "https://github.com/OCA/pos",
9+
"author": "Invitu, Odoo Community Association (OCA)",
10+
"license": "AGPL-3",
11+
"installable": True,
12+
"depends": ["pos_partner_birthdate"],
13+
"data": [
14+
"views/res_config_settings.xml",
15+
],
16+
"assets": {
17+
"point_of_sale._assets_pos": [
18+
"pos_partner_birthdate_warning/static/src/xml/actionpad_widget.xml",
19+
"pos_partner_birthdate_warning/static/src/js/PartnerListScreen.esm.js",
20+
"pos_partner_birthdate_warning/static/src/js/pos_store.esm.js",
21+
]
22+
},
23+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * pos_partner_birthdate_warning
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-03-18 10:40+0000\n"
10+
"PO-Revision-Date: 2025-03-18 10:40+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: pos_partner_birthdate_warning
19+
#. odoo-javascript
20+
#: code:addons/pos_partner_birthdate_warning/static/src/js/PartnerListScreen.esm.js:0
21+
#, python-format
22+
msgid "%s is under %s years old!"
23+
msgstr ""
24+
25+
#. module: pos_partner_birthdate_warning
26+
#. odoo-javascript
27+
#: code:addons/pos_partner_birthdate_warning/static/src/js/pos_store.esm.js:0
28+
#, python-format
29+
msgid "(%s y)"
30+
msgstr "(%s a)"
31+
32+
#. module: pos_partner_birthdate_warning
33+
#. odoo-javascript
34+
#: code:addons/pos_partner_birthdate_warning/static/src/js/PartnerListScreen.esm.js:0
35+
#, python-format
36+
msgid "Age Restriction"
37+
msgstr ""
38+
39+
#. module: pos_partner_birthdate_warning
40+
#: model:ir.model.fields,field_description:pos_partner_birthdate_warning.field_res_company__age_warning
41+
#: model:ir.model.fields,field_description:pos_partner_birthdate_warning.field_res_config_settings__age_warning
42+
msgid "Age Warning"
43+
msgstr ""
44+
45+
#. module: pos_partner_birthdate_warning
46+
#: model_terms:ir.ui.view,arch_db:pos_partner_birthdate_warning.view_res_config_settings_birthdate_warning
47+
msgid "Age warning"
48+
msgstr ""
49+
50+
#. module: pos_partner_birthdate_warning
51+
#: model:ir.model.fields,help:pos_partner_birthdate_warning.field_res_config_settings__age_warning
52+
msgid "Choose the age max for the warning"
53+
msgstr ""
54+
55+
#. module: pos_partner_birthdate_warning
56+
#: model:ir.model,name:pos_partner_birthdate_warning.model_res_company
57+
msgid "Companies"
58+
msgstr ""
59+
60+
#. module: pos_partner_birthdate_warning
61+
#: model:ir.model,name:pos_partner_birthdate_warning.model_res_config_settings
62+
msgid "Config Settings"
63+
msgstr ""
64+
65+
#. module: pos_partner_birthdate_warning
66+
#: model_terms:ir.ui.view,arch_db:pos_partner_birthdate_warning.view_res_config_settings_birthdate_warning
67+
msgid "POS warning for customer with this age or younger."
68+
msgstr ""
69+
70+
#. module: pos_partner_birthdate_warning
71+
#: model:ir.model,name:pos_partner_birthdate_warning.model_pos_session
72+
msgid "Point of Sale Session"
73+
msgstr ""
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from . import res_config_settings
2+
from . import res_company
3+
from . import pos_session
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from odoo import models
4+
5+
6+
class POSSession(models.Model):
7+
_inherit = "pos.session"
8+
9+
def _loader_params_res_company(self):
10+
res = super()._loader_params_res_company()
11+
res["search_params"]["fields"].append("age_warning")
12+
return res
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from odoo import fields, models
2+
3+
4+
class ResCompany(models.Model):
5+
_inherit = "res.company"
6+
7+
age_warning = fields.Integer()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2025 Invitu SARL
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class ResConfigSettings(models.TransientModel):
8+
_inherit = "res.config.settings"
9+
10+
age_warning = fields.Integer(
11+
related="company_id.age_warning",
12+
readonly=False,
13+
help="Choose the age max for the warning",
14+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
1. Go to POS Settings
2+
2. In the POS Interface section there is the Age Warning setting
3+
3. Enter the age warning
4+
5+
The warning will appear in POS interface for the customer with this age or younger.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Vehiana Tepuhiarii \<<[email protected]>\>
2+
- [SerpentCS](https://www.serpentcs.com):
3+
- Parvez Qureshi \<<[email protected]>\>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
This module enhances Odoo's Point of Sale (POS) by introducing an age verification system.
2+
When a customer is selected, their age (based on their date of birth) is checked against the
3+
predefined **"Age Warning"** threshold set in the POS configuration.
4+
5+
If the customer's age is **less than or equal** to this threshold, their name
6+
will be displayed in **red** on the POS interface to alert the cashier.
7+
8+
## Use Cases
9+
### **Case 1: Alcohol Sales**
10+
- **"Age Warning" threshold set to 18 years**.
11+
- A customer born on **June 5, 2010**, is selected in **March 2025**.
12+
- **Age**: 2025 - 2010 = **14 years old**.
13+
- **Result**: Their name appears in **red**, warning the cashier.
14+
15+
### **Case 2: Customer is of Legal Age**
16+
- **"Age Warning" threshold set to 18 years**.
17+
- A customer born on **February 2, 2003**, is selected in **March 2025**.
18+
- **Age**: 2025 - 2003 = **22 years old**.
19+
- **Result**: No warning, as the customer is above the age limit.
20+
21+
### **Case 3: Gaming Center (No entry for under 16s)**
22+
- **"Age Warning" threshold set to 16 years**.
23+
- A customer born on **July 15, 2009**, is selected in **March 2025**.
24+
- **Age**: 2025 - 2009 = **15 years old** (birthday in July).
25+
- **Result**: Their name appears in **red** because they are not yet 16.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Open the POS interface and if the age warning setting apply to the customer, the customer's name will appear in red color.

0 commit comments

Comments
 (0)