Merge lp:~numerigraphe-team/openobject-addons/trunk-l10n-fr-siret into lp:openobject-addons
- trunk-l10n-fr-siret
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Olivier Dony (Odoo) |
Proposed branch: | lp:~numerigraphe-team/openobject-addons/trunk-l10n-fr-siret |
Merge into: | lp:openobject-addons |
Diff against target: |
476 lines (+341/-32) (has conflicts) 12 files modified
l10n_fr/__openerp__.py (+4/-2) l10n_fr/l10n_fr.py (+3/-0) l10n_fr/l10n_fr_view.xml (+0/-21) l10n_fr_rib/__openerp__.py (+1/-0) l10n_fr_siret/__init__.py (+25/-0) l10n_fr_siret/__openerp__.py (+50/-0) l10n_fr_siret/i18n/fr.po (+57/-0) l10n_fr_siret/i18n/l10n_fr_siret.po (+57/-0) l10n_fr_siret/partner.py (+98/-0) l10n_fr_siret/partner_view.xml (+25/-0) product/product.py (+19/-8) stock/stock.py (+2/-1) Text conflict in l10n_fr/l10n_fr.py Text conflict in product/product.py |
To merge this branch: | bzr merge lp:~numerigraphe-team/openobject-addons/trunk-l10n-fr-siret |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lionel Sausin - Initiatives/Numérigraphe (community) | Disapprove | ||
Alexandre Fayolle - camptocamp | Pending | ||
OpenERP French Localization | Pending | ||
OpenERP Core Team | Pending | ||
Christophe CRIER | functional | Pending | |
risto3 | functional | Pending | |
Review via email: mp+210096@code.launchpad.net |
This proposal supersedes a proposal from 2013-02-07.
Commit message
Description of the change
Please let me propose another enhancement to the French localization.
Most users in France like to keep track of the French official id number (SIRET) and registry of commerce (RCS) of their customers and suppliers.
This branch contains a new module "l10n_fr_siret" to let users enter the SIREN and NIC on the partner form. It will check the control key in those numbers, and record the corresponding SIRET (concatenation of the 2).
This module is a rewrite of a custom module of ours, and now takes into account remarks and other similar modules reported on the OpenERP French Forum and in the Sistheo project.
A previous version was submitted in 2011, and another version in in 2012 that I think addressed the objections that were raised.
I never got any feedback so please allow me to resubmit now.
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
risto3 (risto3) wrote : Posted in a previous version of this proposal | # |
Evaluating using l10n_fr_siret to get CFONB-conforming SEPA support into account_pain which, for France, seems to require the use of the SIRET.
Although I agree that the SIREN should be on the partner object, I believe that the NIC/SIRET should perhaps find itself more appropriately on the res_partner_
This is to avoid unnecessary partner objects for multiple establishments...
Has anybody already attempted this?
risto3 (risto3) wrote : Posted in a previous version of this proposal | # |
btw, it seems tryton puts the SIREN on the party object and the SIRET on the address object which seems to confirm my comments above.
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
Thanks for your feedback risto3.
The current proposal implied that each partner is an office with its own SIRET ("Etablissement" in the SIRENE jargon), and I expect the main office / branch office relationship to be described by the partner/parent partner relationship, not the partner/address relationship.
However, that was suited for v6.x but in v7.0 the partner's hierarchical model has changed, so this proposal may be unfit.
I'd be glad if you can make a proposal based upon ours.
Thanks anyway.
Lionel
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
I've added the RCS as suggested by risto3 in https:/
I've also improved the view to fit well in the future v7.
With regards to the partner/address changes in v7, I do think res.partner is the right place to hold the SIRET+RCS - actually it's clearer now than it was in v6-.
Alexis de Lattre (alexis-via) wrote : Posted in a previous version of this proposal | # |
I do not have the use of SIRET on res.partner ; only SIREN is usefull.
In the third comment, risto3 says :
<<
Evaluating using l10n_fr_siret to get CFONB-conforming SEPA support into account_pain which, for France, seems to require the use of the SIRET.
>>
Could you be more specific and give more details about this ? If you do SEPA Credit Transfer, with PAIN 001.001.02/03/04, you don't need SIRET nor SIREN.
If you look at my module "account_
https:/
What is the "account_pain" module you are referring to ? Is it the one from Noviat located in their own branch (I just discovered it). I understand that this module is an alternative to mine, and that it's not part of the banking-addons framework. Is it right ?
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
Le 27/08/2012 22:43, Alexis de Lattre a écrit :
> I do not have the use of SIRET on res.partner ; only SIREN is usefull.
That's fine, the SIRET is only computed if both the SIREN and NIC are
recorded, so you may use the SIREN on its own.
Lionel.
risto3 (risto3) wrote : Posted in a previous version of this proposal | # |
I believe the use of SIRET is a remnant of CFONB ETEBAC, and that (in our case) the tests with FIDUCIAL and the Banque Populaire expect the SIRET in CFONB SEPA messages in their Cyberplus platform which accepts both formats (xml or cfonb).
Strictly speaking I notice that since 1 jan 2011 it is not stricto-senso required:
From the CFONB's Guide ISO20022 Virements V2.0-1.pdf
=======
A noter : à partir du 1er janvier 2011 les virements intra zone SEPA ne feront plus l‟objet de déclaration à la balance des paiements.
Remarque : Les modalités concernant la balance de paiements sont susceptibles d‟évoluer, de ce fait, il est fortement recommandé de se renseigner auprès de sa banque ou sur le site de la Banque de France.
=======
In our case, the following is used in <InitgPty> </InitgPty> :
<Nm>Mr XXXXXX</Nm> Nom du donneur d‟ordre initial
<Id>
<OrgId>
<Othr>
<Id>12345678901
<SchmeNm>
<Prtry>
</SchmeNm>
</Othr>
</OrgId>
</Id>
For the meanwhile we will continue with SIRET, but in the future, in theory anyway, I understand that either the SIRET, SIREN or VAT ID should be given for companies, and title, birth date and location for individuals in addition to the name(s).
(btw, according to the "Inventory of External Code Lists - Required by (but external to) the ISO 20022 XML Message Schemas" Publication date 16 July, 2012 - 2Q2012 Source ISO20022.org pain.001.001.04 subtly defines respectfully SRET/SREN/TXID)
The banque apparently will control the IBAN with the party details such as the following:
01000 = IBAN valide et existant + FAUX (000) = IBAN invalide ou inexistant
01001 = IBAN valide et existant + VRAI (001) = IBAN valide et existant
02000 = type de compte correct + FAUX (000) = type de compte incorrect
02001 = type de compte correct + VRAI (001) = type de compte correct
03000 = SIREN fourni et OK + FAUX (000) = SIREN incorrect
03001 = SIREN fourni et OK + VRAI (001) = SIREN correct
03002 = SIREN fourni KO mais repli sur SIRET OK + FAUX = SIRET sur SIREN incorrect
03003 = SIREN fourni KO mais repli sur SIRET OK + VRAI = SIRET sur SIREN correct
03020 = SIREN non fourni
04000 = SIRET fourni et OK + FAUX (000) = SIRET incorrect
04001 = SIRET fourni et OK + VRAI (001) = SIRET correct
04020 = SIRET non fourni
05000 = N° TVA Intracommunautaire fournie et FAUX (000) = N° TVA intracommunautaire incorrecte
05001 = N° TVA Intracommunautaire fournie et VRAI (001) = N° TVA intracommunautaire correcte
05020 = N° TVA Intracommunautaire non fournie
06000 = date de naissance fournie et FAUX (000) = Date de naissance incorrecte
06001 = date de naissance fournie et VRAI (001) = Date de naissance correcte
06003 = date de naissance fournie KO mais année OK + FAUX = année de naissance correcte
06004 = date de naissance fournie KO mais année OK + VRAI = année de naissance incorrecte
06020 = date de naissance non fournie
07000 = ville de naissance fournie correcte + FAUX (000) = ville de naissance incorrecte
07001 = ville de naissance fournie correcte + VRAI (001) = ville de naissanc...
Alexis de Lattre (alexis-via) wrote : Posted in a previous version of this proposal | # |
@risto3 :
Thanks for your interesting explainations. In my module "account_
<InitgPty>
<Nm>Company name</Nm>
</InitgPty>
and it is accepted fine by the CIC. I was not aware that we could/should use sub-blocks to give more information about the company.
By the way, are you connected to the author of the module 'account_pain' ?
risto3 (risto3) wrote : Posted in a previous version of this proposal | # |
No, our first pass is based upon account_pain but migration is underway to banking-addons where akretion seems to have been doing some work, already at pain.001.001.04, but have not heard back on my request to collaborate (that is, putting support in for .03)...
Back to the subject of the merge, and the discussion of res.partner where the proposal is to have VAT, SIREN and NIC, I'm concerned about the constraints needed.
VAT is company wide, as is SIREN, but SIRET (SIREN + NIC) is unique (to the establishments address), but what about temporary agencies and depots? No SIRET (SIREN + NIC) is sure, but VAT? It seems that VAT should only be valid if SIREN and NIC are non null.
How to consider e.g. a depot as other than an address, it has no 'personality'.
Sorry, I am at a loss as to the benefits of deprecating res.partner.
risto3 (risto3) wrote : Posted in a previous version of this proposal | # |
Another question
I presume when SIREN != null then the partner is considered a company (and not an individual)
but has there been any consideration on how to indicate which SIRET(NIC) is the company headquarters (siège social)?
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
> I presume when SIREN != null then the partner is considered a company (and not
> an individual)
I didn't think about that, but now we have a boolean to indicate if the partner is a company: would you like the SIRET fields hidden when it's not a company?
> but has there been any consideration on how to indicate which SIRET(NIC) is
> the company headquarters (siège social)?
I suppose you could find the HQ by going upward the partner tree. I don't yet see a practical value for that however.
>It seems that VAT should only be valid if SIREN and NIC are non null.
VAT is still independent from SIRET, so you can use the same VAT for several establishments.
We can't link SIRET and VAT because non-French partners don't have a SIRET.
> How to consider e.g. a depot as other than an address, it has no 'personality'.
Just don't enter a VAT or SIRET - or am I missing something?
risto3 (risto3) wrote : Posted in a previous version of this proposal | # |
Well, perhaps both SIREN and SIRET (NIC) are N/A when not a company.
I'm not sure what you mean by going up the partner tree.. parent_id is not appropriate
(and parent_left is immediate parent up, parent_right is first child)
as they are all the same company, forcibly it's simply a list, ideally an ordered list.
Where is the sibling res.partner list?
Hmm, another complexity with the 'new' structure would be to determine upon which partner (or all of them!) the mother company (companies) need to be indicated, the same for subsidiaries and the like...
By the way, the unique establishment identifier (SIRET) does exist elsewhere in Europe
(I believe all Europe is supposed to follow at some point or another the EU guidelines):
in Holland => vestigingsnummer (old system before july 2011 was n°KvK + subdossiernummer)
in Belgium => idem (or unité d'établissement )
Alexis de Lattre (alexis-via) wrote : Posted in a previous version of this proposal | # |
@risto3
I am glad to hear that you would like to collaborate on my work for SEPA Credit Transfer on banking-addons. You talk about your "request to collaborate"... where did you send it ? I probably missed it.
You can contact me on : alexis dot delattre _at_ akretion dot com
Fabien (Open ERP) (fp-tinyerp) wrote : Posted in a previous version of this proposal | # |
can someone from France approve of disapprove this merge proposal. I am thinking about merging it but I want to be sure that it fits France's requirement.
I have a question:
- de we need the company_registry? Isn't it the partner name? Because I am afraid that a lot of users will not fill in this field. Is it a problem if we don't fill it (it fault back to the real name ?)
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
Dear Fabien,
"Company registry" is the name of the local registry kept by the tribunal of commerce.
For example Numérigraphe SARL is registered in the "RCS Le Mans".
I hope this makes it clearer.
Lionel.
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
I forgot to write: it's ok to not fill company_registry, it's only informational.
Arnaud Pineux (OpenERP) (api-openerp) wrote : Posted in a previous version of this proposal | # |
Dear all,
Before merging anything we need clarification and/or correction. The module l10n_fr_siret is a dependancy of l10n_fr, so it means that l10n_fr_siret is mandatory to use l10n_fr. If we always need l10n_fr_siret to use l10n_fr, why imrpovement of siret don't belong to l10n_fr as it was before?
If l10n_fr_siret is a new addons which is not mandatory for the french accounting, why is it a dependency of l10n_fr when it should be the opposite (l10n_fr is a dependency of l10n_fr_siret)?
Thank you
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
Dear Arnaud Pineux,
I made this as a module to be consistent with what was advised for l10n_fr_rib (French bank details) - just for the sake of not making l10n_fr too big.
Would you rather this and l10n_fr_rib be made installable options ? Any pointer so I can make the proper changes quickly ?
Lionel.
Arnaud Pineux (OpenERP) (api-openerp) wrote : Posted in a previous version of this proposal | # |
If it is an option (not manadatory in every french accounting) then it will be nice to have that as an option. Therefore it must depend on l10n_fr and not in the opposite way.
Thanks, we will merge your changes asap.
API
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : Posted in a previous version of this proposal | # |
The MP should be updated to have a target on lp:openobject-addons/7.0 (which does not prevent from also merging in trunk).
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : Posted in a previous version of this proposal | # |
Is someone working on the MP? Lionel, can I help you with this?
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
Dear Alexandre Fayolle and followers,
I'm grateful for your help.
I' merge Alexandre's branch as a first step, but as I commented there[1] I'd still like to make this a "check the box to install" option, but I need guidance.
[1] https:/
Lionel.
Numérigraphe (numerigraphe) wrote : Posted in a previous version of this proposal | # |
Hi all,
I've removed all the dependencies between l10n_fr and l10n_fr_* altogether. l10n_fr_siret and l10n_fr_rib work fine without l10n_fr.
This is not perfect - but I've been delaying this too long, and I came to think it would be better to merge this now, and make other proposals to improve later.
Lionel
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote : | # |
Had to change the URL of this proposal : it now sits at https:/
Sorry about that.
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote : | # |
The branch runs red in runbot, sorry. I'll fix it and resubmit
Alexis de Lattre (alexis-via) wrote : | # |
Lionel,
I think we should maintain this module l10n_fr_siret outside of lp:openobject-addons, so that we don't bother OpenERP S.A. everytime we have to make a change in this France-specific code. OpenERP S.A. already has so many pending merge proposals on important modules such as account/
Your module l10n_fr_siret has already been accepted in the OCA project lp:account-financial-tools, so it now has a good visibility and it would be a bad idea to duplicate it between openobject-addons and account-
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote : | # |
Thanks for your review Alexis, you make a good point.
TLDR: I'm removing this proposal for now, and will propose again some time later if I get feedback from French users wanting this in the core.
Indeed my plan was initially to push this to the trunk and remove it from OCA's branches, because:
1/ same fields were already added to res.company
2/ eventually I wanted to let users check a box to install the module, which to my knowledge can only be done through an already-installed module (l10n_fr in this case)
But thinking again, I found a solution to handle 1/ in the community module, and 2/ is not so important.
So there is no pressing need to push this to the core, and I'm OK to migrate to lp:openerp-french-localization instead, as soon as the following improvements are accepted:
https:/
Olivier Dony (Odoo) (odo-openerp) wrote : | # |
(Just rejected the MP as requested by Lionel)
Preview Diff
1 | === modified file 'account/account_invoice.py' |
2 | === modified file 'l10n_fr/__openerp__.py' |
3 | --- l10n_fr/__openerp__.py 2013-10-27 12:31:04 +0000 |
4 | +++ l10n_fr/__openerp__.py 2014-03-09 20:16:20 +0000 |
5 | @@ -51,13 +51,15 @@ |
6 | in l10n_fr; companies that sell services to DOM-based companies should update the |
7 | configuration of their taxes and fiscal positions manually. |
8 | |
9 | +Users wanting to store the NAF/APE codes should look into the module l10n_fr_naf_ape |
10 | +from https://launchpad.net/openerp-nomenclatures |
11 | + |
12 | **Credits:** Sistheo, Zeekom, CrysaLEAD, Akretion and Camptocamp. |
13 | """, |
14 | - 'depends': ['base_iban', 'account', 'account_chart', 'base_vat', 'l10n_fr_rib'], |
15 | + 'depends': ['base_iban', 'account', 'account_chart', 'base_vat'], |
16 | 'data': [ |
17 | 'fr_report.xml', |
18 | 'plan_comptable_general.xml', |
19 | - 'l10n_fr_view.xml', |
20 | 'l10n_fr_wizard.xml', |
21 | 'fr_pcg_taxes.xml', |
22 | 'fr_tax.xml', |
23 | |
24 | === modified file 'l10n_fr/l10n_fr.py' |
25 | --- l10n_fr/l10n_fr.py 2013-10-27 12:31:04 +0000 |
26 | +++ l10n_fr/l10n_fr.py 2014-03-09 20:16:20 +0000 |
27 | @@ -48,6 +48,7 @@ |
28 | ] |
29 | |
30 | |
31 | +<<<<<<< TREE |
32 | class res_company(osv.osv): |
33 | _inherit = 'res.company' |
34 | |
35 | @@ -57,4 +58,6 @@ |
36 | } |
37 | |
38 | |
39 | +======= |
40 | +>>>>>>> MERGE-SOURCE |
41 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
42 | |
43 | === removed file 'l10n_fr/l10n_fr_view.xml' |
44 | --- l10n_fr/l10n_fr_view.xml 2013-10-27 12:31:04 +0000 |
45 | +++ l10n_fr/l10n_fr_view.xml 1970-01-01 00:00:00 +0000 |
46 | @@ -1,21 +0,0 @@ |
47 | -<?xml version="1.0" encoding="utf-8"?> |
48 | -<openerp> |
49 | - <data> |
50 | - |
51 | - <record id="res_company_form_l10n_fr" model="ir.ui.view"> |
52 | - <field name="name">res.company.form.l10n.fr</field> |
53 | - <field name="model">res.company</field> |
54 | - <field name="priority">20</field> |
55 | - <field name="inherit_id" ref="base.view_company_form"/> |
56 | - <field name="arch" type="xml"> |
57 | - <data> |
58 | - <xpath expr="//field[@name='company_registry']" position="after"> |
59 | - <field name="siret"/> |
60 | - <field name="ape"/> |
61 | - </xpath> |
62 | - </data> |
63 | - </field> |
64 | - </record> |
65 | - |
66 | - </data> |
67 | -</openerp> |
68 | |
69 | === modified file 'l10n_fr_rib/__openerp__.py' |
70 | --- l10n_fr_rib/__openerp__.py 2012-11-29 22:26:45 +0000 |
71 | +++ l10n_fr_rib/__openerp__.py 2014-03-09 20:16:20 +0000 |
72 | @@ -27,6 +27,7 @@ |
73 | This module lets users enter the banking details of Partners in the RIB format (French standard for bank accounts details). |
74 | =========================================================================================================================== |
75 | |
76 | +This can help any company doing business with French Banks. |
77 | RIB Bank Accounts can be entered in the "Accounting" tab of the Partner form by specifying the account type "RIB". |
78 | |
79 | The four standard RIB fields will then become mandatory: |
80 | |
81 | === added directory 'l10n_fr_siret' |
82 | === added file 'l10n_fr_siret/__init__.py' |
83 | --- l10n_fr_siret/__init__.py 1970-01-01 00:00:00 +0000 |
84 | +++ l10n_fr_siret/__init__.py 2014-03-09 20:16:20 +0000 |
85 | @@ -0,0 +1,25 @@ |
86 | +# -*- encoding: utf-8 -*- |
87 | +############################################################################## |
88 | +# |
89 | +# OpenERP, Open Source Management Solution |
90 | +# Copyright (C) 2011 Numérigraphe SARL. |
91 | +# |
92 | +# This program is free software: you can redistribute it and/or modify |
93 | +# it under the terms of the GNU Affero General Public License as |
94 | +# published by the Free Software Foundation, either version 3 of the |
95 | +# License, or (at your option) any later version. |
96 | +# |
97 | +# This program is distributed in the hope that it will be useful, |
98 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
99 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
100 | +# GNU Affero General Public License for more details. |
101 | +# |
102 | +# You should have received a copy of the GNU Affero General Public License |
103 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
104 | +# |
105 | +############################################################################## |
106 | + |
107 | +import partner |
108 | + |
109 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
110 | + |
111 | |
112 | === added file 'l10n_fr_siret/__openerp__.py' |
113 | --- l10n_fr_siret/__openerp__.py 1970-01-01 00:00:00 +0000 |
114 | +++ l10n_fr_siret/__openerp__.py 2014-03-09 20:16:20 +0000 |
115 | @@ -0,0 +1,50 @@ |
116 | +# -*- encoding: utf-8 -*- |
117 | +############################################################################## |
118 | +# |
119 | +# OpenERP, Open Source Management Solution |
120 | +# Copyright (C) 2011 Numérigraphe SARL. |
121 | +# |
122 | +# This program is free software: you can redistribute it and/or modify |
123 | +# it under the terms of the GNU Affero General Public License as |
124 | +# published by the Free Software Foundation, either version 3 of the |
125 | +# License, or (at your option) any later version. |
126 | +# |
127 | +# This program is distributed in the hope that it will be useful, |
128 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
129 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
130 | +# GNU Affero General Public License for more details. |
131 | +# |
132 | +# You should have received a copy of the GNU Affero General Public License |
133 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
134 | +# |
135 | +############################################################################## |
136 | + |
137 | +{ |
138 | + 'name': 'French company identity numbers SIRET/SIREN/NIC', |
139 | + 'version': '1.0', |
140 | + "category": 'Hidden', |
141 | + 'description': ''' |
142 | +This module add the French company identity numbers. |
143 | +==================================================== |
144 | + |
145 | +This can help any company doing business with French companies |
146 | +by letting users track the partners' unique identification |
147 | +numbers from the official SIRENE registry in France: SIRET, SIREN and NIC. |
148 | +These numbers identify each company and their subsidiaries, and are |
149 | +often required for administrative tasks. |
150 | + |
151 | +At the top of the Partner form, users will be able to enter the SIREN |
152 | +and NIC numbers, and the SIRET number will be calculated automatically. |
153 | +The last digits of the SIREN and NIC are control keys: OpenERP will check their |
154 | +validity when partners are recorded. |
155 | +''', |
156 | + 'author' : u'Numérigraphe SARL', |
157 | + 'depends': ['base'], |
158 | + 'data': [ |
159 | + 'partner_view.xml', |
160 | + ], |
161 | + 'installable': True, |
162 | + 'active': False, |
163 | +} |
164 | + |
165 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
166 | |
167 | === added directory 'l10n_fr_siret/i18n' |
168 | === added file 'l10n_fr_siret/i18n/fr.po' |
169 | --- l10n_fr_siret/i18n/fr.po 1970-01-01 00:00:00 +0000 |
170 | +++ l10n_fr_siret/i18n/fr.po 2014-03-09 20:16:20 +0000 |
171 | @@ -0,0 +1,57 @@ |
172 | +# Translation of OpenERP Server. |
173 | +# This file contains the translation of the following modules: |
174 | +# * l10n_fr_siret |
175 | +# |
176 | +msgid "" |
177 | +msgstr "" |
178 | +"Project-Id-Version: OpenERP Server 6.1beta\n" |
179 | +"Report-Msgid-Bugs-To: \n" |
180 | +"POT-Creation-Date: 2011-12-08 14:04+0000\n" |
181 | +"PO-Revision-Date: 2011-12-08 14:04+0000\n" |
182 | +"Last-Translator: <>\n" |
183 | +"Language-Team: \n" |
184 | +"MIME-Version: 1.0\n" |
185 | +"Content-Type: text/plain; charset=UTF-8\n" |
186 | +"Content-Transfer-Encoding: \n" |
187 | +"Plural-Forms: \n" |
188 | + |
189 | +#. module: l10n_fr_siret |
190 | +#: field:res.partner,siren:0 |
191 | +msgid "SIREN" |
192 | +msgstr "SIREN" |
193 | + |
194 | +#. module: l10n_fr_siret |
195 | +#: field:res.partner,nic:0 |
196 | +msgid "NIC" |
197 | +msgstr "NIC" |
198 | + |
199 | +#. module: l10n_fr_siret |
200 | +#: constraint:res.partner:0 |
201 | +msgid "The SIREN or NIC number is incorrect." |
202 | +msgstr "Le numéro SIREN ou NIC est incorrect." |
203 | + |
204 | +#. module: l10n_fr_siret |
205 | +#: help:res.partner,siret:0 |
206 | +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." |
207 | +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." |
208 | + |
209 | +#. module: l10n_fr_siret |
210 | +#: help:res.partner,siren:0 |
211 | +msgid "The SIREN number is the official identity number of the company in France. It makes the first 9 digits of the SIRET number." |
212 | +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." |
213 | + |
214 | +#. module: l10n_fr_siret |
215 | +#: help:res.partner,nic:0 |
216 | +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." |
217 | +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." |
218 | + |
219 | +#. module: l10n_fr_siret |
220 | +#: field:res.partner,siret:0 |
221 | +msgid "SIRET" |
222 | +msgstr "SIRET" |
223 | + |
224 | +#. module: l10n_fr_siret |
225 | +#: model:ir.model,name:l10n_fr_siret.model_res_partner |
226 | +msgid "Partner" |
227 | +msgstr "Partenaire" |
228 | + |
229 | |
230 | === added file 'l10n_fr_siret/i18n/l10n_fr_siret.po' |
231 | --- l10n_fr_siret/i18n/l10n_fr_siret.po 1970-01-01 00:00:00 +0000 |
232 | +++ l10n_fr_siret/i18n/l10n_fr_siret.po 2014-03-09 20:16:20 +0000 |
233 | @@ -0,0 +1,57 @@ |
234 | +# Translation of OpenERP Server. |
235 | +# This file contains the translation of the following modules: |
236 | +# * l10n_fr_siret |
237 | +# |
238 | +msgid "" |
239 | +msgstr "" |
240 | +"Project-Id-Version: OpenERP Server 6.1beta\n" |
241 | +"Report-Msgid-Bugs-To: \n" |
242 | +"POT-Creation-Date: 2011-12-08 14:03+0000\n" |
243 | +"PO-Revision-Date: 2011-12-08 14:03+0000\n" |
244 | +"Last-Translator: <>\n" |
245 | +"Language-Team: \n" |
246 | +"MIME-Version: 1.0\n" |
247 | +"Content-Type: text/plain; charset=UTF-8\n" |
248 | +"Content-Transfer-Encoding: \n" |
249 | +"Plural-Forms: \n" |
250 | + |
251 | +#. module: l10n_fr_siret |
252 | +#: field:res.partner,siren:0 |
253 | +msgid "SIREN" |
254 | +msgstr "" |
255 | + |
256 | +#. module: l10n_fr_siret |
257 | +#: field:res.partner,nic:0 |
258 | +msgid "NIC" |
259 | +msgstr "" |
260 | + |
261 | +#. module: l10n_fr_siret |
262 | +#: constraint:res.partner:0 |
263 | +msgid "The SIREN or NIC number is incorrect." |
264 | +msgstr "" |
265 | + |
266 | +#. module: l10n_fr_siret |
267 | +#: help:res.partner,siret:0 |
268 | +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." |
269 | +msgstr "" |
270 | + |
271 | +#. module: l10n_fr_siret |
272 | +#: help:res.partner,siren:0 |
273 | +msgid "The SIREN number is the official identity number of the company in France. It makes the first 9 digits of the SIRET number." |
274 | +msgstr "" |
275 | + |
276 | +#. module: l10n_fr_siret |
277 | +#: help:res.partner,nic:0 |
278 | +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." |
279 | +msgstr "" |
280 | + |
281 | +#. module: l10n_fr_siret |
282 | +#: field:res.partner,siret:0 |
283 | +msgid "SIRET" |
284 | +msgstr "" |
285 | + |
286 | +#. module: l10n_fr_siret |
287 | +#: model:ir.model,name:l10n_fr_siret.model_res_partner |
288 | +msgid "Partner" |
289 | +msgstr "" |
290 | + |
291 | |
292 | === added file 'l10n_fr_siret/partner.py' |
293 | --- l10n_fr_siret/partner.py 1970-01-01 00:00:00 +0000 |
294 | +++ l10n_fr_siret/partner.py 2014-03-09 20:16:20 +0000 |
295 | @@ -0,0 +1,98 @@ |
296 | +# -*- encoding: utf-8 -*- |
297 | +############################################################################## |
298 | +# |
299 | +# OpenERP, Open Source Management Solution |
300 | +# Copyright (C) 2011 Numérigraphe SARL. |
301 | +# |
302 | +# This program is free software: you can redistribute it and/or modify |
303 | +# it under the terms of the GNU Affero General Public License as |
304 | +# published by the Free Software Foundation, either version 3 of the |
305 | +# License, or (at your option) any later version. |
306 | +# |
307 | +# This program is distributed in the hope that it will be useful, |
308 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
309 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
310 | +# GNU Affero General Public License for more details. |
311 | +# |
312 | +# You should have received a copy of the GNU Affero General Public License |
313 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
314 | +# |
315 | +############################################################################## |
316 | + |
317 | +from openerp.osv import fields, orm |
318 | + |
319 | + |
320 | +# XXX: this is used for checking various codes such as credit card numbers: should it be moved to tools.py? |
321 | +def _check_luhn(string): |
322 | + """Luhn test to check control keys |
323 | + |
324 | + Credits: http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#Python |
325 | + """ |
326 | + r = [int(ch) for ch in string][::-1] |
327 | + return (sum(r[0::2]) + sum(sum(divmod(d*2,10)) for d in r[1::2])) % 10 == 0 |
328 | + |
329 | +class Partner(orm.Model): |
330 | + """Add the French official company identity numbers SIREN, NIC and SIRET""" |
331 | + _inherit = 'res.partner' |
332 | + |
333 | + def _get_siret(self, cr, uid, ids, field_name, arg, context=None): |
334 | + """Concatenate the SIREN and NIC to form the SIRET""" |
335 | + sirets = {} |
336 | + for partner in self.browse(cr, uid, ids, context=context): |
337 | + if partner.siren and partner.nic: |
338 | + sirets[partner.id] = '%s%s' % (partner.siren, partner.nic) |
339 | + else: |
340 | + sirets[partner.id] = '' |
341 | + return sirets |
342 | + |
343 | + def _check_siret(self, cr, uid, ids): |
344 | + """Check the SIREN's and NIC's keys (last digits)""" |
345 | + for partner in self.browse(cr, uid, ids, context=None): |
346 | + if partner.nic: |
347 | + # Check the NIC type and length |
348 | + if not partner.nic.isdecimal() or len(partner.nic)!=5: |
349 | + return False |
350 | + if partner.siren: |
351 | + # Check the SIREN type, length and key |
352 | + if (not partner.siren.isdecimal() |
353 | + or len(partner.siren)!=9 |
354 | + or not _check_luhn(partner.siren) ): |
355 | + return False |
356 | + # Check the NIC key (you need both SIREN and NIC to check it) |
357 | + if partner.nic and not _check_luhn(partner.siren + partner.nic): |
358 | + return False |
359 | + return True |
360 | + |
361 | + _columns = { |
362 | + 'siren': fields.char('SIREN', size=9, |
363 | + help="The SIREN number is the official identity " |
364 | + "number of the company in France. It makes " |
365 | + "the first 9 digits of the SIRET number."), |
366 | + 'nic': fields.char('NIC', size=5, |
367 | + help="The NIC number is the official rank number " |
368 | + "of this office in the company in France. It " |
369 | + "makes the last 5 digits of the SIRET " |
370 | + "number."), |
371 | + 'siret': fields.function(_get_siret, type="char", string='SIRET', |
372 | + method=True, size=14, |
373 | + store = { |
374 | + 'res.partner': [lambda self, cr, uid, ids, context=None: ids, |
375 | + ['siren', 'nic'], |
376 | + 10]}, |
377 | + help="The SIRET number is the official identity number of this " |
378 | + "company's office in France. It is composed of the 9 digits " |
379 | + "of the SIREN number and the 5 digits of the NIC number, ie. " |
380 | + "14 digits."), |
381 | + 'company_registry': fields.char('Company Registry', size=64, |
382 | + help="The name of official registry where this " |
383 | + "company was declared."), |
384 | + } |
385 | + |
386 | + _constraints = [ |
387 | + (_check_siret, |
388 | + "The SIREN or NIC number is incorrect.", |
389 | + ["siren", "nic"]), |
390 | + ] |
391 | + |
392 | + |
393 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
394 | |
395 | === added file 'l10n_fr_siret/partner_view.xml' |
396 | --- l10n_fr_siret/partner_view.xml 1970-01-01 00:00:00 +0000 |
397 | +++ l10n_fr_siret/partner_view.xml 2014-03-09 20:16:20 +0000 |
398 | @@ -0,0 +1,25 @@ |
399 | +<?xml version="1.0" encoding="utf-8"?> |
400 | +<openerp> |
401 | + <data> |
402 | + <!-- Add the SIREN, NIC and SIRET numbers --> |
403 | + <record model="ir.ui.view" id="view_partner_add"> |
404 | + <field name="name">res.partner.form.siret</field> |
405 | + <field name="model">res.partner</field> |
406 | + <field name="inherit_id" ref="account.view_partner_property_form" /> |
407 | + <field name="arch" type="xml"> |
408 | + <page string="Accounting" position="inside"> |
409 | + <group> |
410 | + <group> |
411 | + <field name="siren" /> |
412 | + <field name="nic" /> |
413 | + <field name="siret" /> |
414 | + </group> |
415 | + <group> |
416 | + <field name="company_registry" /> |
417 | + </group> |
418 | + </group> |
419 | + </page> |
420 | + </field> |
421 | + </record> |
422 | + </data> |
423 | +</openerp> |
424 | |
425 | === modified file 'product/product.py' |
426 | --- product/product.py 2014-01-27 10:19:57 +0000 |
427 | +++ product/product.py 2014-03-09 20:16:20 +0000 |
428 | @@ -358,14 +358,25 @@ |
429 | _columns = { |
430 | 'name': fields.char('Name', required=True, translate=True, select=True), |
431 | 'product_manager': fields.many2one('res.users','Product Manager'), |
432 | - 'description': fields.text('Description',translate=True, |
433 | - help="A precise description of the Product, used only for internal information purposes."), |
434 | - 'description_purchase': fields.text('Purchase Description',translate=True, |
435 | - help="A description of the Product that you want to communicate to your suppliers. " |
436 | - "This description will be copied to every Purchase Order, Reception and Supplier Invoice/Refund."), |
437 | - 'description_sale': fields.text('Sale Description',translate=True, |
438 | - help="A description of the Product that you want to communicate to your customers. " |
439 | - "This description will be copied to every Sale Order, Delivery Order and Customer Invoice/Refund"), |
440 | +<<<<<<< TREE |
441 | + 'description': fields.text('Description',translate=True, |
442 | + help="A precise description of the Product, used only for internal information purposes."), |
443 | + 'description_purchase': fields.text('Purchase Description',translate=True, |
444 | + help="A description of the Product that you want to communicate to your suppliers. " |
445 | + "This description will be copied to every Purchase Order, Reception and Supplier Invoice/Refund."), |
446 | + 'description_sale': fields.text('Sale Description',translate=True, |
447 | + help="A description of the Product that you want to communicate to your customers. " |
448 | + "This description will be copied to every Sale Order, Delivery Order and Customer Invoice/Refund"), |
449 | +======= |
450 | + 'description': fields.text('Description',translate=True, |
451 | + help="A precise description of the Product, used only for internal information purposes."), |
452 | + 'description_purchase': fields.text('Purchase Description',translate=True, |
453 | + help="A description of the Product that you want to communicate to your customers. " |
454 | + "This description will be copied to every Sale Order, Delivery Order and Customer Invoice/Refund"), |
455 | + 'description_sale': fields.text('Sale Description',translate=True, |
456 | + help="A description of the Product that you want to communicate to your suppliers. " |
457 | + "This description will be copied to every Purchase Order, Reception and Supplier Invoice/Refund."), |
458 | +>>>>>>> MERGE-SOURCE |
459 | 'type': fields.selection([('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual."), |
460 | 'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."), |
461 | 'rental': fields.boolean('Can be Rent'), |
462 | |
463 | === modified file 'stock/stock.py' |
464 | --- stock/stock.py 2014-01-29 18:47:03 +0000 |
465 | +++ stock/stock.py 2014-03-09 20:16:20 +0000 |
466 | @@ -722,8 +722,9 @@ |
467 | if ('name' not in default) or (picking_obj.name == '/'): |
468 | seq_obj_name = 'stock.picking.' + picking_obj.type |
469 | default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) |
470 | + default['backorder_id'] = False |
471 | + if 'origin' not in default: |
472 | default['origin'] = '' |
473 | - default['backorder_id'] = False |
474 | if 'invoice_state' not in default and picking_obj.invoice_state == 'invoiced': |
475 | default['invoice_state'] = '2binvoiced' |
476 | res = super(stock_picking, self).copy(cr, uid, id, default, context) |
Aurélien D. emailed me in private to warn that the length of the SIREN and NIC numbers was not checked. Now They are.