Merge lp:~savoirfairelinux-openerp/openerp-canada/openerp-canada_res_partner_attributes_add_NEQ into lp:openerp-canada

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
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.

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
=== added directory 'res_partner_attributes_add_BN'
=== added file 'res_partner_attributes_add_BN/__init__.py'
--- res_partner_attributes_add_BN/__init__.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_BN/__init__.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,25 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import res_partner_attributes_add_BN
23
24
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
026
=== added file 'res_partner_attributes_add_BN/__openerp__.py'
--- res_partner_attributes_add_BN/__openerp__.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_BN/__openerp__.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,39 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name' : 'Business identification Number in Canada (BN/NE)',
24 'version' : '1.0',
25 "author" : "Savoir-faire Linux (mcassuto@savoirfairelinux.com)",
26 "website" : "http://www.savoirfairelinux.com",
27 'license': 'AGPL-3',
28 'category' : 'Localisation/Canada',
29 'depends' : ['base'],
30 'description': """
31Add the Business identification Number (BN/NE) to the partner form.
32""",
33 'auto_install': False,
34 'installable': True,
35 'data' : ['res_partner_attributes_add_BN_view.xml']
36}
37
38
39# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
040
=== added directory 'res_partner_attributes_add_BN/i18n'
=== added file 'res_partner_attributes_add_BN/i18n/fr.po'
--- res_partner_attributes_add_BN/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_BN/i18n/fr.po 2013-07-19 18:44:28 +0000
@@ -0,0 +1,32 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * res_partner_attributes_add_BN
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-07-19 18:29+0000\n"
10"PO-Revision-Date: 2013-07-19 14:32-0400\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: res_partner_attributes_add_BN
19#: model:ir.model,name:res_partner_attributes_add_BN.model_res_partner
20msgid "Partner"
21msgstr "Partenaire"
22
23#. module: res_partner_attributes_add_BN
24#: field:res.partner,ne:0
25msgid "BN"
26msgstr "NE"
27
28#. module: res_partner_attributes_add_BN
29#: help:res.partner,ne:0
30msgid "Canada Business identification Number (9 digits)"
31msgstr "Numéro d'Entreprise du Canada (9 chiffres)"
32
033
=== added file 'res_partner_attributes_add_BN/i18n/res_partner_attributes_add_BN.pot'
--- res_partner_attributes_add_BN/i18n/res_partner_attributes_add_BN.pot 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_BN/i18n/res_partner_attributes_add_BN.pot 2013-07-19 18:44:28 +0000
@@ -0,0 +1,32 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * res_partner_attributes_add_NE
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-07-11 14:53+0000\n"
10"PO-Revision-Date: 2013-07-11 14:53+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: res_partner_attributes_add_NE
19#: model:ir.model,name:res_partner_attributes_add_NE.model_res_partner
20msgid "Partner"
21msgstr ""
22
23#. module: res_partner_attributes_add_NE
24#: help:res.partner,ne:0
25msgid "Canada Business identification Number (9 digits)"
26msgstr ""
27
28#. module: res_partner_attributes_add_NE
29#: field:res.partner,ne:0
30msgid "NE"
31msgstr ""
32
033
=== added file 'res_partner_attributes_add_BN/res_partner_attributes_add_BN.py'
--- res_partner_attributes_add_BN/res_partner_attributes_add_BN.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_BN/res_partner_attributes_add_BN.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,35 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import fields, orm
23from openerp.tools.translate import _
24
25
26class res_partner(orm.Model):
27 _name = 'res.partner'
28 _inherit = 'res.partner'
29 _columns = {
30 'ne': fields.float('BN', digits=(9, 0),
31 help="Canada Business identification Number (9 digits)"),
32 }
33
34
35# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
036
=== added file 'res_partner_attributes_add_BN/res_partner_attributes_add_BN_view.xml'
--- res_partner_attributes_add_BN/res_partner_attributes_add_BN_view.xml 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_BN/res_partner_attributes_add_BN_view.xml 2013-07-19 18:44:28 +0000
@@ -0,0 +1,16 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="res_partner_attributes_add_NE_form_view">
5 <field name="name">res_partner_attributes_add_NE</field>
6 <field name="model">res.partner</field>
7 <field name="inherit_id" ref="base.view_partner_form"/>
8 <field name="arch" type="xml">
9 <field name="email" position="after">
10 <field name="ne" attrs="{'invisible': [('is_company','=', False)]}"/>
11 </field>
12 </field>
13 </record>
14
15 </data>
16</openerp>
017
=== added directory 'res_partner_attributes_add_NEQ'
=== added file 'res_partner_attributes_add_NEQ/__init__.py'
--- res_partner_attributes_add_NEQ/__init__.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_NEQ/__init__.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,25 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import res_partner_attributes_add_NEQ
23
24
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
026
=== added file 'res_partner_attributes_add_NEQ/__openerp__.py'
--- res_partner_attributes_add_NEQ/__openerp__.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_NEQ/__openerp__.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,39 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name' : 'Quebec Enterprise Number (NEQ)',
24 'version' : '1.1',
25 "author" : "Savoir-faire Linux (mcassuto@savoirfairelinux.com)",
26 "website" : "http://www.savoirfairelinux.com",
27 'license': 'AGPL-3',
28 'category' : 'Localisation/Canada',
29 'depends' : ['base'],
30 'description': """
31Add the Quebec Enterprise Number (NEQ) to the partner form.
32""",
33 'auto_install': False,
34 'installable': True,
35 'data' : ['res_partner_attributes_add_NEQ_view.xml']
36}
37
38
39# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
040
=== added directory 'res_partner_attributes_add_NEQ/i18n'
=== added file 'res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.mo'
1Binary 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 differ41Binary 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
=== added file 'res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.pot'
--- res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.pot 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_NEQ/i18n/res_partner_attributes_add_NEQ.pot 2013-07-19 18:44:28 +0000
@@ -0,0 +1,32 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * res_partner_attributes_add_NEQ
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-07-11 14:53+0000\n"
10"PO-Revision-Date: 2013-07-11 10:58-0500\n"
11"Last-Translator: Marc Cassuto <marc.cassuto@savoirfairelinux.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: res_partner_attributes_add_NEQ
19#: model:ir.model,name:res_partner_attributes_add_NEQ.model_res_partner
20msgid "Partner"
21msgstr "Partenaire"
22
23#. module: res_partner_attributes_add_NEQ
24#: help:res.partner,neq:0
25msgid "Quebec Enterprise Number (10 digits)"
26msgstr "Numéro d'Entreprise du Quebec (10 chiffres)"
27
28#. module: res_partner_attributes_add_NEQ
29#: field:res.partner,neq:0
30msgid "NEQ"
31msgstr "NEQ"
32
033
=== added file 'res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ.py'
--- res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,33 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import fields, orm
23from openerp.tools.translate import _
24
25class res_partner(orm.Model):
26 _name = 'res.partner'
27 _inherit = 'res.partner'
28 _columns = {
29 'neq': fields.float('NEQ', digits=(10,0), help="Quebec Enterprise Number (10 digits)"),
30 }
31
32
33# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
034
=== added file 'res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ_view.xml'
--- res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ_view.xml 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_NEQ/res_partner_attributes_add_NEQ_view.xml 2013-07-19 18:44:28 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="res_partner_attributes_add_NEQ_form_view">
5 <field name="name">res_partner_attributes_add_NEQ</field>
6 <field name="model">res.partner</field>
7 <field name="inherit_id" ref="base.view_partner_form"/>
8 <field name="arch" type="xml">
9 <field name="website" position="after">
10 <field name="neq" attrs="{'invisible': [('is_company','=', False)]}"/>
11 </field>
12 </field>
13 </record>
14 </data>
15</openerp>
016
=== added directory 'res_partner_attributes_add_SIN'
=== added file 'res_partner_attributes_add_SIN/__init__.py'
--- res_partner_attributes_add_SIN/__init__.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_SIN/__init__.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,25 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import res_partner_attributes_add_SIN
23
24
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
026
=== added file 'res_partner_attributes_add_SIN/__openerp__.py'
--- res_partner_attributes_add_SIN/__openerp__.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_SIN/__openerp__.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,39 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name' : 'Canada Social Insurance Number (SIN/NAS)',
24 'version' : '1.0',
25 "author" : "Savoir-faire Linux (mcassuto@savoirfairelinux.com)",
26 "website" : "http://www.savoirfairelinux.com",
27 'license': 'AGPL-3',
28 'category' : 'Localisation/Canada',
29 'depends' : ['base'],
30 'description': """
31Add the Social Insurance Number (SIN/NAS) to the partner form.
32""",
33 'auto_install': False,
34 'installable': True,
35 'data' : ['res_partner_attributes_add_SIN_view.xml']
36}
37
38
39# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
040
=== added directory 'res_partner_attributes_add_SIN/i18n'
=== added file 'res_partner_attributes_add_SIN/i18n/fr.mo'
1Binary 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 differ41Binary 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
=== added file 'res_partner_attributes_add_SIN/i18n/fr.po'
--- res_partner_attributes_add_SIN/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_SIN/i18n/fr.po 2013-07-19 18:44:28 +0000
@@ -0,0 +1,32 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * res_partner_attributes_add_NAS
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-07-19 16:41+0000\n"
10"PO-Revision-Date: 2013-07-19 13:14-0400\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: res_partner_attributes_add_NAS
19#: model:ir.model,name:res_partner_attributes_add_NAS.model_res_partner
20msgid "Partner"
21msgstr "Partenaire"
22
23#. module: res_partner_attributes_add_NAS
24#: help:res.partner,nas:0
25msgid "Social Insurance Number (9 digits)"
26msgstr "Numéro d'Assurance Sociale (9 chiffres)"
27
28#. module: res_partner_attributes_add_NAS
29#: field:res.partner,nas:0
30msgid "SIN"
31msgstr "NAS"
32
033
=== added file 'res_partner_attributes_add_SIN/i18n/res_partner_attributes_add_SIN.pot'
--- res_partner_attributes_add_SIN/i18n/res_partner_attributes_add_SIN.pot 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_SIN/i18n/res_partner_attributes_add_SIN.pot 2013-07-19 18:44:28 +0000
@@ -0,0 +1,32 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * res_partner_attributes_add_NAS
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-07-11 14:53+0000\n"
10"PO-Revision-Date: 2013-07-11 14:53+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: res_partner_attributes_add_NAS
19#: field:res.partner,nas:0
20msgid "NAS"
21msgstr ""
22
23#. module: res_partner_attributes_add_NAS
24#: help:res.partner,nas:0
25msgid "Social Insurance Number (9 digits)"
26msgstr ""
27
28#. module: res_partner_attributes_add_NAS
29#: model:ir.model,name:res_partner_attributes_add_NAS.model_res_partner
30msgid "Partner"
31msgstr ""
32
033
=== added file 'res_partner_attributes_add_SIN/res_partner_attributes_add_SIN.py'
--- res_partner_attributes_add_SIN/res_partner_attributes_add_SIN.py 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_SIN/res_partner_attributes_add_SIN.py 2013-07-19 18:44:28 +0000
@@ -0,0 +1,64 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import fields, orm
23from openerp.tools.translate import _
24
25
26class res_partner(orm.Model):
27 _name = 'res.partner'
28 _inherit = 'res.partner'
29
30 def onchange_nas(self, cr, uid, ids, nas):
31 ret = {'value': 0}
32
33 def digits_of(n):
34 return [int(d) for d in str(n)]
35
36 def luhn_checksum(nas):
37 digits = digits_of(nas)
38 odd_digits = digits[-1::-2]
39 even_digits = digits[-2::-2]
40 checksum = 0
41 checksum += sum(odd_digits)
42 for d in even_digits:
43 checksum += sum(digits_of(d * 2))
44 return checksum % 10
45
46 def is_luhn_valid(nas):
47 return luhn_checksum(nas) == 0
48
49 if is_luhn_valid(nas):
50 ret['value'] = nas
51 else:
52 ret['value'] = 0
53 ret['warning'] = {
54 'title': 'Error',
55 'message': _('The number provided is not a valid SIN number !')
56 }
57 return ret
58
59 _columns = {
60 'nas': fields.float('SIN', digits=(9, 0),
61 help="Social Insurance Number (9 digits)"),
62 }
63
64# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
065
=== added file 'res_partner_attributes_add_SIN/res_partner_attributes_add_SIN_view.xml'
--- res_partner_attributes_add_SIN/res_partner_attributes_add_SIN_view.xml 1970-01-01 00:00:00 +0000
+++ res_partner_attributes_add_SIN/res_partner_attributes_add_SIN_view.xml 2013-07-19 18:44:28 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="res_partner_attributes_add_NAS_form_view">
5 <field name="name">res_partner_attributes_add_NAS</field>
6 <field name="model">res.partner</field>
7 <field name="inherit_id" ref="base.view_partner_form"/>
8 <field name="arch" type="xml">
9 <field name="website" position="after">
10 <field name="nas" on_change="onchange_nas(nas)" attrs="{'invisible': [('is_company','=', True)]}"/>
11 </field>
12 </field>
13 </record>
14 </data>
15</openerp>

Subscribers

People subscribed via source and target branches