From c07515dae5654ccae67f20a3ff7e675749792841 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Mon, 8 Dec 2014 16:00:44 +0100 Subject: [PATCH] [DEL] l10n_fr_siret This module should migrate to https://github.com/OCA/l10n-france as per https://github.com/OCA/l10n-france/issues/2 --- __unported__/l10n_fr_siret/__init__.py | 23 ----- __unported__/l10n_fr_siret/__openerp__.py | 52 ---------- __unported__/l10n_fr_siret/company.py | 45 --------- __unported__/l10n_fr_siret/i18n/ab.po | 79 --------------- __unported__/l10n_fr_siret/i18n/fr.po | 87 ----------------- .../l10n_fr_siret/i18n/l10n_fr_siret.pot | 72 -------------- __unported__/l10n_fr_siret/i18n/pt_BR.po | 80 --------------- __unported__/l10n_fr_siret/partner.py | 97 ------------------- __unported__/l10n_fr_siret/partner_view.xml | 30 ------ 9 files changed, 565 deletions(-) delete mode 100644 __unported__/l10n_fr_siret/__init__.py delete mode 100644 __unported__/l10n_fr_siret/__openerp__.py delete mode 100644 __unported__/l10n_fr_siret/company.py delete mode 100644 __unported__/l10n_fr_siret/i18n/ab.po delete mode 100644 __unported__/l10n_fr_siret/i18n/fr.po delete mode 100644 __unported__/l10n_fr_siret/i18n/l10n_fr_siret.pot delete mode 100644 __unported__/l10n_fr_siret/i18n/pt_BR.po delete mode 100644 __unported__/l10n_fr_siret/partner.py delete mode 100644 __unported__/l10n_fr_siret/partner_view.xml diff --git a/__unported__/l10n_fr_siret/__init__.py b/__unported__/l10n_fr_siret/__init__.py deleted file mode 100644 index 3caa79b6b..000000000 --- a/__unported__/l10n_fr_siret/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Numérigraphe SARL. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from . import partner -from . import company diff --git a/__unported__/l10n_fr_siret/__openerp__.py b/__unported__/l10n_fr_siret/__openerp__.py deleted file mode 100644 index 5666a65f2..000000000 --- a/__unported__/l10n_fr_siret/__openerp__.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Numérigraphe SARL. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'French company identity numbers SIRET/SIREN/NIC', - 'version': '1.1.1', - "category": 'Accounting', - 'description': ''' -This module add the French company identity numbers. -==================================================== - -This can help any company doing business with French companies -by letting users track the partners' unique identification -numbers from the official SIRENE registry in France: SIRET, SIREN and NIC. -These numbers identify each company and their subsidiaries, and are -often required for administrative tasks. - -On the Partner form, users will be able to enter the SIREN -and NIC numbers, and the SIRET number will be calculated -automatically. The last digits of the SIREN and NIC are control keys: -OpenERP will check their validity when partners are recorded. - -ATTENTION! this module replaces the fields on the Company form with the new -ones on the Partner form, but it will NOT copy the corresponding data: you -will have to enter them again. -''', - 'author': u'Numérigraphe SARL', - 'depends': ['account', 'l10n_fr'], - 'data': [ - 'partner_view.xml', - ], - 'installable': False, - 'active': False, -} diff --git a/__unported__/l10n_fr_siret/company.py b/__unported__/l10n_fr_siret/company.py deleted file mode 100644 index 7b3140416..000000000 --- a/__unported__/l10n_fr_siret/company.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Numérigraphe SARL. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import fields, orm - - -class res_company(orm.Model): - """Replace the company's fields for SIRET/RC with the partner's""" - _inherit = 'res.company' - - def _get_partner_change(self, cr, uid, ids, context=None): - return self.pool['res.company'].search( - cr, uid, [('partner_id', 'in', ids)], context=context) - - _columns = { - 'siret': fields.related( - 'partner_id', 'siret', type='char', string='SIRET', store={ - 'res.partner': (_get_partner_change, ['siren', 'nic'], 20), - 'res.company': (lambda self, cr, uid, ids, c={}: - ids, ['partner_id'], 20), }), - 'company_registry': fields.related( - 'partner_id', 'company_registry', type='char', - string='Company Registry', store={ - 'res.partner': (_get_partner_change, ['company_registry'], 20), - 'res.company': (lambda self, cr, uid, ids, c={}: - ids, ['partner_id'], 20), }) - } diff --git a/__unported__/l10n_fr_siret/i18n/ab.po b/__unported__/l10n_fr_siret/i18n/ab.po deleted file mode 100644 index 75a158a7a..000000000 --- a/__unported__/l10n_fr_siret/i18n/ab.po +++ /dev/null @@ -1,79 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * l10n_fr_siret -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.1beta\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-18 17:53+0000\n" -"PO-Revision-Date: 2013-11-11 16:24+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-12 06:31+0000\n" -"X-Generator: Launchpad (build 17041)\n" - -#. module: l10n_fr_siret -#: field:res.partner,siren:0 -msgid "SIREN" -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,nic:0 -msgid "" -"The NIC number is the official rank number of this office in the company in " -"France. It makes the last 5 digits of the SIRET number." -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,nic:0 -msgid "NIC" -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,company_registry:0 -msgid "Company Registry" -msgstr "" - -#. module: l10n_fr_siret -#: constraint:res.partner:0 -msgid "The SIREN or NIC number is incorrect." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,siret:0 -msgid "" -"The SIRET number is the official identity number of this company's office in " -"France. It is composed of the 9 digits of the SIREN number and the 5 digits " -"of the NIC number, ie. 14 digits." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,company_registry:0 -msgid "The name of official registry where this company was declared." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,siren:0 -msgid "" -"The SIREN number is the official identity number of the company in France. " -"It makes the first 9 digits of the SIRET number." -msgstr "" - -#. module: l10n_fr_siret -#: model:ir.model,name:l10n_fr_siret.model_res_partner -msgid "Partner" -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,siret:0 -msgid "SIRET" -msgstr "" - -#. module: l10n_fr_siret -#: view:res.partner:0 -msgid "Accounting" -msgstr "" diff --git a/__unported__/l10n_fr_siret/i18n/fr.po b/__unported__/l10n_fr_siret/i18n/fr.po deleted file mode 100644 index 3113717ec..000000000 --- a/__unported__/l10n_fr_siret/i18n/fr.po +++ /dev/null @@ -1,87 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * l10n_fr_siret -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.1beta\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-18 17:53+0000\n" -"PO-Revision-Date: 2013-11-11 16:06+0000\n" -"Last-Translator: Alexandre Fayolle - camptocamp " -"\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-12 06:31+0000\n" -"X-Generator: Launchpad (build 17041)\n" - -#. module: l10n_fr_siret -#: field:res.partner,siren:0 -msgid "SIREN" -msgstr "SIREN" - -#. module: l10n_fr_siret -#: help:res.partner,nic:0 -msgid "" -"The NIC number is the official rank number of this office in the company in " -"France. It makes the last 5 digits of the SIRET number." -msgstr "" -"Le numéro NIC est le numéro de rang officiel de cet établissement dans sa " -"société en France. Il compose les 5 derniers chiffres du numéro SIRET." - -#. module: l10n_fr_siret -#: field:res.partner,nic:0 -msgid "NIC" -msgstr "NIC" - -#. module: l10n_fr_siret -#: field:res.partner,company_registry:0 -msgid "Company Registry" -msgstr "" - -#. module: l10n_fr_siret -#: constraint:res.partner:0 -msgid "The SIREN or NIC number is incorrect." -msgstr "Le numéro SIREN ou NIC est incorrect." - -#. module: l10n_fr_siret -#: help:res.partner,siret:0 -msgid "" -"The SIRET number is the official identity number of this company's office in " -"France. It is composed of the 9 digits of the SIREN number and the 5 digits " -"of the NIC number, ie. 14 digits." -msgstr "" -"Le numéro SIRET est l'identifiant officiel de l'établissement en France. Il " -"est composé des 9 chiffres du numéro SIREN et des 5 chiffres du numéro NIC, " -"soit 14 chiffres." - -#. module: l10n_fr_siret -#: help:res.partner,company_registry:0 -msgid "The name of official registry where this company was declared." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,siren:0 -msgid "" -"The SIREN number is the official identity number of the company in France. " -"It makes the first 9 digits of the SIRET number." -msgstr "" -"Le numéro SIREN est l'identifiant officiel de la société en France. Il " -"compose les 9 premiers chiffres du numéro SIRET." - -#. module: l10n_fr_siret -#: model:ir.model,name:l10n_fr_siret.model_res_partner -msgid "Partner" -msgstr "Partenaire" - -#. module: l10n_fr_siret -#: field:res.partner,siret:0 -msgid "SIRET" -msgstr "SIRET" - -#. module: l10n_fr_siret -#: view:res.partner:0 -msgid "Accounting" -msgstr "" diff --git a/__unported__/l10n_fr_siret/i18n/l10n_fr_siret.pot b/__unported__/l10n_fr_siret/i18n/l10n_fr_siret.pot deleted file mode 100644 index 62c23ec50..000000000 --- a/__unported__/l10n_fr_siret/i18n/l10n_fr_siret.pot +++ /dev/null @@ -1,72 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * l10n_fr_siret -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-18 17:53+0000\n" -"PO-Revision-Date: 2013-10-18 17:53+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: l10n_fr_siret -#: field:res.partner,siren:0 -msgid "SIREN" -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,nic:0 -msgid "The NIC number is the official rank number of this office in the company in France. It makes the last 5 digits of the SIRET number." -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,nic:0 -msgid "NIC" -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,company_registry:0 -msgid "Company Registry" -msgstr "" - -#. module: l10n_fr_siret -#: constraint:res.partner:0 -msgid "The SIREN or NIC number is incorrect." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,siret:0 -msgid "The SIRET number is the official identity number of this company's office in France. It is composed of the 9 digits of the SIREN number and the 5 digits of the NIC number, ie. 14 digits." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,company_registry:0 -msgid "The name of official registry where this company was declared." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,siren:0 -msgid "The SIREN number is the official identity number of the company in France. It makes the first 9 digits of the SIRET number." -msgstr "" - -#. module: l10n_fr_siret -#: model:ir.model,name:l10n_fr_siret.model_res_partner -msgid "Partner" -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,siret:0 -msgid "SIRET" -msgstr "" - -#. module: l10n_fr_siret -#: view:res.partner:0 -msgid "Accounting" -msgstr "" - diff --git a/__unported__/l10n_fr_siret/i18n/pt_BR.po b/__unported__/l10n_fr_siret/i18n/pt_BR.po deleted file mode 100644 index 3ced9521e..000000000 --- a/__unported__/l10n_fr_siret/i18n/pt_BR.po +++ /dev/null @@ -1,80 +0,0 @@ -# Brazilian Portuguese translation for account-financial-tools -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the account-financial-tools package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: account-financial-tools\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2013-10-18 17:53+0000\n" -"PO-Revision-Date: 2014-01-10 11:55+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Brazilian Portuguese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-12 06:31+0000\n" -"X-Generator: Launchpad (build 17041)\n" - -#. module: l10n_fr_siret -#: field:res.partner,siren:0 -msgid "SIREN" -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,nic:0 -msgid "" -"The NIC number is the official rank number of this office in the company in " -"France. It makes the last 5 digits of the SIRET number." -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,nic:0 -msgid "NIC" -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,company_registry:0 -msgid "Company Registry" -msgstr "" - -#. module: l10n_fr_siret -#: constraint:res.partner:0 -msgid "The SIREN or NIC number is incorrect." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,siret:0 -msgid "" -"The SIRET number is the official identity number of this company's office in " -"France. It is composed of the 9 digits of the SIREN number and the 5 digits " -"of the NIC number, ie. 14 digits." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,company_registry:0 -msgid "The name of official registry where this company was declared." -msgstr "" - -#. module: l10n_fr_siret -#: help:res.partner,siren:0 -msgid "" -"The SIREN number is the official identity number of the company in France. " -"It makes the first 9 digits of the SIRET number." -msgstr "" - -#. module: l10n_fr_siret -#: model:ir.model,name:l10n_fr_siret.model_res_partner -msgid "Partner" -msgstr "" - -#. module: l10n_fr_siret -#: field:res.partner,siret:0 -msgid "SIRET" -msgstr "" - -#. module: l10n_fr_siret -#: view:res.partner:0 -msgid "Accounting" -msgstr "" diff --git a/__unported__/l10n_fr_siret/partner.py b/__unported__/l10n_fr_siret/partner.py deleted file mode 100644 index 13aac7653..000000000 --- a/__unported__/l10n_fr_siret/partner.py +++ /dev/null @@ -1,97 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Numérigraphe SARL. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import fields, orm - - -# XXX: this is used for checking various codes such as credit card -# numbers: should it be moved to tools.py? -def _check_luhn(string): - """Luhn test to check control keys - - Credits: - http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#Python - """ - r = [int(ch) for ch in string][::-1] - return (sum(r[0::2]) + sum(sum(divmod(d * 2, 10)) - for d in r[1::2])) % 10 == 0 - - -class Partner(orm.Model): - """Add the French official company identity numbers SIREN, NIC and SIRET""" - _inherit = 'res.partner' - - def _get_siret(self, cr, uid, ids, field_name, arg, context=None): - """Concatenate the SIREN and NIC to form the SIRET""" - return {partner.id: '%s%s' % (partner.siren, partner.nic or '*****') - if partner.siren else '' - for partner in self.browse(cr, uid, ids, context=context)} - - def _check_siret(self, cr, uid, ids): - """Check the SIREN's and NIC's keys (last digits)""" - for partner in self.browse(cr, uid, ids, context=None): - if partner.nic: - # Check the NIC type and length - if not partner.nic.isdecimal() or len(partner.nic) != 5: - return False - if partner.siren: - # Check the SIREN type, length and key - if (not partner.siren.isdecimal() - or len(partner.siren) != 9 - or not _check_luhn(partner.siren)): - return False - # Check the NIC key (you need both SIREN and NIC to check it) - if partner.nic and not _check_luhn(partner.siren - + partner.nic): - return False - return True - - _columns = { - 'siren': fields.char('SIREN', size=9, - help="The SIREN number is the official identity " - "number of the company in France. It makes " - "the first 9 digits of the SIRET number."), - 'nic': fields.char('NIC', size=5, - help="The NIC number is the official rank number " - "of this office in the company in France. It " - "makes the last 5 digits of the SIRET " - "number."), - 'siret': fields.function( - _get_siret, type="char", string='SIRET', - method=True, size=14, - store={ - 'res.partner': [lambda self, cr, uid, ids, context=None: ids, - ['siren', 'nic'], 10]}, - help="The SIRET number is the official identity number of this " - "company's office in France. It is composed of the 9 digits " - "of the SIREN number and the 5 digits of the NIC number, ie. " - "14 digits."), - 'company_registry': fields.char( - 'Company Registry', size=64, - help="The name of official registry where this " - "company was declared."), - } - - _constraints = [ - (_check_siret, - "The SIREN or NIC number is incorrect.", - ["siren", "nic"]), - ] diff --git a/__unported__/l10n_fr_siret/partner_view.xml b/__unported__/l10n_fr_siret/partner_view.xml deleted file mode 100644 index b373bb2b2..000000000 --- a/__unported__/l10n_fr_siret/partner_view.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - res.partner.form.siret - res.partner - - - - - - - - - - - - - - - - - - -