Merge lp:~maxy/openerp-argentina/main into lp:openerp-argentina

Proposed by Maximiliano Curia
Status: Needs review
Proposed branch: lp:~maxy/openerp-argentina/main
Merge into: lp:openerp-argentina
Diff against target: 128 lines (+113/-0)
3 files modified
l10n_ar_vat/__init__.py (+25/-0)
l10n_ar_vat/__terp__.py (+39/-0)
l10n_ar_vat/partner.py (+49/-0)
To merge this branch: bzr merge lp:~maxy/openerp-argentina/main
Reviewer Review Type Date Requested Status
Luis Falcon - Thymbra Pending
Review via email: mp+40448@code.launchpad.net

Description of the change

Agrego modulo de comprobación de cuit argentino

To post a comment you must log in.
Revision history for this message
Luis Falcon - Thymbra (meanmicio) wrote :
Download full text (5.4 KiB)

Hola Maximiliano !

Ya esto está en el código base. Yo lo puse primero como un wizard
(verifica_cuit) y después como parte del base_vat

Gracias
Luis

2010/11/9 Maximiliano Curia <email address hidden>

> Maximiliano Curia has proposed merging lp:~maxy/openerp-argentina/main into
> lp:openerp-argentina.
>
> Requested reviews:
> Luis Falcon (meanmicio)
>
>
> Agrego modulo de comprobación de cuit argentino
> --
> https://code.launchpad.net/~maxy/openerp-argentina/main/+merge/40448<https://code.launchpad.net/%7Emaxy/openerp-argentina/main/+merge/40448>
> You are requested to review the proposed merge of
> lp:~maxy/openerp-argentina/main into lp:openerp-argentina.
>
> === added directory 'l10n_ar_vat'
> === added file 'l10n_ar_vat/__init__.py'
> --- l10n_ar_vat/__init__.py 1970-01-01 00:00:00 +0000
> +++ l10n_ar_vat/__init__.py 2010-11-09 16:21:09 +0000
> @@ -0,0 +1,25 @@
> +# -*- encoding: utf-8 -*-
>
> +##############################################################################
> +#
> +# Argentina Team
> +# Copyright (C) 2010 Argentina Team
> +# All Rights Reserved
> +# $Id$
> +#
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation, either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/
> >.
> +#
>
> +##############################################################################
> +
> +import partner
> +
>
> === added file 'l10n_ar_vat/__terp__.py'
> --- l10n_ar_vat/__terp__.py 1970-01-01 00:00:00 +0000
> +++ l10n_ar_vat/__terp__.py 2010-11-09 16:21:09 +0000
> @@ -0,0 +1,39 @@
> +# -*- encoding: utf-8 -*-
>
> +##############################################################################
> +#
> +# Argentina Team
> +# Copyright (C) 2010 Argentina Team
> +# All Rights Reserved
> +# $Id$
> +#
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation, either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/
> >.
> +#
>
> +##############################################################################
> +
> +{
> + "name" : "Argentina's localisation of V...

Read more...

Revision history for this message
Maximiliano Curia (maxy) wrote :

Hola Luis Falcon!

El 09/11/2010 a las 18:18 escribiste:
> Ya esto está en el código base. Yo lo puse primero como un wizard
> (verifica_cuit)

Claro, pero la idea de este módulo es que sea lo más similar a la forma de
trabajar de openerp, usando las variables y nombres de clases que usa openerp,
en inglés, etc.

> y después como parte del base_vat

Lo busqué en la versión 5.x y 6 y no pude encontrar que este integrado con
base vat. ¿Me podrías indicar donde encontrarlo?

--
"Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning."
  -- (Rich Cook)
Saludos /\/\ /\ >< `/

Revision history for this message
Luis Falcon - Thymbra (meanmicio) wrote :

Hola Maximiliano

Te reenvío el original en otro correo.

El 9 de noviembre de 2010 23:56, Maximiliano Curia
<email address hidden>escribió:

> Hola Luis Falcon!
>
> El 09/11/2010 a las 18:18 escribiste:
> > Ya esto está en el código base. Yo lo puse primero como un wizard
> > (verifica_cuit)
>
> Claro, pero la idea de este módulo es que sea lo más similar a la forma de
> trabajar de openerp, usando las variables y nombres de clases que usa
> openerp,
> en inglés, etc.
>
> > y después como parte del base_vat
>
> Lo busqué en la versión 5.x y 6 y no pude encontrar que este integrado con
> base vat. ¿Me podrías indicar donde encontrarlo?
>
> --
> "Programming today is a race between software engineers striving to build
> bigger and better idiot-proof programs, and the Universe trying to produce
> bigger and better idiots. So far, the Universe is winning."
> -- (Rich Cook)
> Saludos /\/\ /\ >< `/
>
> https://code.launchpad.net/~maxy/openerp-argentina/main/+merge/40448<https://code.launchpad.net/%7Emaxy/openerp-argentina/main/+merge/40448>
> You are requested to review the proposed merge of
> lp:~maxy/openerp-argentina/main into lp:openerp-argentina.
>

--
Luis Falcón
http://gnusolidario.org

Unmerged revisions

7. By Maximiliano Curia

Agrego comprobador de número de cuit/cuil argentino

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'l10n_ar_vat'
2=== added file 'l10n_ar_vat/__init__.py'
3--- l10n_ar_vat/__init__.py 1970-01-01 00:00:00 +0000
4+++ l10n_ar_vat/__init__.py 2010-11-09 16:21:09 +0000
5@@ -0,0 +1,25 @@
6+# -*- encoding: utf-8 -*-
7+##############################################################################
8+#
9+# Argentina Team
10+# Copyright (C) 2010 Argentina Team
11+# All Rights Reserved
12+# $Id$
13+#
14+# This program is free software: you can redistribute it and/or modify
15+# it under the terms of the GNU General Public License as published by
16+# the Free Software Foundation, either version 3 of the License, or
17+# (at your option) any later version.
18+#
19+# This program is distributed in the hope that it will be useful,
20+# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+# GNU General Public License for more details.
23+#
24+# You should have received a copy of the GNU General Public License
25+# along with this program. If not, see <http://www.gnu.org/licenses/>.
26+#
27+##############################################################################
28+
29+import partner
30+
31
32=== added file 'l10n_ar_vat/__terp__.py'
33--- l10n_ar_vat/__terp__.py 1970-01-01 00:00:00 +0000
34+++ l10n_ar_vat/__terp__.py 2010-11-09 16:21:09 +0000
35@@ -0,0 +1,39 @@
36+# -*- encoding: utf-8 -*-
37+##############################################################################
38+#
39+# Argentina Team
40+# Copyright (C) 2010 Argentina Team
41+# All Rights Reserved
42+# $Id$
43+#
44+# This program is free software: you can redistribute it and/or modify
45+# it under the terms of the GNU General Public License as published by
46+# the Free Software Foundation, either version 3 of the License, or
47+# (at your option) any later version.
48+#
49+# This program is distributed in the hope that it will be useful,
50+# but WITHOUT ANY WARRANTY; without even the implied warranty of
51+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52+# GNU General Public License for more details.
53+#
54+# You should have received a copy of the GNU General Public License
55+# along with this program. If not, see <http://www.gnu.org/licenses/>.
56+#
57+##############################################################################
58+
59+{
60+ "name" : "Argentina's localisation of VAT",
61+ "version" : "1.0",
62+ "author" : "Argentina Team",
63+ "category" : "Localisation/America",
64+ "description": """
65+ Adds a VAT validation for Argentina
66+ """,
67+ "depends" : [
68+ 'base',
69+ 'base_vat',
70+ ],
71+ "update_xml" : [],
72+ "active": False,
73+ "installable": True
74+}
75
76=== added file 'l10n_ar_vat/partner.py'
77--- l10n_ar_vat/partner.py 1970-01-01 00:00:00 +0000
78+++ l10n_ar_vat/partner.py 2010-11-09 16:21:09 +0000
79@@ -0,0 +1,49 @@
80+# -*- encoding: utf-8 -*-
81+##############################################################################
82+#
83+# Argentina Team
84+# Copyright (C) 2010 Argentina Team
85+# All Rights Reserved
86+# $Id$
87+#
88+# This program is free software: you can redistribute it and/or modify
89+# it under the terms of the GNU General Public License as published by
90+# the Free Software Foundation, either version 3 of the License, or
91+# (at your option) any later version.
92+#
93+# This program is distributed in the hope that it will be useful,
94+# but WITHOUT ANY WARRANTY; without even the implied warranty of
95+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96+# GNU General Public License for more details.
97+#
98+# You should have received a copy of the GNU General Public License
99+# along with this program. If not, see <http://www.gnu.org/licenses/>.
100+#
101+##############################################################################
102+
103+from osv import osv
104+from osv import fields
105+import string
106+from tools.func import partial
107+
108+class res_partner(osv.osv):
109+ _name = 'res.partner'
110+ _inherit = 'res.partner'
111+
112+ def check_vat_ar(self, vat):
113+ "Check Argentina VAT number"
114+
115+ if (len(vat) != 11 or
116+ not reduce(lambda x, y: x and y.isdigit(), vat)):
117+ return False
118+
119+ base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
120+ digit = 0
121+ for i, b in enumerate(base):
122+ digit += int(vat[i]) * b
123+
124+ digit = (11 - (digit % 11)) % 11
125+ # If digit is 10, the VAT is always invalid
126+ return digit == int(vat[10])
127+
128+res_partner()