Merge lp:~vauxoo/openerp-venezuela-localization/miguel-update-iva-seniat into lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk

Proposed by Miguel Delgado (Vauxoo)
Status: Merged
Merge reported by: Nhomar - Vauxoo
Merged at revision: not available
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/miguel-update-iva-seniat
Merge into: lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk
Diff against target: 899 lines (+762/-22)
10 files modified
l10n_ve_fiscal_requirements/__openerp__.py (+1/-1)
l10n_ve_fiscal_requirements/partner.py (+20/-15)
l10n_ve_withholding_iva/__init__.py (+1/-1)
l10n_ve_withholding_iva/__openerp__.py (+3/-2)
l10n_ve_withholding_iva/i18n/es_VE.po (+591/-0)
l10n_ve_withholding_iva/partner.py (+82/-2)
l10n_ve_withholding_iva/partner_view.xml (+1/-0)
l10n_ve_withholding_iva/res_company.py (+42/-0)
l10n_ve_withholding_iva/res_company_view.xml (+20/-0)
l10n_ve_withholding_iva/wh_iva_view.xml (+1/-1)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/miguel-update-iva-seniat
Reviewer Review Type Date Requested Status
Nhomar - Vauxoo Approve
Review via email: mp+77244@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Some comments.

So much prints......
No help on openerp py file, you need to improve for futures merges this help.
No doc on Methods.

I merged an corrected prints,

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_fiscal_requirements/__openerp__.py'
2--- l10n_ve_fiscal_requirements/__openerp__.py 2011-07-25 01:50:07 +0000
3+++ l10n_ve_fiscal_requirements/__openerp__.py 2011-09-27 22:10:26 +0000
4@@ -34,7 +34,7 @@
5 - VAT verification for Venezuela rules.
6 """,
7 'init_xml': [],
8- "depends" : ["base", "purchase", "stock", "account"],
9+ "depends" : ["base", "base_vat", "purchase", "stock", "account"],
10 'update_xml': [
11 'stock_view.xml',
12 'account_invoice_view.xml'
13
14=== modified file 'l10n_ve_fiscal_requirements/partner.py'
15--- l10n_ve_fiscal_requirements/partner.py 2011-07-28 22:02:26 +0000
16+++ l10n_ve_fiscal_requirements/partner.py 2011-09-27 22:10:26 +0000
17@@ -30,14 +30,14 @@
18 '''
19 def _check_addr_invoice(self,cr,uid,ids,context={}):
20 obj_addr = self.browse(cr,uid,ids[0])
21-
22- if obj_addr.type == 'invoice':
23- cr.execute('select id,type from res_partner_address where partner_id=%s and type=%s', (obj_addr.partner_id.id, obj_addr.type))
24- res=dict(cr.fetchall())
25- if (len(res) == 1):
26- res.pop(ids[0],False)
27- if res:
28- return False
29+ if obj_addr.partner_id.vat and obj_addr.partner_id.vat[:2].upper() == 'VE':
30+ if obj_addr.type == 'invoice':
31+ cr.execute('select id,type from res_partner_address where partner_id=%s and type=%s', (obj_addr.partner_id.id, obj_addr.type))
32+ res=dict(cr.fetchall())
33+ if (len(res) == 1):
34+ res.pop(ids[0],False)
35+ if res:
36+ return False
37 return True
38
39
40@@ -56,14 +56,19 @@
41 '''
42 def _check_partner_invoice_addr(self,cr,uid,ids,context={}):
43 partner_obj = self.browse(cr,uid,ids[0])
44- if hasattr(partner_obj, 'address') and partner_obj.address:
45- res = [addr for addr in partner_obj.address if addr.type == 'invoice']
46- if res:
47+ if partner_obj.vat and partner_obj.vat[:2].upper() == 'VE':
48+ #~ if hasattr(partner_obj, 'address') and partner_obj.address:
49+ if hasattr(partner_obj, 'address'):
50+ res = [addr for addr in partner_obj.address if addr.type == 'invoice']
51+ print "esto es res", res
52+ if res:
53+ return True
54+ else:
55+ return False
56+ else:
57+ print "else"
58 return True
59- else:
60- return True
61-
62- return False
63+ return True
64
65
66 _constraints = [
67
68=== modified file 'l10n_ve_withholding_iva/__init__.py'
69--- l10n_ve_withholding_iva/__init__.py 2011-05-11 16:46:27 +0000
70+++ l10n_ve_withholding_iva/__init__.py 2011-09-27 22:10:26 +0000
71@@ -18,10 +18,10 @@
72 # along with this program. If not, see <http://www.gnu.org/licenses/>.
73 #
74 ##############################################################################
75-
76 import wh_iva
77 import account
78 import invoice
79 import partner
80+import res_company
81
82 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
83
84=== modified file 'l10n_ve_withholding_iva/__openerp__.py'
85--- l10n_ve_withholding_iva/__openerp__.py 2011-05-20 18:53:45 +0000
86+++ l10n_ve_withholding_iva/__openerp__.py 2011-09-27 22:10:26 +0000
87@@ -23,7 +23,7 @@
88 ##############################################################################
89 {
90 "name" : "Withholding vat Venezuelan laws",
91- "version" : "0.5",
92+ "version" : "0.6",
93 "author" : "Vauxoo",
94 "website" : "http://vauxoo.com",
95 "category": 'Generic Modules/Accounting',
96@@ -33,7 +33,8 @@
97 "depends" : ["l10n_ve_withholding"],
98 'update_xml': [
99 'security/wh_iva_security.xml',
100- 'security/ir.model.access.csv',
101+ 'security/ir.model.access.csv',
102+ 'res_company_view.xml',
103 'account_invoice_view.xml',
104 'account_view.xml',
105 'partner_view.xml',
106
107=== added directory 'l10n_ve_withholding_iva/i18n'
108=== added file 'l10n_ve_withholding_iva/i18n/es_VE.po'
109--- l10n_ve_withholding_iva/i18n/es_VE.po 1970-01-01 00:00:00 +0000
110+++ l10n_ve_withholding_iva/i18n/es_VE.po 2011-09-27 22:10:26 +0000
111@@ -0,0 +1,591 @@
112+# Translation of OpenERP Server.
113+# This file contains the translation of the following modules:
114+# * l10n_ve_withholding_iva
115+#
116+msgid ""
117+msgstr ""
118+"Project-Id-Version: OpenERP Server 6.0.3\n"
119+"Report-Msgid-Bugs-To: support@openerp.com\n"
120+"POT-Creation-Date: 2011-09-27 21:44+0000\n"
121+"PO-Revision-Date: 2011-09-27 21:44+0000\n"
122+"Last-Translator: <>\n"
123+"Language-Team: \n"
124+"MIME-Version: 1.0\n"
125+"Content-Type: text/plain; charset=UTF-8\n"
126+"Content-Transfer-Encoding: \n"
127+"Plural-Forms: \n"
128+
129+#. module: l10n_ve_withholding_iva
130+#: help:account.wh.iva.line,move_id:0
131+msgid "Account entry"
132+msgstr "Cuenta de Entrada"
133+
134+#. module: l10n_ve_withholding_iva
135+#: view:account.wh.iva:0
136+msgid "Group By..."
137+msgstr "Agrupado Por..."
138+
139+#. module: l10n_ve_withholding_iva
140+#: help:account.wh.iva.line,name:0
141+msgid "Withholding line Description"
142+msgstr "Descripcion de la linea de retención"
143+
144+#. module: l10n_ve_withholding_iva
145+#: constraint:account.wh.iva:0
146+msgid "Error ! The partner must be withholding vat agent ."
147+msgstr "Error ! El partner debe ser agente de retención ."
148+
149+#. module: l10n_ve_withholding_iva
150+#: field:account.wh.iva,company_id:0
151+#: help:account.wh.iva,company_id:0
152+msgid "Company"
153+msgstr "Compañia"
154+
155+#. module: l10n_ve_withholding_iva
156+#: help:account.invoice,wh_iva:0
157+msgid "The account moves of the invoice have been retention with account moves of the payment(s)."
158+msgstr "Los movimientos de la cuenta de la factura han sido de tipo retención con movimientos de la cuenta de pago (s)."
159+
160+#. module: l10n_ve_withholding_iva
161+#: model:ir.module.module,shortdesc:l10n_ve_withholding_iva.module_meta_information
162+msgid "Withholding vat Venezuelan laws"
163+msgstr "Leyes de retención de I.V.A"
164+
165+#. module: l10n_ve_withholding_iva
166+#: view:account.wh.iva:0
167+msgid "Realize"
168+msgstr "Realizar"
169+
170+#. module: l10n_ve_withholding_iva
171+#: view:account.invoice:0
172+#: view:res.partner:0
173+msgid "Withholdings Vat"
174+msgstr "Retenciones de I.V.A"
175+
176+#. module: l10n_ve_withholding_iva
177+#: field:account.wh.iva,account_id:0
178+msgid "Account"
179+msgstr "Cuenta"
180+
181+#. module: l10n_ve_withholding_iva
182+#: model:ir.model,name:l10n_ve_withholding_iva.model_account_invoice_tax
183+msgid "Invoice Tax"
184+msgstr "Impuesto de factura"
185+
186+#. module: l10n_ve_withholding_iva
187+#: sql_constraint:account.wh.iva:0
188+msgid "number must be unique !"
189+msgstr "El Numero debe ser único !"
190+
191+#. module: l10n_ve_withholding_iva
192+#: view:account.wh.iva.line:0
193+#: field:account.wh.iva.line,tax_line:0
194+msgid "Taxes"
195+msgstr "Impuestos"
196+
197+#. module: l10n_ve_withholding_iva
198+#: help:account.wh.iva.line,tax_line:0
199+msgid "Invoice taxes"
200+msgstr "Impuestos de factura"
201+
202+#. module: l10n_ve_withholding_iva
203+#: field:account.invoice.tax,base_ret:0
204+#: field:account.wh.iva,tot_amount_base_wh:0
205+#: field:account.wh.iva.line,amount_base_wh:0
206+msgid "Amount"
207+msgstr "Monto"
208+
209+#. module: l10n_ve_withholding_iva
210+#: code:addons/l10n_ve_withholding_iva/partner.py:153
211+#, python-format
212+msgid "Unregistered VAT!"
213+msgstr "RIF no Registrado!"
214+
215+#. module: l10n_ve_withholding_iva
216+#: field:res.partner,wh_iva_agent:0
217+msgid "Wh. Agent"
218+msgstr "Agente de Retención"
219+
220+#. module: l10n_ve_withholding_iva
221+#: selection:account.wh.iva,state:0
222+msgid "Cancelled"
223+msgstr "Cancelado"
224+
225+#. module: l10n_ve_withholding_iva
226+#: field:account.invoice,wh_iva_rate:0
227+msgid "Wh rate"
228+msgstr "Porcentaje de Retención"
229+
230+#. module: l10n_ve_withholding_iva
231+#: field:account.wh.iva,date_ret:0
232+msgid "Withholding date"
233+msgstr "Fecha de Retención"
234+
235+#. module: l10n_ve_withholding_iva
236+#: help:account.wh.iva,type:0
237+msgid "Withholding type"
238+msgstr "Tipo de Retención"
239+
240+#. module: l10n_ve_withholding_iva
241+#: field:account.wh.iva,amount_base_ret:0
242+msgid "Compute amount"
243+msgstr "Calcular Monto"
244+
245+#. module: l10n_ve_withholding_iva
246+#: field:account.wh.iva,period_id:0
247+msgid "Force Period"
248+msgstr "Forzar Período"
249+
250+#. module: l10n_ve_withholding_iva
251+#: field:account.invoice,wh_iva_id:0
252+msgid "Wh. Vat"
253+msgstr "Retencion de I.V.A"
254+
255+#. module: l10n_ve_withholding_iva
256+#: help:account.tax,ret:0
257+msgid "Indicate if the amount of tax must be withholded"
258+msgstr "Indicar si el monto del impuesto debe ser retenido"
259+
260+#. module: l10n_ve_withholding_iva
261+#: code:addons/l10n_ve_withholding_iva/partner.py:149
262+#, python-format
263+msgid "Invalid VAT!"
264+msgstr "RIF Invalido!"
265+
266+#. module: l10n_ve_withholding_iva
267+#: constraint:res.partner:0
268+msgid "Error ! The partner does not have an invoice address. "
269+msgstr "Error ! No ha definido una direccion fiscal. "
270+
271+#. module: l10n_ve_withholding_iva
272+#: view:account.wh.iva:0
273+#: field:account.wh.iva,partner_id:0
274+#: model:ir.model,name:l10n_ve_withholding_iva.model_res_partner
275+msgid "Partner"
276+msgstr "Partner"
277+
278+#. module: l10n_ve_withholding_iva
279+#: field:account.wh.iva.line,retention_id:0
280+#: help:account.wh.iva.line,retention_id:0
281+msgid "Withholding vat"
282+msgstr "Retencion de I.V.A"
283+
284+#. module: l10n_ve_withholding_iva
285+#: help:account.wh.iva.line,invoice_id:0
286+msgid "Withholding invoice"
287+msgstr "Retencion de Factura"
288+
289+#. module: l10n_ve_withholding_iva
290+#: field:account.wh.iva,total_tax_ret:0
291+msgid "Compute amount wh. tax vat"
292+msgstr "Calcular el monto de retención del impuesto sobre el I.V.A"
293+
294+#. module: l10n_ve_withholding_iva
295+#: field:account.wh.iva,number:0
296+msgid "Number"
297+msgstr "Número"
298+
299+#. module: l10n_ve_withholding_iva
300+#: selection:account.wh.iva,type:0
301+msgid "Supplier Invoice"
302+msgstr "Factura del Proveedor"
303+
304+#. module: l10n_ve_withholding_iva
305+#: view:account.wh.iva:0
306+#: field:account.wh.iva,state:0
307+msgid "State"
308+msgstr "Estado"
309+
310+#. module: l10n_ve_withholding_iva
311+#: field:account.wh.iva.line,amount_tax_ret:0
312+msgid "Wh. tax amount"
313+msgstr "Monto de retencion de impuestos"
314+
315+#. module: l10n_ve_withholding_iva
316+#: field:res.partner,property_wh_iva_receivable:0
317+msgid "Sale withholding vat account"
318+msgstr "Sale withholding vat account"
319+
320+#. module: l10n_ve_withholding_iva
321+#: help:account.invoice,wh_iva_rate:0
322+#: help:res.partner,wh_iva_rate:0
323+msgid "Withholding vat rate"
324+msgstr "Porcentaje de Retencion de I.V.A"
325+
326+#. module: l10n_ve_withholding_iva
327+#: field:account.wh.iva,type:0
328+msgid "Type"
329+msgstr "Tipo"
330+
331+#. module: l10n_ve_withholding_iva
332+#: help:account.wh.iva,name:0
333+msgid "Description of withholding"
334+msgstr "Descripcion de la Retención"
335+
336+#. module: l10n_ve_withholding_iva
337+#: field:res.partner,property_wh_iva_payable:0
338+msgid "Purchase withholding vat account"
339+msgstr "Cuenta de retencion de I.V.A sobre compra"
340+
341+#. module: l10n_ve_withholding_iva
342+#: help:account.invoice.tax,amount_ret:0
343+msgid "Withholding vat amount"
344+msgstr "Monto de Retención sobre I.V.A"
345+
346+#. module: l10n_ve_withholding_iva
347+#: model:ir.model,name:l10n_ve_withholding_iva.model_account_wh_iva_line
348+msgid "Withholding vat line"
349+msgstr "Linea de Retencion sobre I.V.A"
350+
351+#. module: l10n_ve_withholding_iva
352+#: view:account.wh.iva:0
353+msgid "Other Information"
354+msgstr "Otra información"
355+
356+#. module: l10n_ve_withholding_iva
357+#: view:account.wh.iva.line:0
358+msgid "Line"
359+msgstr "Linea"
360+
361+#. module: l10n_ve_withholding_iva
362+#: model:ir.model,name:l10n_ve_withholding_iva.model_account_tax
363+msgid "account.tax"
364+msgstr "contabilidad.impuesto"
365+
366+#. module: l10n_ve_withholding_iva
367+#: help:account.wh.iva,partner_id:0
368+msgid "Withholding customer/supplier"
369+msgstr "Retención Cliente/Proveedor"
370+
371+#. module: l10n_ve_withholding_iva
372+#: help:account.invoice.tax,base_ret:0
373+#: help:account.wh.iva,tot_amount_base_wh:0
374+#: help:account.wh.iva.line,amount_base_wh:0
375+msgid "Amount without tax"
376+msgstr "Monto libre de impuestos"
377+
378+#. module: l10n_ve_withholding_iva
379+#: code:addons/l10n_ve_withholding_iva/partner.py:149
380+#: code:addons/l10n_ve_withholding_iva/partner.py:153
381+#, python-format
382+msgid "Vat Error !"
383+msgstr "Error en RIF !"
384+
385+#. module: l10n_ve_withholding_iva
386+#: model:ir.module.module,description:l10n_ve_withholding_iva.module_meta_information
387+msgid "Management withholding vat for Venezuelan tax laws\n"
388+" "
389+msgstr "Gestión de retención de IVA asoicado a las leyes fiscales de Venezuela\n"
390+" "
391+
392+#. module: l10n_ve_withholding_iva
393+#: help:account.wh.iva,amount_base_ret:0
394+msgid "Compute amount without tax"
395+msgstr "Calcular el monto libre de impuestos"
396+
397+#. module: l10n_ve_withholding_iva
398+#: view:account.wh.iva.line:0
399+msgid "Withholding Lines"
400+msgstr "Lineas de Retención"
401+
402+#. module: l10n_ve_withholding_iva
403+#: help:account.wh.iva,account_id:0
404+msgid "The pay account used for this withholding."
405+msgstr "Cuenta de pago usada para esta retención."
406+
407+#. module: l10n_ve_withholding_iva
408+#: help:account.wh.iva.line,base_ret:0
409+msgid "Withholding without tax amount"
410+msgstr "Retención sin impuestos"
411+
412+#. module: l10n_ve_withholding_iva
413+#: field:account.wh.iva,currency_id:0
414+#: help:account.wh.iva,currency_id:0
415+msgid "Currency"
416+msgstr "Moneda"
417+
418+#. module: l10n_ve_withholding_iva
419+#: view:res.partner:0
420+msgid "Update Data Vat"
421+msgstr "Actualizar la data RIF"
422+
423+#. module: l10n_ve_withholding_iva
424+#: help:res.company,url_seniat1_company:0
425+msgid "In this field enter the URL from Seniat for search the fiscal information from partner"
426+msgstr "En este campo introduzca el URL del Seniat, para buscar la información fiscal del Partner"
427+
428+#. module: l10n_ve_withholding_iva
429+#: help:account.wh.iva,tot_amount_tax_wh:0
430+#: help:account.wh.iva.line,amount_tax_wh:0
431+msgid "Amount withholding tax vat"
432+msgstr "Retención de la cantidad de IVA "
433+
434+#. module: l10n_ve_withholding_iva
435+#: field:res.company,url_seniat2_company:0
436+msgid "URL Seniat for Retention Rate"
437+msgstr "Porcentaje de Retencion (Seniat URL)"
438+
439+#. module: l10n_ve_withholding_iva
440+#: field:account.wh.iva,retention_line:0
441+#: help:account.wh.iva,retention_line:0
442+msgid "Withholding vat lines"
443+msgstr "Líneas de retención de IVA"
444+
445+#. module: l10n_ve_withholding_iva
446+#: view:account.wh.iva:0
447+#: selection:account.wh.iva,state:0
448+msgid "Draft"
449+msgstr "Draft"
450+
451+#. module: l10n_ve_withholding_iva
452+#: help:res.company,url_seniat2_company:0
453+msgid "In this field enter the URL from Seniat for search the retention rate from partner"
454+msgstr "En este campo introduzca el URL del Seniat, para buscar el porcentaje de retencion del Partner"
455+
456+#. module: l10n_ve_withholding_iva
457+#: model:ir.actions.act_window,name:l10n_ve_withholding_iva.action_account_wh_iva_customer
458+#: model:ir.ui.menu,name:l10n_ve_withholding_iva.menu_action_account_wh_iva_customer
459+msgid "Withholding vat customer"
460+msgstr "Cliente de retencion de I.V.A"
461+
462+#. module: l10n_ve_withholding_iva
463+#: view:account.wh.iva:0
464+msgid "Withholding"
465+msgstr "Retención"
466+
467+#. module: l10n_ve_withholding_iva
468+#: view:account.wh.iva:0
469+#: model:ir.model,name:l10n_ve_withholding_iva.model_account_wh_iva
470+msgid "Withholding Vat"
471+msgstr "Retencion de IVA"
472+
473+#. module: l10n_ve_withholding_iva
474+#: help:account.wh.iva,date_ret:0
475+msgid "Keep empty to use the current date"
476+msgstr "Dejar vacio para usar la fecha actual"
477+
478+#. module: l10n_ve_withholding_iva
479+#: help:account.wh.iva,code:0
480+msgid "Withholding reference"
481+msgstr "Referencia de retención"
482+
483+#. module: l10n_ve_withholding_iva
484+#: code:addons/l10n_ve_withholding_iva/wh_iva.py:163
485+#, python-format
486+msgid "Invoice already withhold !"
487+msgstr "Factura retenida !"
488+
489+#. module: l10n_ve_withholding_iva
490+#: field:account.wh.iva,date:0
491+#: help:account.wh.iva,date:0
492+msgid "Date"
493+msgstr "Fecha"
494+
495+#. module: l10n_ve_withholding_iva
496+#: sql_constraint:account.wh.iva.line:0
497+msgid "The invoice has already assigned in withholding vat, you cannot assigned it twice!"
498+msgstr "La factura ya se ha asignado en la retención de IVA, no se puede asignar nuevamente!"
499+
500+#. module: l10n_ve_withholding_iva
501+#: help:res.partner,property_wh_iva_receivable:0
502+msgid "This account will be used credit withholding vat amount"
503+msgstr "Esta cuenta se utilizará en la retención de crédito para el importe del IVA"
504+
505+#. module: l10n_ve_withholding_iva
506+#: constraint:res.company:0
507+msgid "Error! You can not create recursive companies."
508+msgstr "¡Error! No puede crear compañías recursivas."
509+
510+#. module: l10n_ve_withholding_iva
511+#: view:res.company:0
512+msgid "Fiscal Information"
513+msgstr "Información Fiscal"
514+
515+#. module: l10n_ve_withholding_iva
516+#: model:ir.model,name:l10n_ve_withholding_iva.model_res_company
517+msgid "Companies"
518+msgstr "Compañías"
519+
520+#. module: l10n_ve_withholding_iva
521+#: code:addons/l10n_ve_withholding_iva/partner.py:158
522+#, python-format
523+msgid "Could not connect!"
524+msgstr "No se puede Conectar!"
525+
526+#. module: l10n_ve_withholding_iva
527+#: help:account.wh.iva,journal_id:0
528+msgid "Journal entry"
529+msgstr "Diario de Entrada"
530+
531+#. module: l10n_ve_withholding_iva
532+#: help:account.wh.iva,period_id:0
533+msgid "Keep empty to use the period of the validation(Withholding date) date."
534+msgstr "Mantengase vacio para usar el periodo de validacion de fecha (Fecha de Retencion)."
535+
536+#. module: l10n_ve_withholding_iva
537+#: model:ir.actions.act_window,help:l10n_ve_withholding_iva.action_account_wh_iva_supplier
538+msgid "With Supplier Withholding Vat you can create and manage document withholding issued to your customers. OpenERP can also generate document withholding automatically from invoices. For retention must add the invoices, process them and then validate the document."
539+msgstr "Con el Proveedor de Retención de I.V.A puede crear y gestionar retención de documentos expedidos a sus clientes. OpenERP también puede generar de forma automática la retención de documentos de las facturas. Para la retención hay que añadir las facturas, se procesan y luego se valida el documento."
540+
541+#. module: l10n_ve_withholding_iva
542+#: field:account.wh.iva,code:0
543+msgid "Code"
544+msgstr "Codigo"
545+
546+#. module: l10n_ve_withholding_iva
547+#: help:account.invoice,wh_iva_id:0
548+msgid "Withholding vat."
549+msgstr "Retencion de I.V.A."
550+
551+#. module: l10n_ve_withholding_iva
552+#: field:account.invoice.tax,amount_ret:0
553+msgid "Withholding amount"
554+msgstr "Monto de Retencion"
555+
556+#. module: l10n_ve_withholding_iva
557+#: model:ir.actions.act_window,name:l10n_ve_withholding_iva.action_account_wh_iva_supplier
558+#: model:ir.ui.menu,name:l10n_ve_withholding_iva.menu_action_account_wh_iva_supplier
559+msgid "Withholding vat supplier"
560+msgstr "Retención de IVA de proveedores"
561+
562+#. module: l10n_ve_withholding_iva
563+#: view:account.wh.iva:0
564+#: selection:account.wh.iva,state:0
565+msgid "Done"
566+msgstr "Listo"
567+
568+#. module: l10n_ve_withholding_iva
569+#: field:account.wh.iva.line,invoice_id:0
570+#: model:ir.model,name:l10n_ve_withholding_iva.model_account_invoice
571+msgid "Invoice"
572+msgstr "Factura"
573+
574+#. module: l10n_ve_withholding_iva
575+#: view:account.wh.iva:0
576+msgid "Cancel"
577+msgstr "Cancelar"
578+
579+#. module: l10n_ve_withholding_iva
580+#: selection:account.wh.iva,type:0
581+msgid "Customer Invoice"
582+msgstr "Factura de Cliente"
583+
584+#. module: l10n_ve_withholding_iva
585+#: field:account.wh.iva,tot_amount_tax_wh:0
586+#: field:account.wh.iva.line,amount_tax_wh:0
587+msgid "Amount wh. tax vat"
588+msgstr "Monto de retencion de impuesto de I.V.A"
589+
590+#. module: l10n_ve_withholding_iva
591+#: field:res.company,url_seniat1_company:0
592+msgid "URL Seniat for Partner Information"
593+msgstr "Información del Partner (URL Seniat)"
594+
595+#. module: l10n_ve_withholding_iva
596+#: view:account.wh.iva:0
597+msgid "Accounting Date of Withhold"
598+msgstr "Fecha Contable de Retención"
599+
600+#. module: l10n_ve_withholding_iva
601+#: field:account.wh.iva,name:0
602+#: field:account.wh.iva.line,name:0
603+msgid "Description"
604+msgstr "Descripción"
605+
606+#. module: l10n_ve_withholding_iva
607+#: view:account.wh.iva:0
608+#: field:account.wh.iva,journal_id:0
609+msgid "Journal"
610+msgstr "Diario"
611+
612+#. module: l10n_ve_withholding_iva
613+#: help:res.partner,property_wh_iva_payable:0
614+msgid "This account will be used debit withholding vat amount"
615+msgstr "Esta cuenta sera usada para debitar la cantidad de retención de IVA"
616+
617+#. module: l10n_ve_withholding_iva
618+#: field:account.wh.iva.line,base_ret:0
619+msgid "Wh. amount"
620+msgstr "Monto de Retención"
621+
622+#. module: l10n_ve_withholding_iva
623+#: code:addons/l10n_ve_withholding_iva/partner.py:125
624+#, python-format
625+msgid "Could not connect! Check the URL "
626+msgstr "No se pudo Conectar Chequee las URL "
627+
628+#. module: l10n_ve_withholding_iva
629+#: help:res.partner,wh_iva_agent:0
630+msgid "Indicate if the partner is a withholding vat agent"
631+msgstr "Indicar si el partner es agente de retencion"
632+
633+#. module: l10n_ve_withholding_iva
634+#: view:account.invoice:0
635+#: view:res.partner:0
636+msgid "Withholdings"
637+msgstr "Retenciones"
638+
639+#. module: l10n_ve_withholding_iva
640+#: help:account.wh.iva,state:0
641+msgid "Withholding State"
642+msgstr "Estado de la retención"
643+
644+#. module: l10n_ve_withholding_iva
645+#: help:account.wh.iva.line,amount_tax_ret:0
646+msgid "Withholding tax amount"
647+msgstr "Importe del impuesto de retención"
648+
649+#. module: l10n_ve_withholding_iva
650+#: view:account.wh.iva:0
651+msgid "Search Withholding Vat"
652+msgstr "Buscar la Retencion de I.V.A"
653+
654+#. module: l10n_ve_withholding_iva
655+#: help:account.wh.iva,number:0
656+msgid "Withholding number"
657+msgstr "Numero de Retencion"
658+
659+#. module: l10n_ve_withholding_iva
660+#: field:account.invoice,wh_iva:0
661+#: field:account.tax,ret:0
662+msgid "Withhold"
663+msgstr "Retenido"
664+
665+#. module: l10n_ve_withholding_iva
666+#: view:account.wh.iva:0
667+msgid "Compute Withholding Vat"
668+msgstr "Calcular de retención de IVA"
669+
670+#. module: l10n_ve_withholding_iva
671+#: code:addons/l10n_ve_withholding_iva/partner.py:125
672+#: code:addons/l10n_ve_withholding_iva/partner.py:158
673+#, python-format
674+msgid "No Connection !"
675+msgstr "No hay Conexión !"
676+
677+#. module: l10n_ve_withholding_iva
678+#: field:account.wh.iva.line,move_id:0
679+msgid "Account Entry"
680+msgstr "Cuenta de Entrada"
681+
682+#. module: l10n_ve_withholding_iva
683+#: model:ir.actions.act_window,help:l10n_ve_withholding_iva.action_account_wh_iva_customer
684+msgid "With Customer Withholding Vat you can create and manage document withholding issued to your customers. OpenERP can also generate document withholding automatically from invoices. For retention must add the invoices, process them and then validate the document."
685+msgstr "Con Cliente de retención de IVA usted puede crear y administrar retención de documentos expedidos a sus clientes. OpenERP también puede generar de forma automática el documentos de retención de las facturas. Para la retención hay que añadir las facturas, se procesan y luego se validan en el documento."
686+
687+#. module: l10n_ve_withholding_iva
688+#: field:res.partner,wh_iva_rate:0
689+msgid "Rate"
690+msgstr "Porcentaje"
691+
692+#. module: l10n_ve_withholding_iva
693+#: code:addons/l10n_ve_withholding_iva/wh_iva.py:163
694+#, python-format
695+msgid "You must omit the follow invoice '%s' !"
696+msgstr "Debe omitir la siguiente factura '%s' !"
697+
698+#. module: l10n_ve_withholding_iva
699+#: help:account.wh.iva,total_tax_ret:0
700+msgid "compute amount withholding tax vat"
701+msgstr "Calcular la cantidad retención del IVA"
702+
703
704=== modified file 'l10n_ve_withholding_iva/partner.py'
705--- l10n_ve_withholding_iva/partner.py 2011-05-19 20:32:34 +0000
706+++ l10n_ve_withholding_iva/partner.py 2011-09-27 22:10:26 +0000
707@@ -20,7 +20,9 @@
708 ##############################################################################
709 from osv import fields, osv
710 import decimal_precision as dp
711-
712+from tools.translate import _
713+import urllib
714+from xml.dom.minidom import parseString
715
716 class res_partner(osv.osv):
717 _inherit = 'res.partner'
718@@ -52,5 +54,83 @@
719
720 }
721
722-
723+ def _load_url(self,retries,url):
724+ print 'load'
725+ str_error= '404 Not Found'
726+ while retries > 0:
727+ try:
728+ s = urllib.urlopen(url)
729+ r = s.read()
730+ ok = not('404 Not Found' in r)
731+ if ok:
732+ return r
733+ except:
734+ pass
735+ retries -= 1
736+ return str_error
737+
738+ def _buscar_porcentaje(self,rif,url):
739+ context={}
740+ print"esta pasando por aqui"
741+ html_data = self._load_url(3,url %rif)
742+ html_data = unicode(html_data, 'ISO-8859-1').encode('utf-8')
743+ print "html_data",html_data
744+ self._eval_seniat_data(html_data,context)
745+ search_str='La condición de este contribuyente requiere la retención del '
746+ pos = html_data.find(search_str)
747+ if pos > 0:
748+ pos += len(search_str)
749+ pct = html_data[pos:pos+4].replace('%','').replace(' ','')
750+ return float(pct)
751+ else:
752+ return 0.0
753+
754+ def _parse_dom(self,dom,rif,url_seniat):
755+ print 'entrando dom'
756+ name = dom.childNodes[0].childNodes[0].firstChild.data
757+ wh_agent = dom.childNodes[0].childNodes[1].firstChild.data.upper()=='SI' and True or False
758+ vat_apply = dom.childNodes[0].childNodes[2].firstChild.data.upper()=='SI' and True or False
759+ wh_rate = self._buscar_porcentaje(rif,url_seniat)
760+ print "wh_rate",wh_rate
761+ print 'nombre: ',name
762+ return {'name':name, 'wh_iva_agent':wh_agent,'vat_subjected':vat_apply,'wh_iva_rate':wh_rate}
763+
764+ def _print_error(self, error, msg):
765+ raise osv.except_osv(error,msg)
766+
767+ def _eval_seniat_data(self,xml_data,context={}):
768+
769+ if xml_data.find('450')>=0:
770+ if not 'all_rif' in context:
771+ self._print_error(_('Vat Error !'),_('Invalid VAT!'))
772+
773+ if xml_data.find('452')>=0:
774+ if not 'all_rif' in context:
775+ self._print_error(_('Vat Error !'),_('Unregistered VAT!'))
776+
777+ if xml_data.find("404")>=0:
778+ if not 'all_rif' in context:
779+ self._print_error(_('No Connection !'),_("Could not connect! Check the URL "))
780+
781+ def update_rif(self, cr, uid, ids, context={}):
782+ print 'entando update'
783+ for partner in self.browse(cr,uid,ids):
784+ url1=partner.company_id.url_seniat1_company+'%s'
785+ url2=partner.company_id.url_seniat2_company+'%s'
786+ xml_data = self._load_url(3,url1 %partner.vat[2:])
787+ self._eval_seniat_data(xml_data,context)
788+ print 'xml_data',xml_data
789+ dom = parseString(xml_data)
790+ self.write(cr,uid,partner.id,self._parse_dom(dom,partner.vat[2:],url2))
791+ return True
792+
793+ def connect_seniat(self, cr, uid, ids, context={}, all_rif=False):
794+ if all_rif:
795+ ctx = context.copy()
796+ ctx.update({'all_rif': True})
797+ for partner in self.browse(cr,uid,ids):
798+ self. update_rif(cr, uid, [partner.id], context=ctx)
799+
800+ return True
801+
802 res_partner()
803
804=== modified file 'l10n_ve_withholding_iva/partner_view.xml'
805--- l10n_ve_withholding_iva/partner_view.xml 2011-09-08 18:24:07 +0000
806+++ l10n_ve_withholding_iva/partner_view.xml 2011-09-27 22:10:26 +0000
807@@ -24,6 +24,7 @@
808 <field name="wh_iva_rate"/>
809 <field name="property_wh_iva_payable"/>
810 <field name="property_wh_iva_receivable"/>
811+ <button name="update_rif" string="Update Data Vat" type="object" icon="gtk-execute"/>
812 </group>
813 </page>
814 </notebook>
815
816=== added file 'l10n_ve_withholding_iva/res_company.py'
817--- l10n_ve_withholding_iva/res_company.py 1970-01-01 00:00:00 +0000
818+++ l10n_ve_withholding_iva/res_company.py 2011-09-27 22:10:26 +0000
819@@ -0,0 +1,42 @@
820+# -*- encoding: utf-8 -*-
821+##############################################################################
822+# Copyright (c) 2011 OpenERP Venezuela (http://openerp.com.ve)
823+# All Rights Reserved.
824+# Programmed by: Miguel Delgado <miguel@openerp.com.ve>
825+#
826+# WARNING: This program as such is intended to be used by professional
827+# programmers who take the whole responsability of assessing all potential
828+# consequences resulting from its eventual inadequacies and bugs
829+# End users who are looking for a ready-to-use solution with commercial
830+# garantees and support are strongly adviced to contract a Free Software
831+# Service Company
832+#
833+# This program is Free Software; you can redistribute it and/or
834+# modify it under the terms of the GNU General Public License
835+# as published by the Free Software Foundation; either version 2
836+# of the License, or (at your option) any later version.
837+#
838+# This program is distributed in the hope that it will be useful,
839+# but WITHOUT ANY WARRANTY; without even the implied warranty of
840+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
841+# GNU General Public License for more details.
842+#
843+# You should have received a copy of the GNU General Public License
844+# along with this program; if not, write to the Free Software
845+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
846+###############################################################################
847+from osv import osv
848+from osv import fields
849+from tools.translate import _
850+
851+class url_seniat_company(osv.osv):
852+ _inherit = 'res.company'
853+ _columns = {
854+ 'url_seniat1_company':fields.char('URL Seniat for Partner Information',size=64, required=True, readonly=False,help='In this field enter the URL from Seniat for search the fiscal information from partner'),
855+ 'url_seniat2_company':fields.char('URL Seniat for Retention Rate',size=64, required=True, readonly=False,help='In this field enter the URL from Seniat for search the retention rate from partner'),
856+ }
857+ _defaults = {
858+ 'url_seniat1_company':'http://contribuyente.seniat.gob.ve/getContribuyente/getrif?rif=',
859+ 'url_seniat2_company':'http://contribuyente.seniat.gob.ve/BuscaRif/BuscaRif.jsp?p_rif=',
860+ }
861+url_seniat_company()
862
863=== added file 'l10n_ve_withholding_iva/res_company_view.xml'
864--- l10n_ve_withholding_iva/res_company_view.xml 1970-01-01 00:00:00 +0000
865+++ l10n_ve_withholding_iva/res_company_view.xml 2011-09-27 22:10:26 +0000
866@@ -0,0 +1,20 @@
867+<?xml version="1.0"?>
868+<openerp>
869+ <data>
870+
871+ <record model="ir.ui.view" id="view_res_company_wh_iva_form_inherit">
872+ <field name="name">res.company.form.inherit</field>
873+ <field name="model">res.company</field>
874+ <field name="type">form</field>
875+ <field name="inherit_id" ref="base.view_company_form"/>
876+ <field name="arch" type="xml">
877+ <xpath expr="/form/notebook/page[@string='Configuration']" position="inside">
878+ <separator string="Fiscal Information" colspan="4"/>
879+ <field name="url_seniat1_company" />
880+ <field name="url_seniat2_company" />
881+ </xpath>
882+ </field>
883+ </record>
884+
885+ </data>
886+</openerp>
887
888=== modified file 'l10n_ve_withholding_iva/wh_iva_view.xml'
889--- l10n_ve_withholding_iva/wh_iva_view.xml 2011-09-08 18:24:07 +0000
890+++ l10n_ve_withholding_iva/wh_iva_view.xml 2011-09-27 22:10:26 +0000
891@@ -192,7 +192,7 @@
892 <field colspan="4" name="retention_line" nolabel="1" widget="one2many_list"/>
893 <group col="4" colspan="2">
894 <field name="state" select="2"/>
895- <button name="wh_iva_done" states="draft" string="Realizar" icon="gtk-execute"/>
896+ <button name="wh_iva_done" states="draft" string="Realize" icon="gtk-execute"/>
897 </group>
898 <group col="2" colspan="2">
899 <!-- <field name="amount_base_ret"/> -->