Merge lp:~savoirfairelinux-openerp/openerp-canada/openerp-canada_res_partner_attributes_add_NEQ into lp:openerp-canada
- openerp-canada_res_partner_attributes_add_NEQ
- Merge into 7.0
Proposed by
Marc Cassuto (SFL)
Status: | Superseded |
---|---|
Proposed branch: | lp:~savoirfairelinux-openerp/openerp-canada/openerp-canada_res_partner_attributes_add_NEQ |
Merge into: | lp:openerp-canada |
Diff against target: |
624 lines (+530/-0) 17 files modified
res_partner_attributes_add_BN/__init__.py (+25/-0) res_partner_attributes_add_BN/__openerp__.py (+39/-0) res_partner_attributes_add_BN/i18n/fr.po (+32/-0) res_partner_attributes_add_BN/i18n/res_partner_attributes_add_BN.pot (+32/-0) res_partner_attributes_add_BN/res_partner_attributes_add_BN.py (+35/-0) res_partner_attributes_add_BN/res_partner_attributes_add_BN_view.xml (+16/-0) res_partner_attributes_add_NEQ/__init__.py (+25/-0) res_partner_attributes_add_NEQ/__openerp__.py (+39/-0) res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.pot (+32/-0) res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ.py (+33/-0) res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ_view.xml (+15/-0) res_partner_attributes_add_SIN/__init__.py (+25/-0) res_partner_attributes_add_SIN/__openerp__.py (+39/-0) res_partner_attributes_add_SIN/i18n/fr.po (+32/-0) res_partner_attributes_add_SIN/i18n/res_partner_attributes_add_SIN.pot (+32/-0) res_partner_attributes_add_SIN/res_partner_attributes_add_SIN.py (+64/-0) res_partner_attributes_add_SIN/res_partner_attributes_add_SIN_view.xml (+15/-0) |
To merge this branch: | bzr merge lp:~savoirfairelinux-openerp/openerp-canada/openerp-canada_res_partner_attributes_add_NEQ |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Maxime Chambreuil (http://www.savoirfairelinux.com) | Needs Fixing | ||
Joao Alfredo Gama Batista | code review. no test | Approve | |
Review via email: mp+174487@code.launchpad.net |
This proposal has been superseded by a proposal from 2013-07-19.
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) : | # |
review:
Approve
(code review, no test)
Revision history for this message
Joao Alfredo Gama Batista (joao-gama) wrote : | # |
review:
Approve
(code review. no test)
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote : | # |
@joao
I am sure you want to implement it :)
review:
Needs Fixing
- 20. By Joao Alfredo Gama Batista
-
[IMP] Added SIN number validation and changed the module name to use the english acronym
- 21. By Joao Alfredo Gama Batista
-
[IMP] Use the english acronym
- 22. By Joao Alfredo Gama Batista
-
[FIX] Remove old module names traces
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'res_partner_attributes_add_BN' | |||
2 | === added file 'res_partner_attributes_add_BN/__init__.py' | |||
3 | --- res_partner_attributes_add_BN/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ res_partner_attributes_add_BN/__init__.py 2013-07-19 18:44:28 +0000 | |||
5 | @@ -0,0 +1,25 @@ | |||
6 | 1 | # -*- encoding: utf-8 -*- | ||
7 | 2 | ############################################################################## | ||
8 | 3 | # | ||
9 | 4 | # OpenERP, Open Source Management Solution | ||
10 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
11 | 6 | # | ||
12 | 7 | # This program is free software: you can redistribute it and/or modify | ||
13 | 8 | # it under the terms of the GNU Affero General Public License as | ||
14 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
15 | 10 | # License, or (at your option) any later version. | ||
16 | 11 | # | ||
17 | 12 | # This program is distributed in the hope that it will be useful, | ||
18 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | 15 | # GNU Affero General Public License for more details. | ||
21 | 16 | # | ||
22 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
23 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
24 | 19 | # | ||
25 | 20 | ############################################################################## | ||
26 | 21 | |||
27 | 22 | import res_partner_attributes_add_BN | ||
28 | 23 | |||
29 | 24 | |||
30 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
31 | 0 | 26 | ||
32 | === added file 'res_partner_attributes_add_BN/__openerp__.py' | |||
33 | --- res_partner_attributes_add_BN/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
34 | +++ res_partner_attributes_add_BN/__openerp__.py 2013-07-19 18:44:28 +0000 | |||
35 | @@ -0,0 +1,39 @@ | |||
36 | 1 | # -*- encoding: utf-8 -*- | ||
37 | 2 | ############################################################################## | ||
38 | 3 | # | ||
39 | 4 | # OpenERP, Open Source Management Solution | ||
40 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
41 | 6 | # | ||
42 | 7 | # This program is free software: you can redistribute it and/or modify | ||
43 | 8 | # it under the terms of the GNU Affero General Public License as | ||
44 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
45 | 10 | # License, or (at your option) any later version. | ||
46 | 11 | # | ||
47 | 12 | # This program is distributed in the hope that it will be useful, | ||
48 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
49 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
50 | 15 | # GNU Affero General Public License for more details. | ||
51 | 16 | # | ||
52 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
53 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
54 | 19 | # | ||
55 | 20 | ############################################################################## | ||
56 | 21 | |||
57 | 22 | { | ||
58 | 23 | 'name' : 'Business identification Number in Canada (BN/NE)', | ||
59 | 24 | 'version' : '1.0', | ||
60 | 25 | "author" : "Savoir-faire Linux (mcassuto@savoirfairelinux.com)", | ||
61 | 26 | "website" : "http://www.savoirfairelinux.com", | ||
62 | 27 | 'license': 'AGPL-3', | ||
63 | 28 | 'category' : 'Localisation/Canada', | ||
64 | 29 | 'depends' : ['base'], | ||
65 | 30 | 'description': """ | ||
66 | 31 | Add the Business identification Number (BN/NE) to the partner form. | ||
67 | 32 | """, | ||
68 | 33 | 'auto_install': False, | ||
69 | 34 | 'installable': True, | ||
70 | 35 | 'data' : ['res_partner_attributes_add_BN_view.xml'] | ||
71 | 36 | } | ||
72 | 37 | |||
73 | 38 | |||
74 | 39 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
75 | 0 | 40 | ||
76 | === added directory 'res_partner_attributes_add_BN/i18n' | |||
77 | === added file 'res_partner_attributes_add_BN/i18n/fr.po' | |||
78 | --- res_partner_attributes_add_BN/i18n/fr.po 1970-01-01 00:00:00 +0000 | |||
79 | +++ res_partner_attributes_add_BN/i18n/fr.po 2013-07-19 18:44:28 +0000 | |||
80 | @@ -0,0 +1,32 @@ | |||
81 | 1 | # Translation of OpenERP Server. | ||
82 | 2 | # This file contains the translation of the following modules: | ||
83 | 3 | # * res_partner_attributes_add_BN | ||
84 | 4 | # | ||
85 | 5 | msgid "" | ||
86 | 6 | msgstr "" | ||
87 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
88 | 8 | "Report-Msgid-Bugs-To: \n" | ||
89 | 9 | "POT-Creation-Date: 2013-07-19 18:29+0000\n" | ||
90 | 10 | "PO-Revision-Date: 2013-07-19 14:32-0400\n" | ||
91 | 11 | "Last-Translator: <>\n" | ||
92 | 12 | "Language-Team: \n" | ||
93 | 13 | "MIME-Version: 1.0\n" | ||
94 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
95 | 15 | "Content-Transfer-Encoding: \n" | ||
96 | 16 | "Plural-Forms: \n" | ||
97 | 17 | |||
98 | 18 | #. module: res_partner_attributes_add_BN | ||
99 | 19 | #: model:ir.model,name:res_partner_attributes_add_BN.model_res_partner | ||
100 | 20 | msgid "Partner" | ||
101 | 21 | msgstr "Partenaire" | ||
102 | 22 | |||
103 | 23 | #. module: res_partner_attributes_add_BN | ||
104 | 24 | #: field:res.partner,ne:0 | ||
105 | 25 | msgid "BN" | ||
106 | 26 | msgstr "NE" | ||
107 | 27 | |||
108 | 28 | #. module: res_partner_attributes_add_BN | ||
109 | 29 | #: help:res.partner,ne:0 | ||
110 | 30 | msgid "Canada Business identification Number (9 digits)" | ||
111 | 31 | msgstr "Numéro d'Entreprise du Canada (9 chiffres)" | ||
112 | 32 | |||
113 | 0 | 33 | ||
114 | === added file 'res_partner_attributes_add_BN/i18n/res_partner_attributes_add_BN.pot' | |||
115 | --- res_partner_attributes_add_BN/i18n/res_partner_attributes_add_BN.pot 1970-01-01 00:00:00 +0000 | |||
116 | +++ res_partner_attributes_add_BN/i18n/res_partner_attributes_add_BN.pot 2013-07-19 18:44:28 +0000 | |||
117 | @@ -0,0 +1,32 @@ | |||
118 | 1 | # Translation of OpenERP Server. | ||
119 | 2 | # This file contains the translation of the following modules: | ||
120 | 3 | # * res_partner_attributes_add_NE | ||
121 | 4 | # | ||
122 | 5 | msgid "" | ||
123 | 6 | msgstr "" | ||
124 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
125 | 8 | "Report-Msgid-Bugs-To: \n" | ||
126 | 9 | "POT-Creation-Date: 2013-07-11 14:53+0000\n" | ||
127 | 10 | "PO-Revision-Date: 2013-07-11 14:53+0000\n" | ||
128 | 11 | "Last-Translator: <>\n" | ||
129 | 12 | "Language-Team: \n" | ||
130 | 13 | "MIME-Version: 1.0\n" | ||
131 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
132 | 15 | "Content-Transfer-Encoding: \n" | ||
133 | 16 | "Plural-Forms: \n" | ||
134 | 17 | |||
135 | 18 | #. module: res_partner_attributes_add_NE | ||
136 | 19 | #: model:ir.model,name:res_partner_attributes_add_NE.model_res_partner | ||
137 | 20 | msgid "Partner" | ||
138 | 21 | msgstr "" | ||
139 | 22 | |||
140 | 23 | #. module: res_partner_attributes_add_NE | ||
141 | 24 | #: help:res.partner,ne:0 | ||
142 | 25 | msgid "Canada Business identification Number (9 digits)" | ||
143 | 26 | msgstr "" | ||
144 | 27 | |||
145 | 28 | #. module: res_partner_attributes_add_NE | ||
146 | 29 | #: field:res.partner,ne:0 | ||
147 | 30 | msgid "NE" | ||
148 | 31 | msgstr "" | ||
149 | 32 | |||
150 | 0 | 33 | ||
151 | === added file 'res_partner_attributes_add_BN/res_partner_attributes_add_BN.py' | |||
152 | --- res_partner_attributes_add_BN/res_partner_attributes_add_BN.py 1970-01-01 00:00:00 +0000 | |||
153 | +++ res_partner_attributes_add_BN/res_partner_attributes_add_BN.py 2013-07-19 18:44:28 +0000 | |||
154 | @@ -0,0 +1,35 @@ | |||
155 | 1 | # -*- encoding: utf-8 -*- | ||
156 | 2 | ############################################################################## | ||
157 | 3 | # | ||
158 | 4 | # OpenERP, Open Source Management Solution | ||
159 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
160 | 6 | # | ||
161 | 7 | # This program is free software: you can redistribute it and/or modify | ||
162 | 8 | # it under the terms of the GNU Affero General Public License as | ||
163 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
164 | 10 | # License, or (at your option) any later version. | ||
165 | 11 | # | ||
166 | 12 | # This program is distributed in the hope that it will be useful, | ||
167 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
168 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
169 | 15 | # GNU Affero General Public License for more details. | ||
170 | 16 | # | ||
171 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
172 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
173 | 19 | # | ||
174 | 20 | ############################################################################## | ||
175 | 21 | |||
176 | 22 | from openerp.osv import fields, orm | ||
177 | 23 | from openerp.tools.translate import _ | ||
178 | 24 | |||
179 | 25 | |||
180 | 26 | class res_partner(orm.Model): | ||
181 | 27 | _name = 'res.partner' | ||
182 | 28 | _inherit = 'res.partner' | ||
183 | 29 | _columns = { | ||
184 | 30 | 'ne': fields.float('BN', digits=(9, 0), | ||
185 | 31 | help="Canada Business identification Number (9 digits)"), | ||
186 | 32 | } | ||
187 | 33 | |||
188 | 34 | |||
189 | 35 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
190 | 0 | 36 | ||
191 | === added file 'res_partner_attributes_add_BN/res_partner_attributes_add_BN_view.xml' | |||
192 | --- res_partner_attributes_add_BN/res_partner_attributes_add_BN_view.xml 1970-01-01 00:00:00 +0000 | |||
193 | +++ res_partner_attributes_add_BN/res_partner_attributes_add_BN_view.xml 2013-07-19 18:44:28 +0000 | |||
194 | @@ -0,0 +1,16 @@ | |||
195 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
196 | 2 | <openerp> | ||
197 | 3 | <data> | ||
198 | 4 | <record model="ir.ui.view" id="res_partner_attributes_add_NE_form_view"> | ||
199 | 5 | <field name="name">res_partner_attributes_add_NE</field> | ||
200 | 6 | <field name="model">res.partner</field> | ||
201 | 7 | <field name="inherit_id" ref="base.view_partner_form"/> | ||
202 | 8 | <field name="arch" type="xml"> | ||
203 | 9 | <field name="email" position="after"> | ||
204 | 10 | <field name="ne" attrs="{'invisible': [('is_company','=', False)]}"/> | ||
205 | 11 | </field> | ||
206 | 12 | </field> | ||
207 | 13 | </record> | ||
208 | 14 | |||
209 | 15 | </data> | ||
210 | 16 | </openerp> | ||
211 | 0 | 17 | ||
212 | === added directory 'res_partner_attributes_add_NEQ' | |||
213 | === added file 'res_partner_attributes_add_NEQ/__init__.py' | |||
214 | --- res_partner_attributes_add_NEQ/__init__.py 1970-01-01 00:00:00 +0000 | |||
215 | +++ res_partner_attributes_add_NEQ/__init__.py 2013-07-19 18:44:28 +0000 | |||
216 | @@ -0,0 +1,25 @@ | |||
217 | 1 | # -*- encoding: utf-8 -*- | ||
218 | 2 | ############################################################################## | ||
219 | 3 | # | ||
220 | 4 | # OpenERP, Open Source Management Solution | ||
221 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
222 | 6 | # | ||
223 | 7 | # This program is free software: you can redistribute it and/or modify | ||
224 | 8 | # it under the terms of the GNU Affero General Public License as | ||
225 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
226 | 10 | # License, or (at your option) any later version. | ||
227 | 11 | # | ||
228 | 12 | # This program is distributed in the hope that it will be useful, | ||
229 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
230 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
231 | 15 | # GNU Affero General Public License for more details. | ||
232 | 16 | # | ||
233 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
234 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
235 | 19 | # | ||
236 | 20 | ############################################################################## | ||
237 | 21 | |||
238 | 22 | import res_partner_attributes_add_NEQ | ||
239 | 23 | |||
240 | 24 | |||
241 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
242 | 0 | 26 | ||
243 | === added file 'res_partner_attributes_add_NEQ/__openerp__.py' | |||
244 | --- res_partner_attributes_add_NEQ/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
245 | +++ res_partner_attributes_add_NEQ/__openerp__.py 2013-07-19 18:44:28 +0000 | |||
246 | @@ -0,0 +1,39 @@ | |||
247 | 1 | # -*- encoding: utf-8 -*- | ||
248 | 2 | ############################################################################## | ||
249 | 3 | # | ||
250 | 4 | # OpenERP, Open Source Management Solution | ||
251 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
252 | 6 | # | ||
253 | 7 | # This program is free software: you can redistribute it and/or modify | ||
254 | 8 | # it under the terms of the GNU Affero General Public License as | ||
255 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
256 | 10 | # License, or (at your option) any later version. | ||
257 | 11 | # | ||
258 | 12 | # This program is distributed in the hope that it will be useful, | ||
259 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
260 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
261 | 15 | # GNU Affero General Public License for more details. | ||
262 | 16 | # | ||
263 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
264 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
265 | 19 | # | ||
266 | 20 | ############################################################################## | ||
267 | 21 | |||
268 | 22 | { | ||
269 | 23 | 'name' : 'Quebec Enterprise Number (NEQ)', | ||
270 | 24 | 'version' : '1.1', | ||
271 | 25 | "author" : "Savoir-faire Linux (mcassuto@savoirfairelinux.com)", | ||
272 | 26 | "website" : "http://www.savoirfairelinux.com", | ||
273 | 27 | 'license': 'AGPL-3', | ||
274 | 28 | 'category' : 'Localisation/Canada', | ||
275 | 29 | 'depends' : ['base'], | ||
276 | 30 | 'description': """ | ||
277 | 31 | Add the Quebec Enterprise Number (NEQ) to the partner form. | ||
278 | 32 | """, | ||
279 | 33 | 'auto_install': False, | ||
280 | 34 | 'installable': True, | ||
281 | 35 | 'data' : ['res_partner_attributes_add_NEQ_view.xml'] | ||
282 | 36 | } | ||
283 | 37 | |||
284 | 38 | |||
285 | 39 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
286 | 0 | 40 | ||
287 | === added directory 'res_partner_attributes_add_NEQ/i18n' | |||
288 | === added file 'res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.mo' | |||
289 | 1 | Binary files res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.mo 1970-01-01 00:00:00 +0000 and res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.mo 2013-07-19 18:44:28 +0000 differ | 41 | Binary files res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.mo 1970-01-01 00:00:00 +0000 and res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.mo 2013-07-19 18:44:28 +0000 differ |
290 | === added file 'res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.pot' | |||
291 | --- res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.pot 1970-01-01 00:00:00 +0000 | |||
292 | +++ res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.pot 2013-07-19 18:44:28 +0000 | |||
293 | @@ -0,0 +1,32 @@ | |||
294 | 1 | # Translation of OpenERP Server. | ||
295 | 2 | # This file contains the translation of the following modules: | ||
296 | 3 | # * res_partner_attributes_add_NEQ | ||
297 | 4 | # | ||
298 | 5 | msgid "" | ||
299 | 6 | msgstr "" | ||
300 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
301 | 8 | "Report-Msgid-Bugs-To: \n" | ||
302 | 9 | "POT-Creation-Date: 2013-07-11 14:53+0000\n" | ||
303 | 10 | "PO-Revision-Date: 2013-07-11 10:58-0500\n" | ||
304 | 11 | "Last-Translator: Marc Cassuto <marc.cassuto@savoirfairelinux.com>\n" | ||
305 | 12 | "Language-Team: \n" | ||
306 | 13 | "MIME-Version: 1.0\n" | ||
307 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
308 | 15 | "Content-Transfer-Encoding: 8bit\n" | ||
309 | 16 | "Plural-Forms: \n" | ||
310 | 17 | |||
311 | 18 | #. module: res_partner_attributes_add_NEQ | ||
312 | 19 | #: model:ir.model,name:res_partner_attributes_add_NEQ.model_res_partner | ||
313 | 20 | msgid "Partner" | ||
314 | 21 | msgstr "Partenaire" | ||
315 | 22 | |||
316 | 23 | #. module: res_partner_attributes_add_NEQ | ||
317 | 24 | #: help:res.partner,neq:0 | ||
318 | 25 | msgid "Quebec Enterprise Number (10 digits)" | ||
319 | 26 | msgstr "Numéro d'Entreprise du Quebec (10 chiffres)" | ||
320 | 27 | |||
321 | 28 | #. module: res_partner_attributes_add_NEQ | ||
322 | 29 | #: field:res.partner,neq:0 | ||
323 | 30 | msgid "NEQ" | ||
324 | 31 | msgstr "NEQ" | ||
325 | 32 | |||
326 | 0 | 33 | ||
327 | === added file 'res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ.py' | |||
328 | --- res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ.py 1970-01-01 00:00:00 +0000 | |||
329 | +++ res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ.py 2013-07-19 18:44:28 +0000 | |||
330 | @@ -0,0 +1,33 @@ | |||
331 | 1 | # -*- encoding: utf-8 -*- | ||
332 | 2 | ############################################################################## | ||
333 | 3 | # | ||
334 | 4 | # OpenERP, Open Source Management Solution | ||
335 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
336 | 6 | # | ||
337 | 7 | # This program is free software: you can redistribute it and/or modify | ||
338 | 8 | # it under the terms of the GNU Affero General Public License as | ||
339 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
340 | 10 | # License, or (at your option) any later version. | ||
341 | 11 | # | ||
342 | 12 | # This program is distributed in the hope that it will be useful, | ||
343 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
344 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
345 | 15 | # GNU Affero General Public License for more details. | ||
346 | 16 | # | ||
347 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
348 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
349 | 19 | # | ||
350 | 20 | ############################################################################## | ||
351 | 21 | |||
352 | 22 | from openerp.osv import fields, orm | ||
353 | 23 | from openerp.tools.translate import _ | ||
354 | 24 | |||
355 | 25 | class res_partner(orm.Model): | ||
356 | 26 | _name = 'res.partner' | ||
357 | 27 | _inherit = 'res.partner' | ||
358 | 28 | _columns = { | ||
359 | 29 | 'neq': fields.float('NEQ', digits=(10,0), help="Quebec Enterprise Number (10 digits)"), | ||
360 | 30 | } | ||
361 | 31 | |||
362 | 32 | |||
363 | 33 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
364 | 0 | 34 | ||
365 | === added file 'res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ_view.xml' | |||
366 | --- res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ_view.xml 1970-01-01 00:00:00 +0000 | |||
367 | +++ res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ_view.xml 2013-07-19 18:44:28 +0000 | |||
368 | @@ -0,0 +1,15 @@ | |||
369 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
370 | 2 | <openerp> | ||
371 | 3 | <data> | ||
372 | 4 | <record model="ir.ui.view" id="res_partner_attributes_add_NEQ_form_view"> | ||
373 | 5 | <field name="name">res_partner_attributes_add_NEQ</field> | ||
374 | 6 | <field name="model">res.partner</field> | ||
375 | 7 | <field name="inherit_id" ref="base.view_partner_form"/> | ||
376 | 8 | <field name="arch" type="xml"> | ||
377 | 9 | <field name="website" position="after"> | ||
378 | 10 | <field name="neq" attrs="{'invisible': [('is_company','=', False)]}"/> | ||
379 | 11 | </field> | ||
380 | 12 | </field> | ||
381 | 13 | </record> | ||
382 | 14 | </data> | ||
383 | 15 | </openerp> | ||
384 | 0 | 16 | ||
385 | === added directory 'res_partner_attributes_add_SIN' | |||
386 | === added file 'res_partner_attributes_add_SIN/__init__.py' | |||
387 | --- res_partner_attributes_add_SIN/__init__.py 1970-01-01 00:00:00 +0000 | |||
388 | +++ res_partner_attributes_add_SIN/__init__.py 2013-07-19 18:44:28 +0000 | |||
389 | @@ -0,0 +1,25 @@ | |||
390 | 1 | # -*- encoding: utf-8 -*- | ||
391 | 2 | ############################################################################## | ||
392 | 3 | # | ||
393 | 4 | # OpenERP, Open Source Management Solution | ||
394 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
395 | 6 | # | ||
396 | 7 | # This program is free software: you can redistribute it and/or modify | ||
397 | 8 | # it under the terms of the GNU Affero General Public License as | ||
398 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
399 | 10 | # License, or (at your option) any later version. | ||
400 | 11 | # | ||
401 | 12 | # This program is distributed in the hope that it will be useful, | ||
402 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
403 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
404 | 15 | # GNU Affero General Public License for more details. | ||
405 | 16 | # | ||
406 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
407 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
408 | 19 | # | ||
409 | 20 | ############################################################################## | ||
410 | 21 | |||
411 | 22 | import res_partner_attributes_add_SIN | ||
412 | 23 | |||
413 | 24 | |||
414 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
415 | 0 | 26 | ||
416 | === added file 'res_partner_attributes_add_SIN/__openerp__.py' | |||
417 | --- res_partner_attributes_add_SIN/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
418 | +++ res_partner_attributes_add_SIN/__openerp__.py 2013-07-19 18:44:28 +0000 | |||
419 | @@ -0,0 +1,39 @@ | |||
420 | 1 | # -*- coding: utf-8 -*- | ||
421 | 2 | ############################################################################## | ||
422 | 3 | # | ||
423 | 4 | # OpenERP, Open Source Management Solution | ||
424 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
425 | 6 | # | ||
426 | 7 | # This program is free software: you can redistribute it and/or modify | ||
427 | 8 | # it under the terms of the GNU Affero General Public License as | ||
428 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
429 | 10 | # License, or (at your option) any later version. | ||
430 | 11 | # | ||
431 | 12 | # This program is distributed in the hope that it will be useful, | ||
432 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
433 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
434 | 15 | # GNU Affero General Public License for more details. | ||
435 | 16 | # | ||
436 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
437 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
438 | 19 | # | ||
439 | 20 | ############################################################################## | ||
440 | 21 | |||
441 | 22 | { | ||
442 | 23 | 'name' : 'Canada Social Insurance Number (SIN/NAS)', | ||
443 | 24 | 'version' : '1.0', | ||
444 | 25 | "author" : "Savoir-faire Linux (mcassuto@savoirfairelinux.com)", | ||
445 | 26 | "website" : "http://www.savoirfairelinux.com", | ||
446 | 27 | 'license': 'AGPL-3', | ||
447 | 28 | 'category' : 'Localisation/Canada', | ||
448 | 29 | 'depends' : ['base'], | ||
449 | 30 | 'description': """ | ||
450 | 31 | Add the Social Insurance Number (SIN/NAS) to the partner form. | ||
451 | 32 | """, | ||
452 | 33 | 'auto_install': False, | ||
453 | 34 | 'installable': True, | ||
454 | 35 | 'data' : ['res_partner_attributes_add_SIN_view.xml'] | ||
455 | 36 | } | ||
456 | 37 | |||
457 | 38 | |||
458 | 39 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
459 | 0 | 40 | ||
460 | === added directory 'res_partner_attributes_add_SIN/i18n' | |||
461 | === added file 'res_partner_attributes_add_SIN/i18n/fr.mo' | |||
462 | 1 | Binary files res_partner_attributes_add_SIN/i18n/fr.mo 1970-01-01 00:00:00 +0000 and res_partner_attributes_add_SIN/i18n/fr.mo 2013-07-19 18:44:28 +0000 differ | 41 | Binary files res_partner_attributes_add_SIN/i18n/fr.mo 1970-01-01 00:00:00 +0000 and res_partner_attributes_add_SIN/i18n/fr.mo 2013-07-19 18:44:28 +0000 differ |
463 | === added file 'res_partner_attributes_add_SIN/i18n/fr.po' | |||
464 | --- res_partner_attributes_add_SIN/i18n/fr.po 1970-01-01 00:00:00 +0000 | |||
465 | +++ res_partner_attributes_add_SIN/i18n/fr.po 2013-07-19 18:44:28 +0000 | |||
466 | @@ -0,0 +1,32 @@ | |||
467 | 1 | # Translation of OpenERP Server. | ||
468 | 2 | # This file contains the translation of the following modules: | ||
469 | 3 | # * res_partner_attributes_add_NAS | ||
470 | 4 | # | ||
471 | 5 | msgid "" | ||
472 | 6 | msgstr "" | ||
473 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
474 | 8 | "Report-Msgid-Bugs-To: \n" | ||
475 | 9 | "POT-Creation-Date: 2013-07-19 16:41+0000\n" | ||
476 | 10 | "PO-Revision-Date: 2013-07-19 13:14-0400\n" | ||
477 | 11 | "Last-Translator: <>\n" | ||
478 | 12 | "Language-Team: \n" | ||
479 | 13 | "MIME-Version: 1.0\n" | ||
480 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
481 | 15 | "Content-Transfer-Encoding: \n" | ||
482 | 16 | "Plural-Forms: \n" | ||
483 | 17 | |||
484 | 18 | #. module: res_partner_attributes_add_NAS | ||
485 | 19 | #: model:ir.model,name:res_partner_attributes_add_NAS.model_res_partner | ||
486 | 20 | msgid "Partner" | ||
487 | 21 | msgstr "Partenaire" | ||
488 | 22 | |||
489 | 23 | #. module: res_partner_attributes_add_NAS | ||
490 | 24 | #: help:res.partner,nas:0 | ||
491 | 25 | msgid "Social Insurance Number (9 digits)" | ||
492 | 26 | msgstr "Numéro d'Assurance Sociale (9 chiffres)" | ||
493 | 27 | |||
494 | 28 | #. module: res_partner_attributes_add_NAS | ||
495 | 29 | #: field:res.partner,nas:0 | ||
496 | 30 | msgid "SIN" | ||
497 | 31 | msgstr "NAS" | ||
498 | 32 | |||
499 | 0 | 33 | ||
500 | === added file 'res_partner_attributes_add_SIN/i18n/res_partner_attributes_add_SIN.pot' | |||
501 | --- res_partner_attributes_add_SIN/i18n/res_partner_attributes_add_SIN.pot 1970-01-01 00:00:00 +0000 | |||
502 | +++ res_partner_attributes_add_SIN/i18n/res_partner_attributes_add_SIN.pot 2013-07-19 18:44:28 +0000 | |||
503 | @@ -0,0 +1,32 @@ | |||
504 | 1 | # Translation of OpenERP Server. | ||
505 | 2 | # This file contains the translation of the following modules: | ||
506 | 3 | # * res_partner_attributes_add_NAS | ||
507 | 4 | # | ||
508 | 5 | msgid "" | ||
509 | 6 | msgstr "" | ||
510 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
511 | 8 | "Report-Msgid-Bugs-To: \n" | ||
512 | 9 | "POT-Creation-Date: 2013-07-11 14:53+0000\n" | ||
513 | 10 | "PO-Revision-Date: 2013-07-11 14:53+0000\n" | ||
514 | 11 | "Last-Translator: <>\n" | ||
515 | 12 | "Language-Team: \n" | ||
516 | 13 | "MIME-Version: 1.0\n" | ||
517 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
518 | 15 | "Content-Transfer-Encoding: \n" | ||
519 | 16 | "Plural-Forms: \n" | ||
520 | 17 | |||
521 | 18 | #. module: res_partner_attributes_add_NAS | ||
522 | 19 | #: field:res.partner,nas:0 | ||
523 | 20 | msgid "NAS" | ||
524 | 21 | msgstr "" | ||
525 | 22 | |||
526 | 23 | #. module: res_partner_attributes_add_NAS | ||
527 | 24 | #: help:res.partner,nas:0 | ||
528 | 25 | msgid "Social Insurance Number (9 digits)" | ||
529 | 26 | msgstr "" | ||
530 | 27 | |||
531 | 28 | #. module: res_partner_attributes_add_NAS | ||
532 | 29 | #: model:ir.model,name:res_partner_attributes_add_NAS.model_res_partner | ||
533 | 30 | msgid "Partner" | ||
534 | 31 | msgstr "" | ||
535 | 32 | |||
536 | 0 | 33 | ||
537 | === added file 'res_partner_attributes_add_SIN/res_partner_attributes_add_SIN.py' | |||
538 | --- res_partner_attributes_add_SIN/res_partner_attributes_add_SIN.py 1970-01-01 00:00:00 +0000 | |||
539 | +++ res_partner_attributes_add_SIN/res_partner_attributes_add_SIN.py 2013-07-19 18:44:28 +0000 | |||
540 | @@ -0,0 +1,64 @@ | |||
541 | 1 | # -*- coding: utf-8 -*- | ||
542 | 2 | ############################################################################## | ||
543 | 3 | # | ||
544 | 4 | # OpenERP, Open Source Management Solution | ||
545 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
546 | 6 | # | ||
547 | 7 | # This program is free software: you can redistribute it and/or modify | ||
548 | 8 | # it under the terms of the GNU Affero General Public License as | ||
549 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
550 | 10 | # License, or (at your option) any later version. | ||
551 | 11 | # | ||
552 | 12 | # This program is distributed in the hope that it will be useful, | ||
553 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
554 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
555 | 15 | # GNU Affero General Public License for more details. | ||
556 | 16 | # | ||
557 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
558 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
559 | 19 | # | ||
560 | 20 | ############################################################################## | ||
561 | 21 | |||
562 | 22 | from openerp.osv import fields, orm | ||
563 | 23 | from openerp.tools.translate import _ | ||
564 | 24 | |||
565 | 25 | |||
566 | 26 | class res_partner(orm.Model): | ||
567 | 27 | _name = 'res.partner' | ||
568 | 28 | _inherit = 'res.partner' | ||
569 | 29 | |||
570 | 30 | def onchange_nas(self, cr, uid, ids, nas): | ||
571 | 31 | ret = {'value': 0} | ||
572 | 32 | |||
573 | 33 | def digits_of(n): | ||
574 | 34 | return [int(d) for d in str(n)] | ||
575 | 35 | |||
576 | 36 | def luhn_checksum(nas): | ||
577 | 37 | digits = digits_of(nas) | ||
578 | 38 | odd_digits = digits[-1::-2] | ||
579 | 39 | even_digits = digits[-2::-2] | ||
580 | 40 | checksum = 0 | ||
581 | 41 | checksum += sum(odd_digits) | ||
582 | 42 | for d in even_digits: | ||
583 | 43 | checksum += sum(digits_of(d * 2)) | ||
584 | 44 | return checksum % 10 | ||
585 | 45 | |||
586 | 46 | def is_luhn_valid(nas): | ||
587 | 47 | return luhn_checksum(nas) == 0 | ||
588 | 48 | |||
589 | 49 | if is_luhn_valid(nas): | ||
590 | 50 | ret['value'] = nas | ||
591 | 51 | else: | ||
592 | 52 | ret['value'] = 0 | ||
593 | 53 | ret['warning'] = { | ||
594 | 54 | 'title': 'Error', | ||
595 | 55 | 'message': _('The number provided is not a valid SIN number !') | ||
596 | 56 | } | ||
597 | 57 | return ret | ||
598 | 58 | |||
599 | 59 | _columns = { | ||
600 | 60 | 'nas': fields.float('SIN', digits=(9, 0), | ||
601 | 61 | help="Social Insurance Number (9 digits)"), | ||
602 | 62 | } | ||
603 | 63 | |||
604 | 64 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
605 | 0 | 65 | ||
606 | === added file 'res_partner_attributes_add_SIN/res_partner_attributes_add_SIN_view.xml' | |||
607 | --- res_partner_attributes_add_SIN/res_partner_attributes_add_SIN_view.xml 1970-01-01 00:00:00 +0000 | |||
608 | +++ res_partner_attributes_add_SIN/res_partner_attributes_add_SIN_view.xml 2013-07-19 18:44:28 +0000 | |||
609 | @@ -0,0 +1,15 @@ | |||
610 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
611 | 2 | <openerp> | ||
612 | 3 | <data> | ||
613 | 4 | <record model="ir.ui.view" id="res_partner_attributes_add_NAS_form_view"> | ||
614 | 5 | <field name="name">res_partner_attributes_add_NAS</field> | ||
615 | 6 | <field name="model">res.partner</field> | ||
616 | 7 | <field name="inherit_id" ref="base.view_partner_form"/> | ||
617 | 8 | <field name="arch" type="xml"> | ||
618 | 9 | <field name="website" position="after"> | ||
619 | 10 | <field name="nas" on_change="onchange_nas(nas)" attrs="{'invisible': [('is_company','=', True)]}"/> | ||
620 | 11 | </field> | ||
621 | 12 | </field> | ||
622 | 13 | </record> | ||
623 | 14 | </data> | ||
624 | 15 | </openerp> |
A suggestion for future improvement:
http:// en.wikipedia. org/wiki/ Social_ Insurance_ Number# Validation