Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Re: Any module that verify numbers, i.e., employee's citizen ID
Re: Any module that verify numbers, i.e., employee's citizen ID
Re: Any module that verify numbers, i.e., employee's citizen ID
byHello 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.
importstdnum.eu.vat
def check_vat(self, vat):"""Check VAT on create partner
vat : VAT string
"""
_LOG.info("Checking VAT number: %s", vat)if stdnum.eu.vat.is_valid(vat):_LOG.info("VAT %s is valid", vat)return vatelse:_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 vatelse: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
Reference
-
Any module that verify numbers, i.e., employee's citizen ID
byEcosoft Co. Ltd., Kitti Upariphutthiphong-
Re: Any module that verify numbers, i.e., employee's citizen ID
byEcosoft Co. Ltd., Kitti Upariphutthiphong -
Re: Any module that verify numbers, i.e., employee's citizen ID
byAlexinux, Alexis de Lattre -
Re: Any module that verify numbers, i.e., employee's citizen ID
byEcosoft Co. Ltd., Kitti Upariphutthiphong -
Re: Any module that verify numbers, i.e., employee's citizen ID
byClosingAp Open Source Integrators Europe, LDA, Daniel Reis -
Re: Any module that verify numbers, i.e., employee's citizen ID
byComunitea, Rubén Seijas -
Re: Any module that verify numbers, i.e., employee's citizen ID
byBringsvor Consulting AS, Torvald Bringsvor
-