[IMP] replace the SIRET & RC fields on the Company model

This commit is contained in:
Lionel Sausin
2014-03-26 17:22:09 +01:00
parent 9a8d1e65a1
commit e5a16381f8
3 changed files with 39 additions and 2 deletions

View File

@@ -20,3 +20,4 @@
##############################################################################
import partner
import company

View File

@@ -33,13 +33,17 @@ 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.
At the top of the Partner form, users will be able to enter the SIREN
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'],
'depends': ['account', 'l10n_fr'],
'data': [
'partner_view.xml',
],

32
l10n_fr_siret/company.py Normal file
View File

@@ -0,0 +1,32 @@
# -*- 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import fields, orm
class res_company(orm.Model):
"""Replace the company's fields for SIRET/RC with the ones on the partner"""
_inherit = 'res.company'
_columns = {
'siret': fields.related('partner_id', 'siret', type='char'),
'company_registry': fields.related('partner_id', 'company_registry', type='char'),
}