- Mailing Lists
- Contributors
- Re: Any module that verify numbers, i.e., employee's citizen ID
Archives
- By thread 1419
-
By date
- August 2019 59
- September 2019 118
- October 2019 165
- November 2019 97
- December 2019 35
- January 2020 58
- February 2020 204
- March 2020 121
- April 2020 172
- May 2020 50
- June 2020 158
- July 2020 85
- August 2020 94
- September 2020 193
- October 2020 277
- November 2020 100
- December 2020 159
- January 2021 38
- February 2021 87
- March 2021 146
- April 2021 73
- May 2021 90
- June 2021 86
- July 2021 123
- August 2021 50
- September 2021 68
- October 2021 66
- November 2021 74
- December 2021 75
- January 2022 98
- February 2022 77
- March 2022 68
- April 2022 31
- May 2022 59
- June 2022 87
- July 2022 141
- August 2022 38
- September 2022 73
- October 2022 152
- November 2022 39
- December 2022 50
- January 2023 93
- February 2023 49
- March 2023 106
- April 2023 47
- May 2023 69
- June 2023 92
- July 2023 64
- August 2023 103
- September 2023 91
- October 2023 101
- November 2023 94
- December 2023 46
- January 2024 75
- February 2024 79
- March 2024 104
- April 2024 63
- May 2024 40
- June 2024 160
- July 2024 80
- August 2024 70
- September 2024 62
- October 2024 121
- November 2024 117
- December 2024 89
- January 2025 59
- February 2025 104
- March 2025 96
- April 2025 107
- May 2025 52
- June 2025 72
- July 2025 60
- August 2025 81
- September 2025 124
- October 2025 63
- November 2025 22
Contributors
Re: Any module that verify numbers, i.e., employee's citizen ID
Dear community,I have a requirement to validate hr.employee's citizen ID format in my country, but I think it would be nicer if we can just extend some base modules to be more generic.So far, I found this, https://github.com/OCA/partner-contact/tree/13.0/partner_identification, which can verify numbers but onlty to res.partner.Are the more generic base module to be used with other models yet, (or at least for hr.employee)Thank you,Kitti_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Torvald Bringsvor - 11:56 - 11 Feb 2021
Reference
-
Any module that verify numbers, i.e., employee's citizen ID
Dear community,I have a requirement to validate hr.employee's citizen ID format in my country, but I think it would be nicer if we can just extend some base modules to be more generic.So far, I found this, https://github.com/OCA/partner-contact/tree/13.0/partner_identification, which can verify numbers but onlty to res.partner.Are the more generic base module to be used with other models yet, (or at least for hr.employee)Thank you,Kitti
by Kitti Upariphutthiphong - 06:25 - 11 Feb 2021-
Re: Any module that verify numbers, i.e., employee's citizen ID
Thank you Alexis de Lattre, this is great!On Thu, Feb 18, 2021 at 7:36 PM Alexis de Lattre <alexis.delattre@akretion.com> wrote:Le jeu. 11 févr. 2021 à 12:46, Rubén Seijas <ruben@comunitea.com> a écrit :I would also recommend to use python-stdnum. If the citizen ID validation for your country is not yet supported by python-stdnum, you can add it there ; the maintainer is very nice and reactive. I worked with him to add support for the new VAT numbers of Northern Ireland and it was added a few days later.For example, python-stdnum supports validation of France's social security numbers. Then we have a small "glue" module l10n_fr_hr_check_ssnid that uses python-stdnum and adds a constraint to validate the number :
--Alexis de Lattre
Akretion France - 27 rue Henri Rolland - 69100 Villeurbanne - France
Mail : alexis.delattre@akretion.comMobile : +33 6 99 08 92 45_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Kitti Upariphutthiphong - 04:11 - 18 Feb 2021 -
Re: Any module that verify numbers, i.e., employee's citizen ID
Le jeu. 11 févr. 2021 à 12:46, Rubén Seijas <ruben@comunitea.com> a écrit :I would also recommend to use python-stdnum. If the citizen ID validation for your country is not yet supported by python-stdnum, you can add it there ; the maintainer is very nice and reactive. I worked with him to add support for the new VAT numbers of Northern Ireland and it was added a few days later.For example, python-stdnum supports validation of France's social security numbers. Then we have a small "glue" module l10n_fr_hr_check_ssnid that uses python-stdnum and adds a constraint to validate the number :
--Alexis de Lattre
Akretion France - 27 rue Henri Rolland - 69100 Villeurbanne - France
Mail : alexis.delattre@akretion.comMobile : +33 6 99 08 92 45
by Alexis de Lattre - 01:36 - 18 Feb 2021 -
Re: Any module that verify numbers, i.e., employee's citizen ID
Thank you everyone for the advice / suggestions.On Thu, Feb 11, 2021 at 7:17 PM Daniel Reis <dreis@opensourceintegrators.com> wrote:Hello Ruben,
AFAIK VAT number validation is out of the box in Odoo.
For specific country ID numbers, that be be a different case.
For these, I invite controibutions to the appropriate l10n_* OCA repository: https://github.com/OCA?q=l10n
Thanks
Daniel
On 11/02/2021 11:46, Rubén Seijas wrote:
Hi,
Maybe can this help.
import
stdnum.eu.vatdef check_vat(self, vat):
"""
Check VAT on create partnervat : VAT string"""_LOG.info("Checking VAT number: %s", vat)
if stdnum.eu.vat.is_valid(vat):
_LOG.info("VAT %s is valid", vat)
return vat
else:
_LOG.info("VAT not valid, detecting VAT Country...")
vat_country = stdnum.eu.vat.guess_country(vat)
if vat_country:
vat = vat_country[0].upper() + vat
_LOG.info("Country + VAT = %s, checking is valid", vat)
stdnum.eu.vat.validate(vat)
_LOG.info('VAT is valid: %s', vat)
return vat
else:
raise stdnum.eu.vat.ValidationError(
'All checks have failed on VAT {}'.format(vat))
return vat
El jue, 11 feb 2021 a las 11:57, Torvald Baade Bringsvor (<bringsvor@bringsvor.com>) escribió:
Hi
I made a module a couple of years ago for this requirement:
This validates the number entered to the rules for the Norwegian number (modulo 10) checksum) AFAIK.
But you are right, this is a common requirement for many countries.
-Torvald
tor. 11. feb. 2021 kl. 06:27 skrev Kitti Upariphutthiphong <kittiu@ecosoft.co.th>:
Dear community,
I have a requirement to validate hr.employee's citizen ID format in my country, but I think it would be nicer if we can just extend some base modules to be more generic.
So far, I found this, https://github.com/OCA/partner-contact/tree/13.0/partner_identification, which can verify numbers but onlty to res.partner.
Are the more generic base module to be used with other models yet, (or at least for hr.employee)
Thank you,Kitti
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
--
Daniel Reis
Managing Director
M: +351 919991307
E: DReis@OpenSourceIntegrators.comAv Doutor Desidério Cambournac 12 • 2710-553 Sintra, Portugal 



_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Kitti Upariphutthiphong - 05:06 - 16 Feb 2021 -
Re: Any module that verify numbers, i.e., employee's citizen ID
Hello Ruben,
AFAIK VAT number validation is out of the box in Odoo.
For specific country ID numbers, that be be a different case.
For these, I invite controibutions to the appropriate l10n_* OCA repository: https://github.com/OCA?q=l10n
Thanks
Daniel
On 11/02/2021 11:46, Rubén Seijas wrote:
Hi,
Maybe can this help.
import
stdnum.eu.vatdef check_vat(self, vat):
"""
Check VAT on create partnervat : VAT string"""_LOG.info("Checking VAT number: %s", vat)
if stdnum.eu.vat.is_valid(vat):
_LOG.info("VAT %s is valid", vat)
return vat
else:
_LOG.info("VAT not valid, detecting VAT Country...")
vat_country = stdnum.eu.vat.guess_country(vat)
if vat_country:
vat = vat_country[0].upper() + vat
_LOG.info("Country + VAT = %s, checking is valid", vat)
stdnum.eu.vat.validate(vat)
_LOG.info('VAT is valid: %s', vat)
return vat
else:
raise stdnum.eu.vat.ValidationError(
'All checks have failed on VAT {}'.format(vat))
return vat
El jue, 11 feb 2021 a las 11:57, Torvald Baade Bringsvor (<bringsvor@bringsvor.com>) escribió:
Hi
I made a module a couple of years ago for this requirement:
This validates the number entered to the rules for the Norwegian number (modulo 10) checksum) AFAIK.
But you are right, this is a common requirement for many countries.
-Torvald
tor. 11. feb. 2021 kl. 06:27 skrev Kitti Upariphutthiphong <kittiu@ecosoft.co.th>:
Dear community,
I have a requirement to validate hr.employee's citizen ID format in my country, but I think it would be nicer if we can just extend some base modules to be more generic.
So far, I found this, https://github.com/OCA/partner-contact/tree/13.0/partner_identification, which can verify numbers but onlty to res.partner.
Are the more generic base module to be used with other models yet, (or at least for hr.employee)
Thank you,Kitti
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
--
Daniel Reis
Managing Director
M: +351 919991307
E: DReis@OpenSourceIntegrators.comAv Doutor Desidério Cambournac 12 • 2710-553 Sintra, Portugal 



by Daniel Reis - 01:15 - 11 Feb 2021 -
Re: Any module that verify numbers, i.e., employee's citizen ID
Hi,Maybe can this help.import
stdnum.eu.vatdef check_vat(self, vat):
"""
Check VAT on create partnervat : VAT string"""_LOG.info("Checking VAT number: %s", vat)
if stdnum.eu.vat.is_valid(vat):
_LOG.info("VAT %s is valid", vat)
return vat
else:
_LOG.info("VAT not valid, detecting VAT Country...")
vat_country = stdnum.eu.vat.guess_country(vat)
if vat_country:
vat = vat_country[0].upper() + vat
_LOG.info("Country + VAT = %s, checking is valid", vat)
stdnum.eu.vat.validate(vat)
_LOG.info('VAT is valid: %s', vat)
return vat
else:
raise stdnum.eu.vat.ValidationError(
'All checks have failed on VAT {}'.format(vat))
return vat
El jue, 11 feb 2021 a las 11:57, Torvald Baade Bringsvor (<bringsvor@bringsvor.com>) escribió:HiI made a module a couple of years ago for this requirement:This validates the number entered to the rules for the Norwegian number (modulo 10) checksum) AFAIK.But you are right, this is a common requirement for many countries.-Torvaldtor. 11. feb. 2021 kl. 06:27 skrev Kitti Upariphutthiphong <kittiu@ecosoft.co.th>:Dear community,I have a requirement to validate hr.employee's citizen ID format in my country, but I think it would be nicer if we can just extend some base modules to be more generic.So far, I found this, https://github.com/OCA/partner-contact/tree/13.0/partner_identification, which can verify numbers but onlty to res.partner.Are the more generic base module to be used with other models yet, (or at least for hr.employee)Thank you,Kitti_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Rubén Seijas - 12:45 - 11 Feb 2021
-