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
=== 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 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# Argentina Team
5# Copyright (C) 2010 Argentina Team
6# All Rights Reserved
7# $Id$
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24import partner
25
026
=== 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 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# Argentina Team
5# Copyright (C) 2010 Argentina Team
6# All Rights Reserved
7# $Id$
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24{
25 "name" : "Argentina's localisation of VAT",
26 "version" : "1.0",
27 "author" : "Argentina Team",
28 "category" : "Localisation/America",
29 "description": """
30 Adds a VAT validation for Argentina
31 """,
32 "depends" : [
33 'base',
34 'base_vat',
35 ],
36 "update_xml" : [],
37 "active": False,
38 "installable": True
39}
040
=== added file 'l10n_ar_vat/partner.py'
--- l10n_ar_vat/partner.py 1970-01-01 00:00:00 +0000
+++ l10n_ar_vat/partner.py 2010-11-09 16:21:09 +0000
@@ -0,0 +1,49 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# Argentina Team
5# Copyright (C) 2010 Argentina Team
6# All Rights Reserved
7# $Id$
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24from osv import osv
25from osv import fields
26import string
27from tools.func import partial
28
29class res_partner(osv.osv):
30 _name = 'res.partner'
31 _inherit = 'res.partner'
32
33 def check_vat_ar(self, vat):
34 "Check Argentina VAT number"
35
36 if (len(vat) != 11 or
37 not reduce(lambda x, y: x and y.isdigit(), vat)):
38 return False
39
40 base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
41 digit = 0
42 for i, b in enumerate(base):
43 digit += int(vat[i]) * b
44
45 digit = (11 - (digit % 11)) % 11
46 # If digit is 10, the VAT is always invalid
47 return digit == int(vat[10])
48
49res_partner()