Merge lp:~vauxoo/openerp-venezuela-localization/ovl70-whislr-rev-hbto into lp:openerp-venezuela-localization

Proposed by hbto [Vauxoo] http://www.vauxoo.com
Status: Merged
Merged at revision: 771
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/ovl70-whislr-rev-hbto
Merge into: lp:openerp-venezuela-localization
Diff against target: 3116 lines (+644/-999)
27 files modified
l10n_ve_fiscal_requirements/model/res_users.py (+0/-1)
l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py (+0/-1)
l10n_ve_fiscal_requirements/wizard/update_info_partner.py (+0/-1)
l10n_ve_withholding_islr/__init__.py (+1/-1)
l10n_ve_withholding_islr/__openerp__.py (+6/-6)
l10n_ve_withholding_islr/demo/retencion_islr_sequence.xml (+6/-6)
l10n_ve_withholding_islr/i18n/es.po (+54/-54)
l10n_ve_withholding_islr/i18n/es_VE.po (+54/-54)
l10n_ve_withholding_islr/model/installer.py (+9/-9)
l10n_ve_withholding_islr/model/invoice.py (+71/-576)
l10n_ve_withholding_islr/model/islr_wh_concept.py (+1/-1)
l10n_ve_withholding_islr/model/islr_wh_doc.py (+320/-147)
l10n_ve_withholding_islr/model/islr_xml_wh.py (+8/-8)
l10n_ve_withholding_islr/model/partner.py (+3/-0)
l10n_ve_withholding_islr/model/product.py (+2/-2)
l10n_ve_withholding_islr/report/islr_wh_report.xml (+2/-2)
l10n_ve_withholding_islr/view/installer.xml (+2/-3)
l10n_ve_withholding_islr/view/invoice_view.xml (+0/-5)
l10n_ve_withholding_islr/view/islr_wh_concept_view.xml (+7/-12)
l10n_ve_withholding_islr/view/islr_wh_doc_view.xml (+84/-90)
l10n_ve_withholding_islr/view/islr_xml_wh.xml (+2/-6)
l10n_ve_withholding_islr/view/partner_view.xml (+0/-1)
l10n_ve_withholding_islr/view/product_view.xml (+1/-3)
l10n_ve_withholding_islr/view/wh_islr_view.xml (+1/-1)
l10n_ve_withholding_islr/workflow/account_workflow.xml (+3/-3)
l10n_ve_withholding_islr/workflow/islr_wh_workflow.xml (+7/-5)
l10n_ve_withholding_iva/model/__init__.py (+0/-1)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/ovl70-whislr-rev-hbto
Reviewer Review Type Date Requested Status
Nhomar - Vauxoo Pending
Gabriela Quilarque Pending
OpenERP para localización Venezolana. Pending
Review via email: mp+141206@code.launchpad.net

Description of the change

Segunda Revision exhaustiva al Modulo de retencion de impuesto sobre la renta
Second thoroughly revision to income withholding module

Faltan revision exhaustiva de la seccion del Cliente
Missing Thoroughly revision regarding Customer income withholdings

To post a comment you must log in.
Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

En esta revision se ha tratado al maximo de linealizar los procesos de retencion de
impuestos sobre la renta,

se ha intentado realizar una limpieza minuciosa de metodos que previamente redundaban
en el modelo account.invoice en todo el modulo.

Ahora el proceso de retencion para la parte de proveedor es mas limpio, y sencillo,
al menos para el programador, se ha intentado que sean tan similar al proceso de
retencion del IVA.

De tal manera que al ser mas lineal el proceso los reversos del documento se esperan
sean mas sencillos de llevar a cabo, siendo así que el anular una factura debera ser
en el futuro un proceso mas sencillo y menos traumaticos.

825. By hbto [Vauxoo] http://www.vauxoo.com

[FIX] Getting rid of the `type` field in the `ir.ui.view` model

826. By hbto [Vauxoo] http://www.vauxoo.com

[FIX] Making corrections to some misspellings

827. By hbto [Vauxoo] http://www.vauxoo.com

[FIX] Making corrections to some misspellings

828. By hbto [Vauxoo] http://www.vauxoo.com

[FIX] Making corrections to some misspellings

829. By hbto [Vauxoo] http://www.vauxoo.com

[FIX] Making corrections to some misspellings

830. By hbto [Vauxoo] http://www.vauxoo.com

[FIX] Making corrections to some misspellings

831. By hbto [Vauxoo] http://www.vauxoo.com

[IMP] Adding concept_id in customer invoice lines

TODO: This change has to be undone, and be replaced
with a fields_view_get()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_fiscal_requirements/model/res_users.py'
2--- l10n_ve_fiscal_requirements/model/res_users.py 2012-12-19 18:35:35 +0000
3+++ l10n_ve_fiscal_requirements/model/res_users.py 2012-12-26 22:37:22 +0000
4@@ -41,7 +41,6 @@
5
6 def write(self, cr, uid, ids, values, context=None):
7 context = context or {}
8- self.cache_restart(cr)
9 context.update({'create_company':True})
10 return super(res_users, self).write(cr, uid, ids, values, context=context)
11
12
13=== modified file 'l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py'
14--- l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py 2012-12-02 17:44:27 +0000
15+++ l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py 2012-12-26 22:37:22 +0000
16@@ -19,7 +19,6 @@
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #
19 ##############################################################################
20-import wizard
21 import pooler
22 from osv import osv, fields
23 from tools.translate import _
24
25=== modified file 'l10n_ve_fiscal_requirements/wizard/update_info_partner.py'
26--- l10n_ve_fiscal_requirements/wizard/update_info_partner.py 2012-12-02 18:34:29 +0000
27+++ l10n_ve_fiscal_requirements/wizard/update_info_partner.py 2012-12-26 22:37:22 +0000
28@@ -19,7 +19,6 @@
29 # along with this program. If not, see <http://www.gnu.org/licenses/>.
30 #
31 ##############################################################################
32-import wizard
33 import pooler
34 from osv import osv, fields
35 from tools.translate import _
36
37=== modified file 'l10n_ve_withholding_islr/__init__.py'
38--- l10n_ve_withholding_islr/__init__.py 2012-12-09 23:55:45 +0000
39+++ l10n_ve_withholding_islr/__init__.py 2012-12-26 22:37:22 +0000
40@@ -28,4 +28,4 @@
41 import model
42 import report
43 import wizard
44-import edi
45+#import edi
46
47=== modified file 'l10n_ve_withholding_islr/__openerp__.py'
48--- l10n_ve_withholding_islr/__openerp__.py 2012-12-18 17:46:39 +0000
49+++ l10n_ve_withholding_islr/__openerp__.py 2012-12-26 22:37:22 +0000
50@@ -27,16 +27,16 @@
51 ##############################################################################
52
53 {
54- "name" : "Automatically Calculation Withholding Income",
55+ "name" : "Automatically Calculation Income Withholding",
56 "version" : "0.1",
57 "author" : "Vauxoo",
58 "category" : "General",
59 "website": "http://wiki.openerp.org.ve/",
60- "description": ''' - Generate the voucher of withholding income to validate the invoice.
61- - Generate the report of voucher of withholding income.
62- - Generate the file .xml required by the Venezuelan laws, for agent of withholding income specials.
63+ "description": ''' - Generate the voucher of income withholding to validate the invoice.
64+ - Generate the report of voucher of income withholding.
65+ - Generate the file .xml required by the Venezuelan laws, for agent of income withholding specials.
66 - Generate view for load the concepts of wittholding whith their rates.
67- - Generate view for visualize the withholding income for suppilers and customers.
68+ - Generate view for visualize the income withholding for suppilers and customers.
69 - Load data of the 86 concepts of wittholdings whith their rates.
70 - Send an email to supplier with approved withholdings, if not opt_out in the partner
71 If you want be able to propose withholding concepts from sales and purchases you must install extra module @section{l10n_ve_sale_purchase}.
72@@ -63,7 +63,7 @@
73 "view/islr_xml_wh.xml",
74 "workflow/islr_wh_workflow.xml",
75 "workflow/account_workflow.xml",
76- "edi/islr_wh_doc_action_data.xml",
77+ #"edi/islr_wh_doc_action_data.xml",
78
79 ],
80 'test': [
81
82=== modified file 'l10n_ve_withholding_islr/demo/retencion_islr_sequence.xml'
83--- l10n_ve_withholding_islr/demo/retencion_islr_sequence.xml 2012-12-19 18:17:09 +0000
84+++ l10n_ve_withholding_islr/demo/retencion_islr_sequence.xml 2012-12-26 22:37:22 +0000
85@@ -4,12 +4,12 @@
86
87 <!-- Sequences type for account.retention -->
88 <record id="seq_type_islr_wh" model="ir.sequence.type">
89- <field name="name">Withholding Income</field>
90+ <field name="name">Income Withholding</field>
91 <field name="code">islr.wh.doc</field>
92 </record>
93
94 <record id="seq_account_wh_islr" model="ir.sequence">
95- <field name="name">Withholding Income</field>
96+ <field name="name">Income Withholding</field>
97 <field name="code">islr.wh.doc</field>
98 <field name="prefix">RE:</field>
99 <field name="padding">8</field>
100@@ -17,12 +17,12 @@
101 </record>
102
103 <record id="seq_type_wh_islr_purchase" model="ir.sequence.type">
104- <field name="name">Purchase Withholding Income</field>
105+ <field name="name">Purchase Income Withholding</field>
106 <field name="code">islr.wh.doc.in_invoice</field>
107 </record>
108
109 <record id="seq_wh_islr_purchase" model="ir.sequence">
110- <field name="name">Purchase Withholding Income</field>
111+ <field name="name">Purchase Income Withholding</field>
112 <field name="code">islr.wh.doc.in_invoice</field>
113 <field name="prefix">%(year)s-%(month)s-</field>
114 <field name="padding">8</field>
115@@ -30,12 +30,12 @@
116 </record>
117
118 <record id="seq_type_wh_islr_sales" model="ir.sequence.type">
119- <field name="name">Sale Withholding Income</field>
120+ <field name="name">Sale Income Withholding</field>
121 <field name="code">islr.wh.doc.out_invoice</field>
122 </record>
123
124 <record id="seq_wh_islr_sales" model="ir.sequence">
125- <field name="name">Sale Withholding Income</field>
126+ <field name="name">Sale Income Withholding</field>
127 <field name="code">islr.wh.doc.out_invoice</field>
128 <field name="prefix">%(year)s-%(month)s-</field>
129 <field name="padding">8</field>
130
131=== modified file 'l10n_ve_withholding_islr/i18n/es.po'
132--- l10n_ve_withholding_islr/i18n/es.po 2012-02-09 19:23:11 +0000
133+++ l10n_ve_withholding_islr/i18n/es.po 2012-12-26 22:37:22 +0000
134@@ -22,7 +22,7 @@
135
136 #. module: l10n_ve_withholding_islr
137 #: view:islr.wh.doc:0
138-msgid "Print Withholding Income"
139+msgid "Print Income Withholding"
140 msgstr "Imprimir comprobante de retención"
141
142 #. module: l10n_ve_withholding_islr
143@@ -37,7 +37,7 @@
144
145 #. module: l10n_ve_withholding_islr
146 #: field:islr.xml.wh.doc,amount_total_ret:0
147-msgid "Withholding Income Amount Total"
148+msgid "Income Withholding Amount Total"
149 msgstr "Monto Total de Retención de ISLR"
150
151 #. module: l10n_ve_withholding_islr
152@@ -53,7 +53,7 @@
153 #. module: l10n_ve_withholding_islr
154 #: code:addons/l10n_ve_withholding_islr/invoice.py:461
155 #, python-format
156-msgid "Impossible withholding income, because the journal of withholding income for the '%s' has not been created with the type '%s'"
157+msgid "Impossible income withholding, because the journal of income withholding for the '%s' has not been created with the type '%s'"
158 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que el diario de ISLR para la '%s' no ha sido creado con el tipo '%s'"
159
160 #. module: l10n_ve_withholding_islr
161@@ -63,7 +63,7 @@
162
163 #. module: l10n_ve_withholding_islr
164 #: help:res.partner,islr_withholding_agent:0
165-msgid "Check if the partner is an agent for withholding income"
166+msgid "Check if the partner is an agent for income withholding"
167 msgstr "Marque en caso de que la empresa sea agente de retención de ISLR"
168
169 #. module: l10n_ve_withholding_islr
170@@ -146,12 +146,12 @@
171 #. module: l10n_ve_withholding_islr
172 #: code:addons/l10n_ve_withholding_islr/invoice.py:171
173 #, python-format
174-msgid "Impossible withholding income, because the partner '%s' has not fiscal direction set!."
175+msgid "Impossible income withholding, because the partner '%s' has not fiscal direction set!."
176 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el partner '%s' no tiene dirección fiscal asociada!."
177
178 #. module: l10n_ve_withholding_islr
179 #: view:islr.wh.doc.line:0
180-msgid "Lines Withholding Income"
181+msgid "Lines Income Withholding"
182 msgstr "Líneas de Retención de ISLR"
183
184 #. module: l10n_ve_withholding_islr
185@@ -204,7 +204,7 @@
186
187 #. module: l10n_ve_withholding_islr
188 #: help:wh.islr.config,journal_sale:0
189-msgid "Journal for sale operations involving Withholding Income"
190+msgid "Journal for sale operations involving Income Withholding"
191 msgstr "Diario para operaciones de venta que involucran retención de ISLR"
192
193 #. module: l10n_ve_withholding_islr
194@@ -230,7 +230,7 @@
195
196 #. module: l10n_ve_withholding_islr
197 #: help:wh.islr.config,journal_purchase:0
198-msgid "Journal for purchase operations involving Withholding Income"
199+msgid "Journal for purchase operations involving Income Withholding"
200 msgstr "Diario para operaciones de venta que involucran ISLR"
201
202 #. module: l10n_ve_withholding_islr
203@@ -283,7 +283,7 @@
204 #: model:ir.actions.act_window,name:l10n_ve_withholding_islr.action_wh_islr_customer
205 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_action_wh_islr_customer
206 #: view:islr.wh.doc:0
207-msgid "Customer Withholding Income"
208+msgid "Customer Income Withholding"
209 msgstr "Retención de ISLR de Cliente"
210
211 #. module: l10n_ve_withholding_islr
212@@ -298,7 +298,7 @@
213
214 #. module: l10n_ve_withholding_islr
215 #: field:wh.islr.config,account_purchase:0
216-msgid "Account Withholding Income Purchase"
217+msgid "Account Income Withholding Purchase"
218 msgstr "Cuenta contable para ISLR (compras)"
219
220 #. module: l10n_ve_withholding_islr
221@@ -347,7 +347,7 @@
222 #: model:ir.actions.act_window,name:l10n_ve_withholding_islr.action_wh_islr_supplier
223 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_action_wh_islr_supplier
224 #: view:islr.wh.doc:0
225-msgid "Supplier Withholding Income"
226+msgid "Supplier Income Withholding"
227 msgstr "Retención de ISLR de Proveedores"
228
229 #. module: l10n_ve_withholding_islr
230@@ -373,7 +373,7 @@
231 #. module: l10n_ve_withholding_islr
232 #: code:addons/l10n_ve_withholding_islr/invoice.py:270
233 #, python-format
234-msgid "Impossible withholding income,because the invoice number: '%s' has not number reference free!"
235+msgid "Impossible income withholding,because the invoice number: '%s' has not number reference free!"
236 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que la factura número: '%s' no tiene Número de Referencia Libre!"
237
238 #. module: l10n_ve_withholding_islr
239@@ -425,7 +425,7 @@
240 #. module: l10n_ve_withholding_islr
241 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:282
242 #, python-format
243-msgid "Impossible withholding income, because the account for withholding of sale is not assigned to the Concept withholding '%s'!"
244+msgid "Impossible income withholding, because the account for withholding of sale is not assigned to the Concept withholding '%s'!"
245 msgstr "Imposible realizar Retención ISLR, debido a que la cuenta contable para retención de venta no esta asignada al Concepto '%s' !!"
246
247 #. module: l10n_ve_withholding_islr
248@@ -441,7 +441,7 @@
249 #. module: l10n_ve_withholding_islr
250 #: code:addons/l10n_ve_withholding_islr/invoice.py:194
251 #, python-format
252-msgid "Impossible withholding income, because the partner '%s' has not vat associated!"
253+msgid "Impossible income withholding, because the partner '%s' has not vat associated!"
254 msgstr "Imposible realizar Comprobante de Retencion ISLR, debido a que el partner, '%s' no tiene RIF asociado!"
255
256 #. module: l10n_ve_withholding_islr
257@@ -461,7 +461,7 @@
258
259 #. module: l10n_ve_withholding_islr
260 #: model:ir.actions.act_window,help:l10n_ve_withholding_islr.action_wh_islr_supplier
261-msgid "With Supplier Withholding you can manage document withholding issued to your suppliers. OpenERP can Just generate document withholding for purchase process automatically from invoices. To generate the withholding income and all accounting process you must confirm and validate the document withholding."
262+msgid "With Supplier Withholding you can manage document withholding issued to your suppliers. OpenERP can Just generate document withholding for purchase process automatically from invoices. To generate the income withholding and all accounting process you must confirm and validate the document withholding."
263 msgstr "A través de Retención de ISLR de proveedores usted prodrá gestionar el documento de retención emitido para sus proveedores. OpenERP también puede generar el documento de retención automáticamente desde la factura de proveedor. Para generar la retención se debe confirmar y validar el documento de retención."
264
265 #. module: l10n_ve_withholding_islr
266@@ -537,13 +537,13 @@
267
268 #. module: l10n_ve_withholding_islr
269 #: field:islr.xml.wh.line,islr_wh_doc_line_id:0
270-msgid "Withholding Income Document"
271+msgid "Income Withholding Document"
272 msgstr "Documento de Retención de ISLR"
273
274 #. module: l10n_ve_withholding_islr
275 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:288
276 #, python-format
277-msgid "Impossible withholding income, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!"
278+msgid "Impossible income withholding, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!"
279 msgstr "Imposible realizar Retención ISLR, debido a que la cuenta contable para retención de compra no esta asignada al Concepto '%s' !"
280
281 #. module: l10n_ve_withholding_islr
282@@ -629,7 +629,7 @@
283
284 #. module: l10n_ve_withholding_islr
285 #: help:account.invoice.line,concept_id:0
286-msgid "Concept of Withholding Income asociate this rate"
287+msgid "Concept of Income Withholding asociate this rate"
288 msgstr "Concepto de Retención asociado a esta tasa"
289
290 #. module: l10n_ve_withholding_islr
291@@ -649,7 +649,7 @@
292
293 #. module: l10n_ve_withholding_islr
294 #: view:islr.wh.doc:0
295-msgid "Search Withholding Income"
296+msgid "Search Income Withholding"
297 msgstr "Búsqueda - Documento de ISLR"
298
299 #. module: l10n_ve_withholding_islr
300@@ -665,7 +665,7 @@
301 #. module: l10n_ve_withholding_islr
302 #: code:addons/l10n_ve_withholding_islr/installer.py:92
303 #, python-format
304-msgid "Journal Withholding Income Purchase"
305+msgid "Journal Income Withholding Purchase"
306 msgstr "Diario ISLR para compras"
307
308 #. module: l10n_ve_withholding_islr
309@@ -680,12 +680,12 @@
310
311 #. module: l10n_ve_withholding_islr
312 #: field:wh.islr.config,wh_agent:0
313-msgid "Withholding Income Agent"
314+msgid "Income Withholding Agent"
315 msgstr "Eres agente de retención de ISLR?"
316
317 #. module: l10n_ve_withholding_islr
318 #: model:ir.module.module,shortdesc:l10n_ve_withholding_islr.module_meta_information
319-msgid "Automatically Calculation Withholding Income"
320+msgid "Automatically Calculation Income Withholding"
321 msgstr "Calculo Automático de Impuesto Sobre la Renta (ISLR)"
322
323 #. module: l10n_ve_withholding_islr
324@@ -701,7 +701,7 @@
325
326 #. module: l10n_ve_withholding_islr
327 #: model:ir.actions.act_window,help:l10n_ve_withholding_islr.action_wh_islr_concept
328-msgid "With \"Concept of Withholding Income\" you can create and manage the concept of wittholding income. For each concept is to create and manage rates associated."
329+msgid "With \"Concept of Income Withholding\" you can create and manage the concept of wittholding income. For each concept is to create and manage rates associated."
330 msgstr "A través de \"Concepto de Retención de ISLR\" usted podrá crear y gestionar los conceptos de retención de ISLR. Por cada concepto se puede crear y gestionar las tasas asociadas."
331
332 #. module: l10n_ve_withholding_islr
333@@ -712,7 +712,7 @@
334
335 #. module: l10n_ve_withholding_islr
336 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_doc_line
337-msgid "Lines of Document Withholding Income"
338+msgid "Lines of Document Income Withholding"
339 msgstr "Líneas del Documento de Retención de ISLR"
340
341 #. module: l10n_ve_withholding_islr
342@@ -757,7 +757,7 @@
343 #. module: l10n_ve_withholding_islr
344 #: model:ir.actions.report.xml,name:l10n_ve_withholding_islr.list_report_withholding_islr
345 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_wh_configuration_islr
346-msgid "Withholding Income"
347+msgid "Income Withholding"
348 msgstr "Retención de ISLR"
349
350 #. module: l10n_ve_withholding_islr
351@@ -777,7 +777,7 @@
352
353 #. module: l10n_ve_withholding_islr
354 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_doc
355-msgid "Document Withholding Income"
356+msgid "Document Income Withholding"
357 msgstr "Documento de Retención de ISLR"
358
359 #. module: l10n_ve_withholding_islr
360@@ -787,7 +787,7 @@
361
362 #. module: l10n_ve_withholding_islr
363 #: help:product.template,concept_id:0
364-msgid "Concept Withholding Income to apply to the service"
365+msgid "Concept Income Withholding to apply to the service"
366 msgstr "Concepto de Retención a aplicar para el servicio"
367
368 #. module: l10n_ve_withholding_islr
369@@ -812,7 +812,7 @@
370
371 #. module: l10n_ve_withholding_islr
372 #: model:ir.actions.report.xml,name:l10n_ve_withholding_islr.voucher_report_withholding_islr
373-msgid "Voucher Withholding Income"
374+msgid "Voucher Income Withholding"
375 msgstr "Comprobante de ISLR"
376
377 #. module: l10n_ve_withholding_islr
378@@ -827,7 +827,7 @@
379
380 #. module: l10n_ve_withholding_islr
381 #: view:islr.wh.doc.line:0
382-msgid "Detail of the Concept of Withholding Income"
383+msgid "Detail of the Concept of Income Withholding"
384 msgstr "Detalle del Concepto de Retención de ISLR"
385
386 #. module: l10n_ve_withholding_islr
387@@ -871,7 +871,7 @@
388 #. module: l10n_ve_withholding_islr
389 #: code:addons/l10n_ve_withholding_islr/installer.py:93
390 #, python-format
391-msgid "Journal Withholding Income Sale"
392+msgid "Journal Income Withholding Sale"
393 msgstr "Diario ISLR para ventas"
394
395 #. module: l10n_ve_withholding_islr
396@@ -973,7 +973,7 @@
397
398 #. module: l10n_ve_withholding_islr
399 #: field:wh.islr.config,account_sale:0
400-msgid "Account Withholding Income Sale"
401+msgid "Account Income Withholding Sale"
402 msgstr "Cuenta contable ISLR (ventas)"
403
404 #. module: l10n_ve_withholding_islr
405@@ -1014,7 +1014,7 @@
406 #. module: l10n_ve_withholding_islr
407 #: code:addons/l10n_ve_withholding_islr/invoice.py:229
408 #, python-format
409-msgid "Impossible withholding income, because the Concept of Withholding associated with type line is not withheld!"
410+msgid "Impossible income withholding, because the Concept of Withholding associated with type line is not withheld!"
411 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que el Concepto de Retención asociado a la línea no es de tipo Retenible!"
412
413 #. module: l10n_ve_withholding_islr
414@@ -1037,7 +1037,7 @@
415 #. module: l10n_ve_withholding_islr
416 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_concept
417 #: field:islr.wh.doc,concept_ids:0
418-msgid "Withholding Income Concept"
419+msgid "Income Withholding Concept"
420 msgstr "Concepto de Retención de ISLR"
421
422 #. module: l10n_ve_withholding_islr
423@@ -1052,7 +1052,7 @@
424
425 #. module: l10n_ve_withholding_islr
426 #: help:wh.islr.config,account_purchase:0
427-msgid "Account for purchase operations involving Withholding Income"
428+msgid "Account for purchase operations involving Income Withholding"
429 msgstr "Cuenta contable para operaciones de compra que involucran ISLR"
430
431 #. module: l10n_ve_withholding_islr
432@@ -1077,8 +1077,8 @@
433
434 #. module: l10n_ve_withholding_islr
435 #: help:islr.xml.wh.doc,name:0
436-msgid "Description about statement of withholding income"
437-msgstr "Description about statement of withholding income"
438+msgid "Description about statement of income withholding"
439+msgstr "Description about statement of income withholding"
440
441 #. module: l10n_ve_withholding_islr
442 #: report:islr.wh.doc:0
443@@ -1087,12 +1087,12 @@
444
445 #. module: l10n_ve_withholding_islr
446 #: view:islr.wh.concept:0
447-msgid "Search Concept of Withholding Income"
448+msgid "Search Concept of Income Withholding"
449 msgstr "Búsqueda - Concepto de Retención de ISLR"
450
451 #. module: l10n_ve_withholding_islr
452 #: field:res.partner,islr_withholding_agent:0
453-msgid "Withholding Income Agent?"
454+msgid "Income Withholding Agent?"
455 msgstr "Agente de Retención de ISLR?"
456
457 #. module: l10n_ve_withholding_islr
458@@ -1173,7 +1173,7 @@
459 #. module: l10n_ve_withholding_islr
460 #: code:addons/l10n_ve_withholding_islr/invoice.py:166
461 #, python-format
462-msgid "Impossible withholding income, because the partner '%s' country has not defined direction in fiscal!"
463+msgid "Impossible income withholding, because the partner '%s' country has not defined direction in fiscal!"
464 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el partner '%s' no tiene país en su facturación fiscal!"
465
466 #. module: l10n_ve_withholding_islr
467@@ -1251,7 +1251,7 @@
468
469 #. module: l10n_ve_withholding_islr
470 #: help:wh.islr.config,account_sale:0
471-msgid "Account for sale operations involving Withholding Income"
472+msgid "Account for sale operations involving Income Withholding"
473 msgstr "Cuenta para operaciones de ventas que involucran ISLR"
474
475 #. module: l10n_ve_withholding_islr
476@@ -1293,7 +1293,7 @@
477 #. module: l10n_ve_withholding_islr
478 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:410
479 #, python-format
480-msgid "Impossible withholding income, because the supplier '%s' withholding agent is not!"
481+msgid "Impossible income withholding, because the supplier '%s' withholding agent is not!"
482 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el comprador '%s' no es agente de Retención!"
483
484 #. module: l10n_ve_withholding_islr
485@@ -1304,22 +1304,22 @@
486 #. module: l10n_ve_withholding_islr
487 #: model:ir.module.module,description:l10n_ve_withholding_islr.module_meta_information
488 msgid "\n"
489-" ----------Automatically Calculated Withholding Income------------\n"
490+" ----------Automatically Calculated Income Withholding------------\n"
491 "\n"
492 " What make this module?\n"
493 " \n"
494-" --Generate the voucher of withholding income to validate the invoice.\n"
495-" --Generate the report of voucher of withholding income.\n"
496+" --Generate the voucher of income withholding to validate the invoice.\n"
497+" --Generate the report of voucher of income withholding.\n"
498 " --Generate the file .xml required by the Venezuelan laws, for agent\n"
499-" of withholding income specials.\n"
500+" of income withholding specials.\n"
501 " --Generate view for load the concepts of wittholding whith their rates.\n"
502-" --Generate view for visualize the withholding income for suppilers and \n"
503+" --Generate view for visualize the income withholding for suppilers and \n"
504 " customers.\n"
505 " --Load data of the 86 concepts of wittholdings whith their rates.\n"
506 "\n"
507 " Impromevents\n"
508 " \n"
509-" --For include the functionality of the withholding income to sales, \n"
510+" --For include the functionality of the income withholding to sales, \n"
511 " purchases and stock you should installer the module: l10n_ve_sale_purchase.\n"
512 " "
513 msgstr "\n"
514@@ -1352,7 +1352,7 @@
515 #. module: l10n_ve_withholding_islr
516 #: code:addons/l10n_ve_withholding_islr/product.py:62
517 #, python-format
518-msgid "Must create the concept of withholding income"
519+msgid "Must create the concept of income withholding"
520 msgstr "Debe crear el concepto de retención de ISLR"
521
522 #. module: l10n_ve_withholding_islr
523@@ -1368,12 +1368,12 @@
524 #: view:islr.xml.wh.line:0
525 #: view:product.product:0
526 #: view:product.template:0
527-msgid "Concept of Withholding Income"
528+msgid "Concept of Income Withholding"
529 msgstr "Concepto de Retención de ISLR"
530
531 #. module: l10n_ve_withholding_islr
532 #: help:wh.islr.config,wh_agent:0
533-msgid "Check if this company is a withholding income agent"
534+msgid "Check if this company is a income withholding agent"
535 msgstr "Determine si su cumpañía es un agente de retención de ISLR"
536
537 #. module: l10n_ve_withholding_islr
538@@ -1384,7 +1384,7 @@
539 #. module: l10n_ve_withholding_islr
540 #: code:addons/l10n_ve_withholding_islr/invoice.py:280
541 #, python-format
542-msgid "Impossible withholding income, because the invoice number: '%s' has not control number associated!"
543+msgid "Impossible income withholding, because the invoice number: '%s' has not control number associated!"
544 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que la factura número: '%s' no tiene Número de Control Asociado!"
545
546 #. module: l10n_ve_withholding_islr
547@@ -1425,12 +1425,12 @@
548 #. module: l10n_ve_withholding_islr
549 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:412
550 #, python-format
551-msgid "Impossible withholding income, because the lines of the invoice has not concept withholding!"
552+msgid "Impossible income withholding, because the lines of the invoice has not concept withholding!"
553 msgstr "Imposible realizar retención de ISLR, porque las lineas de la factura no tienen concepto de retención asociado!"
554
555 #. module: l10n_ve_withholding_islr
556 #: view:wh.islr.config:0
557-msgid "Withholding income Configuration"
558+msgid "Income withholding Configuration"
559 msgstr "Configuración de la Retención de ISLR"
560
561 #. module: l10n_ve_withholding_islr
562@@ -1441,7 +1441,7 @@
563 #. module: l10n_ve_withholding_islr
564 #: view:wh.islr.config:0
565 msgid "\n"
566-"Configure your company's withholding income \n"
567+"Configure your company's income withholding \n"
568 " "
569 msgstr "\n"
570 "Configure los datos de su compañía para la Retención del Impuesto Sobre La Renta (ISLR) \n"
571
572=== modified file 'l10n_ve_withholding_islr/i18n/es_VE.po'
573--- l10n_ve_withholding_islr/i18n/es_VE.po 2012-02-09 19:23:11 +0000
574+++ l10n_ve_withholding_islr/i18n/es_VE.po 2012-12-26 22:37:22 +0000
575@@ -27,7 +27,7 @@
576
577 #. module: l10n_ve_withholding_islr
578 #: view:islr.wh.doc:0
579-msgid "Print Withholding Income"
580+msgid "Print Income Withholding"
581 msgstr "Imprimir comprobante de retención"
582
583
584@@ -38,7 +38,7 @@
585
586 #. module: l10n_ve_withholding_islr
587 #: field:islr.xml.wh.doc,amount_total_ret:0
588-msgid "Withholding Income Amount Total"
589+msgid "Income Withholding Amount Total"
590 msgstr "Monto Total de Retención de ISLR"
591
592 #. module: l10n_ve_withholding_islr
593@@ -54,7 +54,7 @@
594 #. module: l10n_ve_withholding_islr
595 #: code:addons/l10n_ve_withholding_islr/invoice.py:461
596 #, python-format
597-msgid "Impossible withholding income, because the journal of withholding income for the '%s' has not been created with the type '%s'"
598+msgid "Impossible income withholding, because the journal of income withholding for the '%s' has not been created with the type '%s'"
599 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que el diario de ISLR para la '%s' no ha sido creado con el tipo '%s'"
600
601 #. module: l10n_ve_withholding_islr
602@@ -64,7 +64,7 @@
603
604 #. module: l10n_ve_withholding_islr
605 #: help:res.partner,islr_withholding_agent:0
606-msgid "Check if the partner is an agent for withholding income"
607+msgid "Check if the partner is an agent for income withholding"
608 msgstr "Marque en caso de que la empresa sea agente de retención de ISLR"
609
610 #. module: l10n_ve_withholding_islr
611@@ -147,12 +147,12 @@
612 #. module: l10n_ve_withholding_islr
613 #: code:addons/l10n_ve_withholding_islr/invoice.py:171
614 #, python-format
615-msgid "Impossible withholding income, because the partner '%s' has not fiscal direction set!."
616+msgid "Impossible income withholding, because the partner '%s' has not fiscal direction set!."
617 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el partner '%s' no tiene dirección fiscal asociada!."
618
619 #. module: l10n_ve_withholding_islr
620 #: view:islr.wh.doc.line:0
621-msgid "Lines Withholding Income"
622+msgid "Lines Income Withholding"
623 msgstr "Líneas de Retención de ISLR"
624
625 #. module: l10n_ve_withholding_islr
626@@ -205,7 +205,7 @@
627
628 #. module: l10n_ve_withholding_islr
629 #: help:wh.islr.config,journal_sale:0
630-msgid "Journal for sale operations involving Withholding Income"
631+msgid "Journal for sale operations involving Income Withholding"
632 msgstr "Diario para operaciones de venta que involucran retención de ISLR"
633
634 #. module: l10n_ve_withholding_islr
635@@ -231,7 +231,7 @@
636
637 #. module: l10n_ve_withholding_islr
638 #: help:wh.islr.config,journal_purchase:0
639-msgid "Journal for purchase operations involving Withholding Income"
640+msgid "Journal for purchase operations involving Income Withholding"
641 msgstr "Diario para operaciones de venta que involucran ISLR"
642
643 #. module: l10n_ve_withholding_islr
644@@ -284,7 +284,7 @@
645 #: model:ir.actions.act_window,name:l10n_ve_withholding_islr.action_wh_islr_customer
646 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_action_wh_islr_customer
647 #: view:islr.wh.doc:0
648-msgid "Customer Withholding Income"
649+msgid "Customer Income Withholding"
650 msgstr "Retención de ISLR de Cliente"
651
652 #. module: l10n_ve_withholding_islr
653@@ -299,7 +299,7 @@
654
655 #. module: l10n_ve_withholding_islr
656 #: field:wh.islr.config,account_purchase:0
657-msgid "Account Withholding Income Purchase"
658+msgid "Account Income Withholding Purchase"
659 msgstr "Cuenta contable para ISLR (compras)"
660
661 #. module: l10n_ve_withholding_islr
662@@ -348,7 +348,7 @@
663 #: model:ir.actions.act_window,name:l10n_ve_withholding_islr.action_wh_islr_supplier
664 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_action_wh_islr_supplier
665 #: view:islr.wh.doc:0
666-msgid "Supplier Withholding Income"
667+msgid "Supplier Income Withholding"
668 msgstr "Retención de ISLR de Proveedores"
669
670 #. module: l10n_ve_withholding_islr
671@@ -374,7 +374,7 @@
672 #. module: l10n_ve_withholding_islr
673 #: code:addons/l10n_ve_withholding_islr/invoice.py:270
674 #, python-format
675-msgid "Impossible withholding income,because the invoice number: '%s' has not number reference free!"
676+msgid "Impossible income withholding,because the invoice number: '%s' has not number reference free!"
677 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que la factura número: '%s' no tiene Número de Referencia Libre!"
678
679 #. module: l10n_ve_withholding_islr
680@@ -426,7 +426,7 @@
681 #. module: l10n_ve_withholding_islr
682 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:282
683 #, python-format
684-msgid "Impossible withholding income, because the account for withholding of sale is not assigned to the Concept withholding '%s'!"
685+msgid "Impossible income withholding, because the account for withholding of sale is not assigned to the Concept withholding '%s'!"
686 msgstr "Imposible realizar Retención ISLR, debido a que la cuenta contable para retención de venta no esta asignada al Concepto '%s' !!"
687
688 #. module: l10n_ve_withholding_islr
689@@ -442,7 +442,7 @@
690 #. module: l10n_ve_withholding_islr
691 #: code:addons/l10n_ve_withholding_islr/invoice.py:194
692 #, python-format
693-msgid "Impossible withholding income, because the partner '%s' has not vat associated!"
694+msgid "Impossible income withholding, because the partner '%s' has not vat associated!"
695 msgstr "Imposible realizar Comprobante de Retencion ISLR, debido a que el partner, '%s' no tiene RIF asociado!"
696
697 #. module: l10n_ve_withholding_islr
698@@ -462,7 +462,7 @@
699
700 #. module: l10n_ve_withholding_islr
701 #: model:ir.actions.act_window,help:l10n_ve_withholding_islr.action_wh_islr_supplier
702-msgid "With Supplier Withholding you can manage document withholding issued to your suppliers. OpenERP can Just generate document withholding for purchase process automatically from invoices. To generate the withholding income and all accounting process you must confirm and validate the document withholding."
703+msgid "With Supplier Withholding you can manage document withholding issued to your suppliers. OpenERP can Just generate document withholding for purchase process automatically from invoices. To generate the income withholding and all accounting process you must confirm and validate the document withholding."
704 msgstr "A través de Retención de ISLR de proveedores usted prodrá gestionar el documento de retención emitido para sus proveedores. OpenERP también puede generar el documento de retención automáticamente desde la factura de proveedor. Para generar la retención se debe confirmar y validar el documento de retención."
705
706 #. module: l10n_ve_withholding_islr
707@@ -538,13 +538,13 @@
708
709 #. module: l10n_ve_withholding_islr
710 #: field:islr.xml.wh.line,islr_wh_doc_line_id:0
711-msgid "Withholding Income Document"
712+msgid "Income Withholding Document"
713 msgstr "Documento de Retención de ISLR"
714
715 #. module: l10n_ve_withholding_islr
716 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:288
717 #, python-format
718-msgid "Impossible withholding income, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!"
719+msgid "Impossible income withholding, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!"
720 msgstr "Imposible realizar Retención ISLR, debido a que la cuenta contable para retención de compra no esta asignada al Concepto '%s' !"
721
722 #. module: l10n_ve_withholding_islr
723@@ -630,7 +630,7 @@
724
725 #. module: l10n_ve_withholding_islr
726 #: help:account.invoice.line,concept_id:0
727-msgid "Concept of Withholding Income asociate this rate"
728+msgid "Concept of Income Withholding asociate this rate"
729 msgstr "Concepto de Retención asociado a esta tasa"
730
731 #. module: l10n_ve_withholding_islr
732@@ -650,7 +650,7 @@
733
734 #. module: l10n_ve_withholding_islr
735 #: view:islr.wh.doc:0
736-msgid "Search Withholding Income"
737+msgid "Search Income Withholding"
738 msgstr "Búsqueda - Documento de ISLR"
739
740 #. module: l10n_ve_withholding_islr
741@@ -666,7 +666,7 @@
742 #. module: l10n_ve_withholding_islr
743 #: code:addons/l10n_ve_withholding_islr/installer.py:92
744 #, python-format
745-msgid "Journal Withholding Income Purchase"
746+msgid "Journal Income Withholding Purchase"
747 msgstr "Diario ISLR para compras"
748
749 #. module: l10n_ve_withholding_islr
750@@ -681,12 +681,12 @@
751
752 #. module: l10n_ve_withholding_islr
753 #: field:wh.islr.config,wh_agent:0
754-msgid "Withholding Income Agent"
755+msgid "Income Withholding Agent"
756 msgstr "Eres agente de retención de ISLR?"
757
758 #. module: l10n_ve_withholding_islr
759 #: model:ir.module.module,shortdesc:l10n_ve_withholding_islr.module_meta_information
760-msgid "Automatically Calculation Withholding Income"
761+msgid "Automatically Calculation Income Withholding"
762 msgstr "Calculo Automático de Impuesto Sobre la Renta (ISLR)"
763
764 #. module: l10n_ve_withholding_islr
765@@ -702,7 +702,7 @@
766
767 #. module: l10n_ve_withholding_islr
768 #: model:ir.actions.act_window,help:l10n_ve_withholding_islr.action_wh_islr_concept
769-msgid "With \"Concept of Withholding Income\" you can create and manage the concept of wittholding income. For each concept is to create and manage rates associated."
770+msgid "With \"Concept of Income Withholding\" you can create and manage the concept of wittholding income. For each concept is to create and manage rates associated."
771 msgstr "A través de \"Concepto de Retención de ISLR\" usted podrá crear y gestionar los conceptos de retención de ISLR. Por cada concepto se puede crear y gestionar las tasas asociadas."
772
773 #. module: l10n_ve_withholding_islr
774@@ -713,7 +713,7 @@
775
776 #. module: l10n_ve_withholding_islr
777 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_doc_line
778-msgid "Lines of Document Withholding Income"
779+msgid "Lines of Document Income Withholding"
780 msgstr "Líneas del Documento de Retención de ISLR"
781
782 #. module: l10n_ve_withholding_islr
783@@ -758,7 +758,7 @@
784 #. module: l10n_ve_withholding_islr
785 #: model:ir.actions.report.xml,name:l10n_ve_withholding_islr.list_report_withholding_islr
786 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_wh_configuration_islr
787-msgid "Withholding Income"
788+msgid "Income Withholding"
789 msgstr "Retención de ISLR"
790
791 #. module: l10n_ve_withholding_islr
792@@ -778,7 +778,7 @@
793
794 #. module: l10n_ve_withholding_islr
795 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_doc
796-msgid "Document Withholding Income"
797+msgid "Document Income Withholding"
798 msgstr "Documento de Retención de ISLR"
799
800 #. module: l10n_ve_withholding_islr
801@@ -788,7 +788,7 @@
802
803 #. module: l10n_ve_withholding_islr
804 #: help:product.template,concept_id:0
805-msgid "Concept Withholding Income to apply to the service"
806+msgid "Concept Income Withholding to apply to the service"
807 msgstr "Concepto de Retención a aplicar para el servicio"
808
809 #. module: l10n_ve_withholding_islr
810@@ -813,7 +813,7 @@
811
812 #. module: l10n_ve_withholding_islr
813 #: model:ir.actions.report.xml,name:l10n_ve_withholding_islr.voucher_report_withholding_islr
814-msgid "Voucher Withholding Income"
815+msgid "Voucher Income Withholding"
816 msgstr "Comprobante de ISLR"
817
818 #. module: l10n_ve_withholding_islr
819@@ -828,7 +828,7 @@
820
821 #. module: l10n_ve_withholding_islr
822 #: view:islr.wh.doc.line:0
823-msgid "Detail of the Concept of Withholding Income"
824+msgid "Detail of the Concept of Income Withholding"
825 msgstr "Detalle del Concepto de Retención de ISLR"
826
827 #. module: l10n_ve_withholding_islr
828@@ -872,7 +872,7 @@
829 #. module: l10n_ve_withholding_islr
830 #: code:addons/l10n_ve_withholding_islr/installer.py:93
831 #, python-format
832-msgid "Journal Withholding Income Sale"
833+msgid "Journal Income Withholding Sale"
834 msgstr "Diario ISLR para ventas"
835
836 #. module: l10n_ve_withholding_islr
837@@ -974,7 +974,7 @@
838
839 #. module: l10n_ve_withholding_islr
840 #: field:wh.islr.config,account_sale:0
841-msgid "Account Withholding Income Sale"
842+msgid "Account Income Withholding Sale"
843 msgstr "Cuenta contable ISLR (ventas)"
844
845 #. module: l10n_ve_withholding_islr
846@@ -1015,7 +1015,7 @@
847 #. module: l10n_ve_withholding_islr
848 #: code:addons/l10n_ve_withholding_islr/invoice.py:229
849 #, python-format
850-msgid "Impossible withholding income, because the Concept of Withholding associated with type line is not withheld!"
851+msgid "Impossible income withholding, because the Concept of Withholding associated with type line is not withheld!"
852 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que el Concepto de Retención asociado a la línea no es de tipo Retenible!"
853
854 #. module: l10n_ve_withholding_islr
855@@ -1038,7 +1038,7 @@
856 #. module: l10n_ve_withholding_islr
857 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_concept
858 #: field:islr.wh.doc,concept_ids:0
859-msgid "Withholding Income Concept"
860+msgid "Income Withholding Concept"
861 msgstr "Concepto de Retención de ISLR"
862
863 #. module: l10n_ve_withholding_islr
864@@ -1053,7 +1053,7 @@
865
866 #. module: l10n_ve_withholding_islr
867 #: help:wh.islr.config,account_purchase:0
868-msgid "Account for purchase operations involving Withholding Income"
869+msgid "Account for purchase operations involving Income Withholding"
870 msgstr "Cuenta contable para operaciones de compra que involucran ISLR"
871
872 #. module: l10n_ve_withholding_islr
873@@ -1078,8 +1078,8 @@
874
875 #. module: l10n_ve_withholding_islr
876 #: help:islr.xml.wh.doc,name:0
877-msgid "Description about statement of withholding income"
878-msgstr "Description about statement of withholding income"
879+msgid "Description about statement of income withholding"
880+msgstr "Description about statement of income withholding"
881
882 #. module: l10n_ve_withholding_islr
883 #: report:islr.wh.doc:0
884@@ -1088,12 +1088,12 @@
885
886 #. module: l10n_ve_withholding_islr
887 #: view:islr.wh.concept:0
888-msgid "Search Concept of Withholding Income"
889+msgid "Search Concept of Income Withholding"
890 msgstr "Búsqueda - Concepto de Retención de ISLR"
891
892 #. module: l10n_ve_withholding_islr
893 #: field:res.partner,islr_withholding_agent:0
894-msgid "Withholding Income Agent?"
895+msgid "Income Withholding Agent?"
896 msgstr "Agente de Retención de ISLR?"
897
898 #. module: l10n_ve_withholding_islr
899@@ -1174,7 +1174,7 @@
900 #. module: l10n_ve_withholding_islr
901 #: code:addons/l10n_ve_withholding_islr/invoice.py:166
902 #, python-format
903-msgid "Impossible withholding income, because the partner '%s' country has not defined direction in fiscal!"
904+msgid "Impossible income withholding, because the partner '%s' country has not defined direction in fiscal!"
905 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el partner '%s' no tiene país en su facturación fiscal!"
906
907 #. module: l10n_ve_withholding_islr
908@@ -1252,7 +1252,7 @@
909
910 #. module: l10n_ve_withholding_islr
911 #: help:wh.islr.config,account_sale:0
912-msgid "Account for sale operations involving Withholding Income"
913+msgid "Account for sale operations involving Income Withholding"
914 msgstr "Cuenta para operaciones de ventas que involucran ISLR"
915
916 #. module: l10n_ve_withholding_islr
917@@ -1294,7 +1294,7 @@
918 #. module: l10n_ve_withholding_islr
919 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:410
920 #, python-format
921-msgid "Impossible withholding income, because the supplier '%s' withholding agent is not!"
922+msgid "Impossible income withholding, because the supplier '%s' withholding agent is not!"
923 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el comprador '%s' no es agente de Retención!"
924
925 #. module: l10n_ve_withholding_islr
926@@ -1305,22 +1305,22 @@
927 #. module: l10n_ve_withholding_islr
928 #: model:ir.module.module,description:l10n_ve_withholding_islr.module_meta_information
929 msgid "\n"
930-" ----------Automatically Calculated Withholding Income------------\n"
931+" ----------Automatically Calculated Income Withholding------------\n"
932 "\n"
933 " What make this module?\n"
934 " \n"
935-" --Generate the voucher of withholding income to validate the invoice.\n"
936-" --Generate the report of voucher of withholding income.\n"
937+" --Generate the voucher of income withholding to validate the invoice.\n"
938+" --Generate the report of voucher of income withholding.\n"
939 " --Generate the file .xml required by the Venezuelan laws, for agent\n"
940-" of withholding income specials.\n"
941+" of income withholding specials.\n"
942 " --Generate view for load the concepts of wittholding whith their rates.\n"
943-" --Generate view for visualize the withholding income for suppilers and \n"
944+" --Generate view for visualize the income withholding for suppilers and \n"
945 " customers.\n"
946 " --Load data of the 86 concepts of wittholdings whith their rates.\n"
947 "\n"
948 " Impromevents\n"
949 " \n"
950-" --For include the functionality of the withholding income to sales, \n"
951+" --For include the functionality of the income withholding to sales, \n"
952 " purchases and stock you should installer the module: l10n_ve_sale_purchase.\n"
953 " "
954 msgstr "\n"
955@@ -1353,7 +1353,7 @@
956 #. module: l10n_ve_withholding_islr
957 #: code:addons/l10n_ve_withholding_islr/product.py:62
958 #, python-format
959-msgid "Must create the concept of withholding income"
960+msgid "Must create the concept of income withholding"
961 msgstr "Debe crear el concepto de retención de ISLR"
962
963 #. module: l10n_ve_withholding_islr
964@@ -1369,12 +1369,12 @@
965 #: view:islr.xml.wh.line:0
966 #: view:product.product:0
967 #: view:product.template:0
968-msgid "Concept of Withholding Income"
969+msgid "Concept of Income Withholding"
970 msgstr "Concepto de Retención de ISLR"
971
972 #. module: l10n_ve_withholding_islr
973 #: help:wh.islr.config,wh_agent:0
974-msgid "Check if this company is a withholding income agent"
975+msgid "Check if this company is a income withholding agent"
976 msgstr "Determine si su cumpañía es un agente de retención de ISLR"
977
978 #. module: l10n_ve_withholding_islr
979@@ -1385,7 +1385,7 @@
980 #. module: l10n_ve_withholding_islr
981 #: code:addons/l10n_ve_withholding_islr/invoice.py:280
982 #, python-format
983-msgid "Impossible withholding income, because the invoice number: '%s' has not control number associated!"
984+msgid "Impossible income withholding, because the invoice number: '%s' has not control number associated!"
985 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que la factura número: '%s' no tiene Número de Control Asociado!"
986
987 #. module: l10n_ve_withholding_islr
988@@ -1426,12 +1426,12 @@
989 #. module: l10n_ve_withholding_islr
990 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:412
991 #, python-format
992-msgid "Impossible withholding income, because the lines of the invoice has not concept withholding!"
993+msgid "Impossible income withholding, because the lines of the invoice has not concept withholding!"
994 msgstr "Imposible realizar retención de ISLR, porque las lineas de la factura no tienen concepto de retención asociado!"
995
996 #. module: l10n_ve_withholding_islr
997 #: view:wh.islr.config:0
998-msgid "Withholding income Configuration"
999+msgid "Income withholding Configuration"
1000 msgstr "Configuración de la Retención de ISLR"
1001
1002 #. module: l10n_ve_withholding_islr
1003@@ -1442,7 +1442,7 @@
1004 #. module: l10n_ve_withholding_islr
1005 #: view:wh.islr.config:0
1006 msgid "\n"
1007-"Configure your company's withholding income \n"
1008+"Configure your company's income withholding \n"
1009 " "
1010 msgstr "\n"
1011 "Configure los datos de su compañía para la Retención del Impuesto Sobre La Renta (ISLR) \n"
1012
1013=== modified file 'l10n_ve_withholding_islr/model/installer.py'
1014--- l10n_ve_withholding_islr/model/installer.py 2012-12-09 23:55:45 +0000
1015+++ l10n_ve_withholding_islr/model/installer.py 2012-12-26 22:37:22 +0000
1016@@ -74,24 +74,24 @@
1017 self._set_wh_agent(cr, uid)
1018
1019 _columns = {
1020- 'journal_purchase': fields.char("Journal Wh Income Purchase", 64, help="Journal for purchase operations involving Withholding Income"),
1021- 'journal_sale': fields.char("Journal Wh Income Sale", 64, help="Journal for sale operations involving Withholding Income"),
1022+ 'journal_purchase': fields.char("Journal Wh Income Purchase", 64, help="Journal for purchase operations involving Income Withholding"),
1023+ 'journal_sale': fields.char("Journal Wh Income Sale", 64, help="Journal for sale operations involving Income Withholding"),
1024 'account_purchase': fields.many2one(
1025 "account.account",
1026- "Account Withholding Income Purchase",
1027- help="Account for purchase operations involving Withholding Income"
1028+ "Account Income Withholding Purchase",
1029+ help="Account for purchase operations involving Income Withholding"
1030 ),
1031 'account_sale': fields.many2one(
1032 "account.account",
1033- "Account Withholding Income Sale",
1034- help="Account for sale operations involving Withholding Income",
1035+ "Account Income Withholding Sale",
1036+ help="Account for sale operations involving Income Withholding",
1037 ),
1038- 'wh_agent': fields.boolean("Withholding Income Agent", help="Check if this company is a withholding income agent"),
1039+ 'wh_agent': fields.boolean("Income Withholding Agent", help="Check if this company is a income withholding agent"),
1040 }
1041
1042 _defaults = {
1043- 'journal_purchase': _("Journal Withholding Income Purchase"),
1044- 'journal_sale': _("Journal Withholding Income Sale"),
1045+ 'journal_purchase': _("Journal Income Withholding Purchase"),
1046+ 'journal_sale': _("Journal Income Withholding Sale"),
1047 }
1048
1049 wh_islr_config()
1050
1051=== modified file 'l10n_ve_withholding_islr/model/invoice.py'
1052--- l10n_ve_withholding_islr/model/invoice.py 2012-12-09 23:55:45 +0000
1053+++ l10n_ve_withholding_islr/model/invoice.py 2012-12-26 22:37:22 +0000
1054@@ -39,7 +39,7 @@
1055 _inherit = "account.invoice.line"
1056 _columns = {
1057 'apply_wh': fields.boolean('Withheld',help="Indicates whether a line has been retained or not, to accumulate the amount to withhold next month, according to the lines that have not been retained."),
1058- 'concept_id': fields.many2one('islr.wh.concept','Withholding Concept',help="Concept of Withholding Income asociate this rate",required=False),
1059+ 'concept_id': fields.many2one('islr.wh.concept','Withholding Concept',help="Concept of Income Withholding asociate this rate",required=False),
1060 }
1061 _defaults = {
1062 'apply_wh': lambda *a: False,
1063@@ -93,6 +93,76 @@
1064 _defaults = {
1065 'status': lambda *a: "no_pro",
1066 }
1067+## BEGIN OF REWRITING ISLR
1068+
1069+ def check_invoice_type(self, cr, uid, ids, context=None):
1070+ '''
1071+ This method check if the given invoice record is from a supplier
1072+ '''
1073+ context = context or {}
1074+ ids = isinstance(ids, (int, long)) and [ids] or ids
1075+ inv_brw = self.browse(cr, uid, ids[0],context=context)
1076+ return inv_brw.type in ('in_invoice', 'in_refund')
1077+
1078+ def check_withholdable_concept(self, cr, uid, ids, context=None):
1079+ '''
1080+ Check if the given invoice record is ISLR Withholdable
1081+ '''
1082+ context = context or {}
1083+ ids = isinstance(ids, (int, long)) and [ids] or ids
1084+ iwdi_obj = self.pool.get('islr.wh.doc.invoices')
1085+ return iwdi_obj._get_concepts(cr, uid, ids, context=context)
1086+
1087+ def _create_doc_invoices(self,cr,uid,ids,islr_wh_doc_id,context=None):
1088+ '''
1089+ This method link the invoices to be withheld
1090+ with the withholding document.
1091+ '''
1092+ #TODO: CHECK IF THIS METHOD SHOULD BE HERE OR IN THE ISLR WH DOC
1093+ context = context or {}
1094+ ids = isinstance(ids, (int, long)) and [ids] or ids
1095+ doc_inv_obj = self.pool.get('islr.wh.doc.invoices')
1096+ iwhdi_ids=[]
1097+ for inv_id in ids:
1098+ iwhdi_ids.append(doc_inv_obj.create(cr,uid,
1099+ {'invoice_id':inv_id,'islr_wh_doc_id':islr_wh_doc_id}))
1100+ return iwhdi_ids
1101+
1102+ def _create_islr_wh_doc(self,cr,uid,ids,context=None):
1103+ '''
1104+ Funcion para crear en el modelo islr_wh_doc
1105+ '''
1106+ context = context or {}
1107+ ids = isinstance(ids, (int, long)) and [ids] or ids
1108+
1109+ doc_line_obj = self.pool.get('islr.wh.doc.line')
1110+ wh_doc_obj = self.pool.get('islr.wh.doc')
1111+ inv_obj =self.pool.get('account.invoice.line')
1112+ rate_obj = self.pool.get('islr.rates')
1113+
1114+ row = self.browse(cr,uid,ids[0],context=context)
1115+ context['type']=row.type
1116+ wh_ret_code = wh_doc_obj.retencion_seq_get(cr, uid)
1117+
1118+ if wh_ret_code:
1119+ islr_wh_doc_id = wh_doc_obj.create(cr,uid,
1120+ {'name': wh_ret_code,
1121+ 'partner_id': row.partner_id.id,
1122+ 'invoice_id': row.id,
1123+ 'period_id': row.period_id.id,
1124+ 'account_id': row.account_id.id,
1125+ 'type': row.type,
1126+ 'journal_id': wh_doc_obj._get_journal(cr,uid,context=context),})
1127+ self._create_doc_invoices(cr,uid,row.id,islr_wh_doc_id)
1128+ else:
1129+ raise osv.except_osv(_('Invalid action !'),_("No se ha encontrado el numero de secuencia!"))
1130+
1131+ self.write(cr,uid,ids,{'islr_wh_doc_id':islr_wh_doc_id,'islr_wh_doc_name':wh_ret_code})
1132+
1133+ #wf_service = netsvc.LocalService("workflow")
1134+ #wf_service.trg_validate(uid, 'islr.wh.doc', islr_wh_doc_id, 'button_confirm', cr)
1135+ return islr_wh_doc_id
1136+## END OF REWRITING ISLR
1137
1138 def copy(self, cr, uid, id, default=None, context=None):
1139
1140@@ -125,572 +195,6 @@
1141 list.append((x,y,res))
1142 return list
1143
1144- def _get_partners(self, cr, uid, invoice):
1145- '''
1146- Get the seller id, the buyer id from the invoice, and the boolean field that determines whether the buyer is the withholding agent
1147- '''
1148- if invoice.type == 'in_invoice' or invoice.type == 'in_refund':
1149- vendor = invoice.partner_id
1150- buyer = invoice.company_id.partner_id
1151- else:
1152- buyer = invoice.partner_id
1153- vendor = invoice.company_id.partner_id
1154- return (vendor, buyer, buyer.islr_withholding_agent)
1155-
1156- def _get_concepts(self, cr, uid, invoice):
1157- '''
1158- Gets a list of concepts (cocenpt_id) from the invoice lines
1159- '''
1160- service_list = []
1161- for invoice_line in invoice.invoice_line:
1162- if invoice_line.concept_id and invoice_line.concept_id.withholdable:
1163- service_list.append(invoice_line.concept_id.id)
1164- else:
1165- pass
1166- return list(set(service_list))
1167-
1168- def _get_service_wh(self, cr, uid, invoice, concept_list):
1169- '''
1170- Gets all the vendor invoice lines, filtering by the period of the current invoice and the invoice state equal to {done, onpen}
1171- The lines are stored in a dictionary, where the first key is the list of lines obtained, the second key is the field that indicates wheter any of these line was withholding, and the third key is the sum of the base of all the lines that have not withholding applied
1172- A search in the lines is done seeking for lines that have withholding concepts equals to the current invoice. This is done to verify:
1173- 1.- If exist the same concepts in another invoice line that have not been withholding cause the amount have no exceeded the minimum value therefore this amount its taken to perform the sum and verification. If the amount exceeds the minimun then withholding is applied to the associated invoices.
1174- 2.- Verify if is the first time that a withholding is applied on that concept, If is true then the subtrahend is applied in the second key "wf" of the dictionary
1175-
1176- '''
1177- dict={}
1178- for key in concept_list:
1179- dict[key]={'lines':[],'wh':False,'base':0.0}
1180- #~ inv_obj = self.pool.get('account.invoice')
1181- #~ inv_lst = inv_obj.search(cr, uid,[('partner_id', '=', invoice.partner_id.id),('period_id','=',invoice.period_id.id),('state','in',['done','open'])]) # Lista de facturas asociadas al proveedor actual, al periodo actual y al estado de las facturas: donde, open.
1182- #~
1183- #~ inv_line_lst=[]
1184- #~ for id in inv_lst:
1185- #~ inv_line_brw = inv_obj.browse(cr, uid, id).invoice_line #lista de lineas de facturas
1186- for line in invoice.invoice_line:
1187- if line.concept_id and line.concept_id.id in concept_list: # Se verifica si el concepto de la linea en la que estoy buscando coincide con alguno de los conceptos de la factura actual.
1188- if not line.apply_wh: # Se verifica si a la linea no se le ha aplicado retencion, de ser asi se almacena el id de la linea y la base.
1189- dict[line.concept_id.id]['lines'].append(line.id)
1190- dict[line.concept_id.id]['base']+= line.price_subtotal
1191- else: # Si ya se le aplico retencion, no se guarda el id porque no hace falta pero se indica que ya se le aplico retencion.
1192- dict[line.concept_id.id]['wh']=True
1193- #~ dict[key]={'lines':[],'wh':False,'base':0.0}
1194- return dict
1195-
1196- def _get_country_fiscal(self,cr, uid, partner_id):
1197- '''
1198- Gets depending on the parameters the country of the seller or buyer from the fiscal address.
1199- '''
1200- for i in partner_id.address:
1201- if i.type == 'invoice':
1202- if not i.country_id:
1203- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the partner '%s' country has not defined direction in fiscal!") % (partner_id.name))
1204- return False
1205- else:
1206- return i.country_id.id
1207- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the partner '%s' has not fiscal direction set!.") % (partner_id.name))
1208- return False
1209-
1210- def _get_residence(self, cr, uid, vendor, buyer):
1211- '''
1212- Determines whether the buyer fiscal address is the same that the seller. with the objective of later get the associated rate.
1213- Return True if is a domiciled or resident person, False if is not
1214- '''
1215- vendor_address = self._get_country_fiscal(cr, uid, vendor)
1216- buyer_address = self._get_country_fiscal(cr, uid, buyer)
1217- if vendor_address and buyer_address:
1218- if vendor_address == buyer_address:
1219- return True
1220- else:
1221- return False
1222- return False
1223-
1224- def _get_nature(self, cr, uid, partner_id):
1225- '''
1226- Gets the nature of the seller from RIF. Return True if is a natural person type, False if is a legal entity.
1227- '''
1228- if not partner_id.vat:
1229- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the partner '%s' has not vat associated!") % (partner_id.name))
1230- return False
1231- else:
1232- if partner_id.vat[2:3] in 'VvEe':
1233- return True
1234- else:
1235- return False
1236-
1237- def _get_rate(self, cr, uid, concept_id, residence, nature,context):
1238- '''
1239- Gets the withholding concept rate, provided if is associated to the below specifications:
1240- - the nature of the seller match with a rate
1241- - the residence of the seller match with a rate
1242- '''
1243- ut_obj = self.pool.get('l10n.ut')
1244- rate_brw_lst = self.pool.get('islr.wh.concept').browse(cr, uid, concept_id).rate_ids
1245- for rate_brw in rate_brw_lst:
1246- if rate_brw.nature == nature and rate_brw.residence == residence:
1247- #~ (base,min,porc,sust,codigo,id_rate,name_rate)
1248- rate_brw_minimum = ut_obj.compute_ut_to_money(cr, uid, rate_brw.minimum, False, context)#metodo que transforma los UVT en pesos
1249- rate_brw_subtract = ut_obj.compute_ut_to_money(cr, uid, rate_brw.subtract, False, context)#metodo que transforma los UVT en pesos
1250- return (rate_brw.base, rate_brw_minimum, rate_brw.wh_perc, rate_brw_subtract,rate_brw.code,rate_brw.id,rate_brw.name)
1251- return ()
1252-
1253- def _get_rate_dict(self, cr, uid, concept_list, residence, nature,context):
1254- '''
1255- Returns a dictionary with the rate of each withholding concept.
1256- '''
1257- dictd = {}
1258- cont = 0
1259- for concept_id in concept_list:
1260- dictd[concept_id] = self._get_rate(cr, uid, concept_id, residence, nature,context)
1261- if dictd[concept_id]:
1262- cont += 1
1263- if not cont:
1264- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the Concept of Withholding associated with the line has not rate for the type of customer!"))
1265- return dictd
1266-
1267-
1268- def _pop_dict(self,cr,uid,concept_list,dict_rate,wh_dict):
1269- '''
1270- Method to delete all the elements where the withholding concept does not have a rate associated, in the dictionary of concept with rates and in the dictionary of invoice lines.
1271- '''
1272- for concept in concept_list:
1273- if not dict_rate[concept]:
1274- dict_rate.pop(concept)
1275- wh_dict.pop(concept)
1276-
1277- def _get_wh_calc(self,cr,uid,line,dict_rate_concept):
1278- base = self.pool.get('account.invoice.line').browse(cr,uid,line).price_subtotal
1279- return (base * (dict_rate_concept[0]/100) * (dict_rate_concept[2]/100), base)
1280-
1281- def _get_number(self,cr,uid,number,long):
1282- num1 = number[::-1]
1283- result= ''
1284- for i in num1:
1285- if i.isdigit():
1286- if len(result)<long:
1287- result = i + result
1288- else:
1289- break
1290- else:
1291- break
1292- return result.strip()
1293-
1294-
1295- def _get_inv_data(self,cr, uid, line):
1296- '''
1297- Gets the RIF of the supplier, the invoice number and the control number of the invoice. Data required for XML, among others.
1298- '''
1299- inv_brw = self.pool.get('account.invoice.line').browse(cr, uid, line).invoice_id
1300- vat = inv_brw.partner_id.vat[2:]
1301- if inv_brw.type == 'in_invoice' or inv_brw.type == 'in_refund':
1302- #~ number = inv_brw.reference.strip()
1303- if not inv_brw.reference:
1304- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income,because the invoice number: '%s' has not number reference free!") % (inv_brw.number))
1305- number = 0
1306- else:
1307- number = self._get_number(cr,uid,inv_brw.reference.strip(),10)
1308- else:
1309- if not inv_brw.number:
1310- number = 0
1311- else:
1312- number = self._get_number(cr,uid,inv_brw.number.strip(),10)
1313- if not inv_brw.nro_ctrl:
1314- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the invoice number: '%s' has not control number associated!") % (inv_brw.number))
1315- else:
1316- control = self._get_number(cr,uid,inv_brw.nro_ctrl.strip(),8)
1317-
1318- return (vat, number, control)
1319-
1320- def _write_wh_apply(self,cr, uid,line,dict,apply,type):
1321- '''
1322- If wh_xml_id field in the invoice line has an associated xml id:
1323- Write over the boolean field in the invoice line True o False depending on whether it holds withholding or not.
1324- Write over the xml line the value of the withholding. This happens because it could be created the xml line with a 0.0 withholding (doesnt apply at that time) but if the amount of the withholding exceeds in another invoice, will be override the value with the new withholding amount.
1325- Otherwise:
1326- Create a new xml line.
1327- Write True or False value on the invoice line, and assigns the xml id created in the previuos step.
1328- '''
1329- il_ids = self.pool.get('account.invoice.line').browse(cr, uid,line)
1330-
1331- if il_ids.wh_xml_id:
1332- self.pool.get('account.invoice.line').write(cr, uid, line, {'apply_wh': apply})
1333- self.pool.get('islr.xml.wh.line').write(cr,uid,il_ids.wh_xml_id.id,{'wh':dict['wh']})
1334- else:
1335- if type in ('out_invoice', 'out_refund'):
1336- self.pool.get('account.invoice.line').write(cr, uid, line, {'apply_wh': apply})
1337- else:
1338- self.pool.get('account.invoice.line').write(cr, uid, line, {'apply_wh': apply,'wh_xml_id':self._create_islr_xml_wh_line(cr, uid,line,dict)})
1339- message = _("Withholding income xml line generated.")
1340- self.log(cr, uid, line, message)
1341-
1342- def _create_islr_xml_wh_line(self,cr, uid, line, dict):
1343- '''
1344- Create a new xml line
1345- '''
1346- inv_id = self.pool.get('account.invoice.line').browse(cr, uid,line).invoice_id
1347- return self.pool.get('islr.xml.wh.line').create(cr, uid, {'name': dict['name_rate'],
1348- 'concept_id': dict['concept'],
1349- 'period_id': inv_id.period_id.id,
1350- 'partner_vat':dict['vat'],
1351- 'invoice_number': dict['number'],
1352- 'control_number': dict['control'],
1353- 'concept_code':dict['code'],
1354- 'base': dict['subtotal'],
1355- 'porcent_rete':dict['perc'],
1356- 'wh':dict['wh'],
1357- 'rate_id': dict['rate_id'],
1358- 'account_invoice_line_id': line,
1359- 'account_invoice_id': inv_id.id,
1360- 'partner_id': inv_id.partner_id.id,
1361- })
1362-
1363- def _get_wh(self,cr, uid, subtract,concept, wh_dict, dict_rate, apply,context=None):
1364- '''
1365- Returns a dictionary containing all the values ​​of the retention of an invoice line.
1366- '''
1367- if context is None:
1368- context={}
1369- res= {}
1370- inv_obj= self.pool.get('account.invoice')
1371- if apply: # Si se va a aplicar retencion.
1372- for line in wh_dict[concept]['lines']:
1373- wh_calc, subtotal = self._get_wh_calc(cr,uid,line,dict_rate[concept]) # Obtengo el monto de retencion y el monto base sobre el cual se retiene
1374- if subtract >= wh_calc:
1375- wh = 0.0
1376- subtract -= wh_calc
1377- else:
1378- wh = wh_calc - subtract
1379- subtract_write= subtract
1380- subtract=0.0
1381- inv_id = self.pool.get('account.invoice.line').browse(cr, uid,line).invoice_id.id
1382- type = inv_obj.browse(cr,uid,inv_id).type
1383- res[line]={ 'vat': self._get_inv_data(cr, uid, line)[0],
1384- 'number': self._get_inv_data(cr, uid, line)[1],
1385- 'control': self._get_inv_data(cr, uid, line)[2],
1386- 'concept': concept,
1387- 'code':dict_rate[concept][4],
1388- 'subtotal': subtotal,
1389- 'perc':dict_rate[concept][2],
1390- 'wh':wh,
1391- 'apply':apply,
1392- 'rate_id':dict_rate[concept][5],
1393- 'name_rate': dict_rate[concept][6]}
1394- if not context.get('test_from_wkf',False):
1395- self._write_wh_apply(cr,uid,line,res[line],apply,type)
1396- inv_obj.write(cr, uid, inv_id, {'status': 'pro'})
1397- else: # Si no aplica retencion
1398- for line in wh_dict[concept]['lines']:
1399- subtotal = self._get_wh_calc(cr,uid,line,dict_rate[concept])[1]
1400- inv_id = self.pool.get('account.invoice.line').browse(cr, uid,line).invoice_id.id
1401- type = inv_obj.browse(cr,uid,inv_id).type
1402- res[line]={ 'vat': self._get_inv_data(cr, uid, line)[0],
1403- 'number': self._get_inv_data(cr, uid, line)[1],
1404- 'control': self._get_inv_data(cr, uid, line)[2],
1405- 'concept': concept,
1406- 'code':dict_rate[concept][4],
1407- 'subtotal': subtotal,
1408- 'perc':dict_rate[concept][2],
1409- 'wh':0.0,
1410- 'apply':apply,
1411- 'rate_id':dict_rate[concept][5],
1412- 'name_rate': dict_rate[concept][6]}
1413- if not context.get('test_from_wkf',False):
1414- self._write_wh_apply(cr,uid,line,res[line],apply,type)
1415- inv_obj.write(cr, uid, inv_id, {'status': 'pro'})
1416- return res
1417-
1418-
1419- def _get_wh_apply(self,cr,uid,dict_rate,wh_dict,nature,context=None):
1420- '''
1421- Returns a dictionary containing all data for the withholding. Each item is an invoice line.
1422- '''
1423- if context is None:
1424- context={}
1425- res = {}
1426- for concept in wh_dict:
1427- if not wh_dict[concept]['wh']: #Si nunca se ha aplicado retencion con este concepto.
1428- if wh_dict[concept]['base'] >= dict_rate[concept][1]: # Si el monto base que suman todas las lineas de la factura es mayor o igual al monto minimo de la tasa.
1429- subtract = dict_rate[concept][3] # Obtengo el sustraendo a aplicar. Existe sustraendo porque es la primera vez.
1430- res.update(self._get_wh(cr, uid, subtract,concept, wh_dict, dict_rate, True,context=context))# El True sirve para asignar al campo booleano de la linea de la factura True, para asi marcar de una vez que ya fue retenida, para una posterior busqueda.
1431- else: # Si el monto base no supera el monto minimo de la tasa(de igual forma se deb declarar asi no supere.)
1432- subtract = 0.0
1433- res.update(self._get_wh(cr, uid, subtract,concept, wh_dict, dict_rate, False,context=context))
1434- else: #Si ya se aplico alguna vez la retencion, se aplica rete de una vez, sobre la base sin chequear monto minimo.(Dentro de este periodo)
1435- if nature:
1436- subtract = dict_rate[concept][3]
1437- res.update(self._get_wh(cr, uid, subtract,concept, wh_dict, dict_rate, True,context=context))
1438- else:
1439- subtract = 0.0
1440- res.update(self._get_wh(cr, uid, subtract,concept, wh_dict, dict_rate, True,context=context))# El True sirve para indicar que la linea si se va a retener.
1441- return res
1442-
1443-
1444- def _get_amount(self,cr,uid,dict):
1445- '''
1446- Get the sum of the withholding amount by concept.
1447- '''
1448- dict_concept = {}
1449- for key in dict:
1450- x = dict[key]['concept']
1451- y = dict[key]['wh']
1452- if not dict_concept.get(x,False):
1453- dict_concept[x] = y
1454- else:
1455- dict_concept[x]+= y
1456- return dict_concept
1457-
1458-
1459- def _get_dict_concepts(self,cr,uid,dict):
1460- '''
1461- Get a dictionary grouped by concept:
1462- {1:[{64: {'control': '', 'perc': 0.050000000000000003, 'concept': 1, 'number': False, 'wh': 0.0, 'code': u'A', 'rate_id': 1, 'apply': True, 'subtotal': 500.0, 'vat': u'J123456789'}},
1463- {65: {'control': '', 'perc': 0.050000000000000003, 'concept': 1, 'number': False, 'wh': 0.0, 'code': u'A', 'rate_id': 1, 'apply': True, 'subtotal': 300.0, 'vat': u'J123456789'}}
1464- ],
1465- 2:[{63: {'control': '', 'perc': 0.029999999999999999, 'concept': 2, 'number': False, 'wh': 0.0, 'code': u'002', 'rate_id': 2, 'apply': True, 'subtotal': 1000.0, 'vat': u'J123456789'}}
1466- ]}
1467- '''
1468- dict_concepts = {}
1469- for key in dict:
1470- x = dict[key]['concept']
1471- y = dict[key]
1472- if not dict_concepts.get(x,False):
1473- if dict[key]['apply']:
1474- dict_concepts[x]=[]
1475- dict_concepts[x].append({key:y})
1476- else:
1477- if dict[key]['apply']:
1478- dict_concepts[x].append({key:y})
1479- return dict_concepts
1480-
1481-
1482- def get_journal(self,cr,uid,inv_brw):
1483- '''
1484- Assign the corresponding journal according to each type of withholding (purchase, sale). The journal types are created in retencion_iva
1485- '''
1486- tipo='Sale'
1487- tipo2='islr_sale'
1488- journal_id = None
1489- journal_obj = self.pool.get('account.journal')
1490- if inv_brw.type == 'out_invoice' or inv_brw.type =='out_refund':
1491- journal_id = journal_obj.search(cr, uid, [('type', '=', 'islr_sale')], limit=1)
1492- else:
1493- journal_id = journal_obj.search(cr, uid, [('type', '=', 'islr_purchase')], limit=1)
1494- tipo = 'Purchase'
1495- tipo2 = 'islr_purchase'
1496- if not journal_id:
1497- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the journal of withholding income for the '%s' has not been created with the type '%s'") % (tipo,tipo2))
1498-
1499- return journal_id[0] or None
1500-
1501- def button_confirm(self, cr, uid, ids, context=None):
1502- return self.write(cr, uid, ids, {'state': 'confirmed'})
1503-
1504- def _create_islr_wh_doc(self,cr,uid,inv_brw,dict):
1505- '''
1506- To create in the islr_wh_doc model
1507- '''
1508- islr_wh_doc_id=0
1509- wh_doc_obj = self.pool.get('islr.wh.doc')
1510- inv_obj =self.pool.get('account.invoice.line')
1511- inv_brw = inv_brw.invoice_id
1512- inv_brw2 = inv_obj.browse(cr,uid,dict.keys())
1513- islr_wh_doc_id = wh_doc_obj.create(cr,uid,
1514- {'name': wh_doc_obj.retencion_seq_get(cr, uid),
1515- 'partner_id': inv_brw.partner_id.id,
1516- 'invoice_id': inv_brw.id,
1517- 'period_id': inv_brw.period_id.id,
1518- 'account_id': inv_brw.account_id.id,
1519- 'type': inv_brw.type,
1520- 'journal_id': self.get_journal(cr,uid,inv_brw),
1521- 'islr_wh_doc_id': [(6,0,[i.invoice_id.id for i in inv_brw2])]
1522- })
1523-
1524- wf_service = netsvc.LocalService("workflow")
1525- wf_service.trg_validate(uid, 'islr.wh.doc', islr_wh_doc_id, 'button_confirm', cr)
1526-# wf_service.trg_write(uid, 'islr.wh.doc', islr_wh_doc_id, cr)
1527- return islr_wh_doc_id
1528-
1529-
1530- def _create_doc_line(self,cr,uid, inv_brw,key2,islr_wh_doc_id,dictt,dictc):
1531- '''
1532- To create in the islr_wh_doc_line model
1533- '''
1534- doc_line_obj = self.pool.get('islr.wh.doc.line')
1535- rate_obj = self.pool.get('islr.rates')
1536- dict_concept = self._get_amount(cr,uid,dictt)
1537- inv_line_id = dictc[key2][0].keys()[0]
1538- rate_id = dictc[key2][0][inv_line_id]['rate_id']
1539-
1540- islr_wh_doc_line_id = doc_line_obj.create(cr,uid,
1541- {'islr_wh_doc_id':islr_wh_doc_id,
1542- 'concept_id':key2,
1543- 'islr_rates_id':rate_id,
1544- 'invoice_id': inv_brw.invoice_id.id,
1545- 'retencion_islr': rate_obj.browse(cr,uid,rate_id).wh_perc,
1546- 'amount':dict_concept[key2],})
1547-
1548- return islr_wh_doc_line_id
1549-
1550- def _create_doc_invoices(self,cr,uid,key,islr_wh_doc_id):
1551- '''
1552- To create in the islr_wh_doc_invoices model
1553- '''
1554- doc_inv_obj = self.pool.get('islr.wh.doc.invoices')
1555- inv_id = key
1556- islr_wh_doc_invoices_id = doc_inv_obj.create(cr,uid,{'invoice_id':inv_id,'islr_wh_doc_id':islr_wh_doc_id})
1557-
1558-
1559- def _write_wh_xml(self,cr,uid,key,islr_wh_doc_line_id):
1560- '''
1561- Write in the xml_wh_line model
1562- '''
1563- inv_obj =self.pool.get('account.invoice.line')
1564- xml_obj = self.pool.get('islr.xml.wh.line')
1565- xml_id = inv_obj.browse(cr,uid,key).wh_xml_id.id
1566- xml_obj.write(cr, uid, xml_id, {'islr_wh_doc_line_id':islr_wh_doc_line_id})
1567-
1568-
1569- def _get_inv_id(self,cr,uid,dict):
1570- '''
1571- Get the invoice obj_browse
1572- '''
1573- inv_obj =self.pool.get('account.invoice.line')
1574- line_ids = [key for key in dict if dict[key]['apply']]
1575- line_ids.sort()
1576- return line_ids and inv_obj.browse(cr,uid,line_ids[-1]) or False
1577-
1578-
1579- def _logic_create(self,cr,uid,dict,wh_doc_id):
1580- '''
1581- Handling of all the logic for generating lines on models.
1582- '''
1583- dictc = self._get_dict_concepts(cr,uid,dict)
1584- inv_brw = self._get_inv_id(cr,uid,dict)
1585- inv_obj =self.pool.get('account.invoice.line')
1586- islr_wh_doc_id=None
1587-
1588- if inv_brw:
1589- if dictc and not wh_doc_id:
1590- islr_wh_doc_id = self._create_islr_wh_doc(cr,uid,inv_brw,dict)
1591- else:
1592- islr_wh_doc_id = wh_doc_id
1593- key_lst = []
1594- if islr_wh_doc_id:
1595- for key2 in dictc:
1596- inv_line_id = dictc[key2][0].keys()[0]
1597- islr_wh_doc_line_id = self._create_doc_line(cr,uid,inv_brw,key2,islr_wh_doc_id,dict,dictc)
1598- for line in dictc[key2]:
1599- inv_line_id2 = dictc[key2][0].keys()[0]
1600- for key in line:
1601- key_lst.append(inv_obj.browse(cr,uid,key).invoice_id.id)
1602- if not wh_doc_id:
1603- self._write_wh_xml(cr,uid,key,islr_wh_doc_line_id)
1604- for key in set(key_lst):
1605- self._create_doc_invoices(cr,uid,key,islr_wh_doc_id)
1606-
1607- self.pool.get('account.invoice').write(cr,uid,inv_brw.invoice_id.id,{'islr_wh_doc_id':islr_wh_doc_id})
1608-
1609- message = _("Withholding income voucher '%s' generated.") % self.pool.get('islr.wh.doc').browse(cr,uid,islr_wh_doc_id).name
1610- self.log(cr, uid, islr_wh_doc_id, message)
1611- else:
1612- pass
1613- else:
1614- pass
1615- return islr_wh_doc_id
1616-
1617- def action_ret_islr(self, cr, uid, ids, context={}):
1618- return self.pool.get('islr.wh.doc').action_ret_islr(cr,uid,ids,context)
1619-
1620- def _check_wh_islr(self, cr, uid, ids, context=None):
1621- if context is None:
1622- context={}
1623-
1624- wh_apply=[]
1625- # The two function being called below should undergo overhauling
1626- # right now it takes an object as and argument instead of an integer
1627- invoice = self.browse(cr, uid, ids[0], context=context)
1628- vendor, buyer, wh = self._get_partners(cr, uid, invoice)
1629- concept_list = self._get_concepts(cr, uid, invoice)
1630- wh_apply.append(wh)
1631- wh_apply.append(concept_list)
1632-
1633- return invoice, vendor, buyer, concept_list, all(wh_apply)
1634-
1635- def _check_do_wh(self, cr, uid, ids, invoice, vendor, buyer, concept_list, context=None):
1636- if context is None:
1637- context={}
1638- wh_dict = self._get_service_wh(cr, uid, invoice, concept_list)
1639- residence = self._get_residence(cr, uid, vendor, buyer)
1640- nature = self._get_nature(cr, uid, vendor)
1641- dict_rate = self._get_rate_dict(cr, uid, concept_list, residence, nature,context=context)
1642- self._pop_dict(cr,uid,concept_list,dict_rate,wh_dict)
1643- dict_completo = self._get_wh_apply(cr,uid,dict_rate,wh_dict,nature,context=context)
1644- inv_brw = self._get_inv_id(cr,uid,dict_completo)
1645-
1646- return bool(inv_brw)
1647-
1648- def check_wh_islr_apply(self, cr, uid, ids, context=None):
1649- '''
1650- This Method test if given certain conditions it is
1651- possible to create a new withholding document
1652- '''
1653- #TODO: Este metodo deberia devolver true ya que es un metodo "check"
1654- if context is None:
1655- context={}
1656-
1657- invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
1658-
1659- do_wh = False
1660- if wh_apply:
1661- context.update({'test_from_wkf':True})
1662- do_wh = self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
1663-
1664- return all([wh_apply,do_wh])
1665-
1666- def check_wh_islr_xml(self, cr, uid, ids, context=None):
1667- '''
1668- This Method test if given certain conditions it is
1669- __not__ possible to create a new withholding document
1670- but the xml elements needed to create a legal report
1671- '''
1672- if context is None:
1673- context={}
1674-
1675- invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
1676-
1677- do_wh = True
1678- if wh_apply:
1679- context.update({'test_from_wkf':True})
1680- do_wh = self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
1681-
1682- return all([wh_apply,not do_wh])
1683-
1684- def action_islr_xml(self, cr, uid, ids, context=None):
1685- '''
1686- This Method creates the xml elements needed to provide a legal report
1687- '''
1688- if context is None:
1689- context={}
1690-
1691- invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
1692-
1693- if wh_apply:
1694- self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
1695-
1696- return True
1697-
1698- def check_invoice_type(self, cr, uid, ids, context=None):
1699- '''
1700- This method test the invoice types to create a new withholding document
1701- '''
1702- #TODO: change on workflow
1703- if context is None:
1704- context={}
1705- obj = self.browse(cr, uid, ids[0],context=context)
1706- if obj.type in ('in_invoice', 'in_refund'):
1707- return True
1708- return False
1709-
1710 def validate_wh_income_done(self, cr, uid, ids, context=None):
1711 """
1712 Method that check if wh income is validated in invoice refund.
1713@@ -710,12 +214,3 @@
1714 return True
1715
1716 account_invoice()
1717-
1718-
1719-
1720-
1721-
1722-
1723-
1724-
1725-
1726
1727=== modified file 'l10n_ve_withholding_islr/model/islr_wh_concept.py'
1728--- l10n_ve_withholding_islr/model/islr_wh_concept.py 2012-12-09 23:55:45 +0000
1729+++ l10n_ve_withholding_islr/model/islr_wh_concept.py 2012-12-26 22:37:22 +0000
1730@@ -38,7 +38,7 @@
1731 Model to create the withholding concepts
1732 '''
1733 _name='islr.wh.concept'
1734- _description = 'Withholding Income Concept'
1735+ _description = 'Income Withholding Concept'
1736
1737 _columns={
1738 'name':fields.char('Withholding Concept', translate=True,size=256,required=True,help="Name of Withholding Concept, Example: Honorarios Profesionales, Comisiones a..."),
1739
1740=== modified file 'l10n_ve_withholding_islr/model/islr_wh_doc.py'
1741--- l10n_ve_withholding_islr/model/islr_wh_doc.py 2012-12-09 23:55:45 +0000
1742+++ l10n_ve_withholding_islr/model/islr_wh_doc.py 2012-12-26 22:37:22 +0000
1743@@ -41,13 +41,14 @@
1744 type = context.get('type', 'in_invoice')
1745 return type
1746
1747- def _get_journal(self, cr, uid, context):
1748+ def _get_journal(self, cr, uid, context=None):
1749 if context is None:
1750 context = {}
1751- type_inv = context.get('type')
1752- type2journal = {'out_invoice': 'retislrSale', 'in_invoice': 'retislrPurchase', 'out_refund': 'retislrSale', 'in_refund': 'retislrPurchase'}
1753 journal_obj = self.pool.get('account.journal')
1754- res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'retislrPurchase'))], limit=1)
1755+ if context.get('type') in ('out_invoice', 'out_refund'):
1756+ res = journal_obj.search(cr, uid, [('type', '=', 'islr_sale')], limit=1)
1757+ else:
1758+ res = journal_obj.search(cr, uid, [('type', '=', 'islr_purchase')], limit=1)
1759 if res:
1760 return res[0]
1761 else:
1762@@ -68,18 +69,6 @@
1763 res[rete.id] += line.amount
1764 return res
1765
1766- def _get_period(self,cr,uid,ids,name,args,context={}):
1767- res = {}
1768- wh_doc_brw = self.browse(cr,uid,ids, context=None)
1769- for doc in wh_doc_brw:
1770- res[doc.id] = False
1771- if doc.date_ret:
1772- period_ids = self.pool.get('account.period').search(cr,uid,[('date_start','<=',doc.date_ret or time.strftime('%Y-%m-%d')),('date_stop','>=',doc.date_ret or time.strftime('%Y-%m-%d'))])
1773- if len(period_ids):
1774- period_id = period_ids[0]
1775- res[doc.id] = period_id
1776- return res
1777-
1778 def filter_lines_invoice(self,cr,uid,partner_id,context):
1779 inv_obj = self.pool.get('account.invoice')
1780 invoice_obj = self.pool.get('islr.wh.doc.invoices')
1781@@ -95,7 +84,7 @@
1782 return inv_ids
1783
1784 _name = "islr.wh.doc"
1785- _description = 'Document Withholding Income'
1786+ _description = 'Document Income Withholding'
1787 _columns= {
1788 'name': fields.char('Description', size=64,readonly=True, states={'draft':[('readonly',False)]}, required=True, help="Voucher description"),
1789 'code': fields.char('Code', size=32, readonly=True, states={'draft':[('readonly',False)]}, help="Voucher reference"),
1790@@ -116,14 +105,14 @@
1791 ],'State', readonly=True, help="Voucher state"),
1792 'date_ret': fields.date('Accounting Date', help="Keep empty to use the current date"),
1793 'date_uid': fields.date('Withhold Date', readonly=True, states={'draft':[('readonly',False)]}, help="Voucher date"),
1794- 'period_id': fields.function(_get_period, method=True, required=False, type='many2one',relation='account.period', string='Period', help="Period when the accounts entries were done"),
1795+ 'period_id': fields.many2one('account.period', 'Period', help="Period when the accounts entries were done"),
1796 'account_id': fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Account Receivable or Account Payable of partner"),
1797 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True, required=True, states={'draft':[('readonly',False)]}, help="Partner object of withholding"),
1798 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Currency in which the transaction takes place"),
1799 'journal_id': fields.many2one('account.journal', 'Journal', required=True,readonly=True, states={'draft':[('readonly',False)]}, help="Journal where accounting entries are recorded"),
1800 'company_id': fields.many2one('res.company', 'Company', required=True, help="Company"),
1801 'amount_total_ret':fields.function(_get_amount_total,method=True, string='Amount Total', type='float', digits_compute= dp.get_precision('Withhold ISLR'), help="Total Withheld amount"),
1802- 'concept_ids': fields.one2many('islr.wh.doc.line','islr_wh_doc_id','Withholding Income Concept', readonly=True, states={'draft':[('readonly',False)]}),
1803+ 'concept_ids': fields.one2many('islr.wh.doc.line','islr_wh_doc_id','Income Withholding Concept', readonly=True, states={'draft':[('readonly',False)]}),
1804 'invoice_ids':fields.one2many('islr.wh.doc.invoices','islr_wh_doc_id','Withheld Invoices'),
1805 'invoice_id':fields.many2one('account.invoice','Invoice',readonly=False,help="Invoice to make the accounting entry"),
1806 'islr_wh_doc_id': fields.one2many('account.invoice','islr_wh_doc_id','Invoices',states={'draft':[('readonly',False)]}),
1807@@ -142,22 +131,39 @@
1808 'user_id': lambda s, cr, u, c: u,
1809 }
1810
1811+ def check_income_wh(self, cr, uid, ids, context=None):
1812+ context = context or {}
1813+ ids = isinstance(ids, (int, long)) and [ids] or ids
1814+ obj = self.browse(cr, uid, ids[0],context=context)
1815+ res = {}
1816+ for wh_line in obj.invoice_ids:
1817+ if not wh_line.islr_xml_id:
1818+ res[wh_line.id] = (wh_line.invoice_id.name,
1819+ wh_line.invoice_id.number, wh_line.invoice_id.reference)
1820+ if res:
1821+ note = _('The Following Invoices Have not yet been withheld:\n\n')
1822+ for i in res:
1823+ note += '* %s, %s, %s\n'%res[i]
1824+ note += _('\nPlease, Load the Taxes to be withheld and Try Again')
1825+ raise osv.except_osv(_('Invoices with Missing Withheld Taxes!'),note)
1826+ return True
1827+
1828+ def compute_amount_wh(self, cr, uid, ids, context=None):
1829+ context = context or {}
1830+ ids = isinstance(ids, (int, long)) and [ids] or ids
1831+ iwdi_obj = self.pool.get('islr.wh.doc.invoices')
1832+ iwd_brw = self.browse(cr, uid, ids[0], context=context)
1833+ for iwdi_brw in iwd_brw.invoice_ids:
1834+ iwdi_obj.load_taxes(cr, uid, iwdi_brw.id, context=context)
1835+ return True
1836 def validate(self, cr,uid,ids,*args):
1837
1838 if args[0]in ['in_invoice','in_refund'] and args[1] and args[2]:
1839 return True
1840
1841- def action_process(self,cr,uid,ids, *args):
1842- inv_obj=self.pool.get('account.invoice')
1843- context = {}
1844- wh_doc_brw = self.browse(cr, uid, ids, context=None)
1845- inv_ids = []
1846-
1847- for wh_doc in wh_doc_brw:
1848- for wh_doc_line in wh_doc.islr_wh_doc_id:
1849- inv_ids.append(wh_doc_line.id)
1850- context["wh_doc_id"]=ids[0]
1851- inv_obj.action_ret_islr(cr, uid, inv_ids,context)
1852+ def action_process(self,cr,uid,ids, context=None):
1853+ # TODO: ERASE THE REGARDING NODE IN THE WORKFLOW
1854+ # METHOD HAVE BEEN LEFT FOR BACKWARD COMPATIBILITY
1855 return True
1856
1857 def action_cancel_process(self,cr,uid,ids,context=None):
1858@@ -226,9 +232,10 @@
1859 vals['code'] = code
1860 return super(islr_wh_doc, self).create(cr, uid, vals, context)
1861
1862- def action_confirm1(self, cr, uid, ids, context={}):
1863- return self.write(cr, uid, ids, {'state':'confirmed'})
1864-
1865+ def action_confirm(self, cr, uid, ids, context=None):
1866+ context = context or {}
1867+ ids = isinstance(ids, (int, long)) and [ids] or ids
1868+ return self.write(cr, uid, ids[0], {'state':'confirmed'})
1869
1870 def action_number(self, cr, uid, ids, *args):
1871 obj_ret = self.browse(cr, uid, ids)[0]
1872@@ -243,21 +250,12 @@
1873 'WHERE id=%s', (number, id))
1874 return True
1875
1876- def action_done1(self, cr, uid, ids, context={}):
1877- self.action_number(cr, uid, ids)
1878- self.action_move_create(cr, uid, ids)
1879- self.write(cr, uid, ids, {'state':'done'})
1880- return True
1881-
1882 def action_cancel(self,cr,uid,ids,context={}):
1883 #~ if self.browse(cr,uid,ids)[0].type=='in_invoice':
1884 #~ return True
1885 self.cancel_move(cr,uid,ids)
1886 self.action_cancel_process(cr,uid,ids,context=context)
1887 return True
1888-
1889-
1890-
1891
1892 def cancel_move (self,cr,uid,ids, *args):
1893 context={}
1894@@ -279,72 +277,69 @@
1895 self.write(cr, uid, ids, {'state':'draft'})
1896 return True
1897
1898- def action_move_create(self, cr, uid, ids, *args):
1899+ def action_move_create(self, cr, uid, ids, context=None):
1900 wh_doc_obj = self.pool.get('islr.wh.doc.line')
1901- context = {}
1902+ context = context or {}
1903+ ids = isinstance(ids, (int, long)) and [ids] or ids
1904 inv_id = None
1905 doc_brw = None
1906-
1907- for ret in self.browse(cr, uid, ids):
1908- if not ret.date_uid:
1909- self.write(cr, uid, [ret.id], {'date_uid':time.strftime('%Y-%m-%d')})
1910-
1911- if not ret.date_ret:
1912- self.write(cr, uid, [ret.id], {'date_ret':time.strftime('%Y-%m-%d')})
1913-
1914- period_id = ret.period_id and ret.period_id.id or False
1915- journal_id = ret.journal_id.id
1916-
1917- if not period_id:
1918- period_ids = self.pool.get('account.period').search(cr,uid,[('date_start','<=',ret.date_ret or time.strftime('%Y-%m-%d')),('date_stop','>=',ret.date_ret or time.strftime('%Y-%m-%d'))])
1919- if len(period_ids):
1920- period_id = period_ids[0]
1921- else:
1922- raise osv.except_osv(_('Warning !'), _("Not found a fiscal period to date: '%s' please check!") % (ret.date_ret or time.strftime('%Y-%m-%d')))
1923-
1924- if ret.concept_ids:
1925- for line in ret.concept_ids:
1926- if ret.type in ('in_invoice', 'in_refund'):
1927- if line.concept_id.property_retencion_islr_payable:
1928- acc_id = line.concept_id.property_retencion_islr_payable.id
1929- inv_id = ret.invoice_id.id
1930- else:
1931- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the account for withholding of sale is not assigned to the Concept withholding '%s'!")% (line.concept_id.name))
1932- else:
1933- if line.concept_id.property_retencion_islr_receivable:
1934- acc_id = line.concept_id.property_retencion_islr_receivable.id
1935- inv_id = line.invoice_id.id
1936- else:
1937- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!") % (line.concept_id.name))
1938-
1939- writeoff_account_id = False
1940- writeoff_journal_id = False
1941- amount = line.amount
1942-
1943- ret_move = self.wh_and_reconcile(cr, uid, [ret.id], inv_id,
1944- amount, acc_id, period_id, journal_id, writeoff_account_id,
1945- period_id, writeoff_journal_id, context)
1946-
1947- # make the retencion line point to that move
1948- rl = {
1949- 'move_id': ret_move['move_id'],
1950- }
1951- #lines = [(op,id,values)] escribir en un one2many
1952- lines = [(1, line.id, rl)]
1953- self.write(cr, uid, [ret.id], {'concept_ids':lines})
1954-
1955- if lines:
1956- message = _("Withholding income voucher '%s' validated and accounting entry generated.") % self.browse(cr, uid, ids[0]).name
1957- self.log(cr, uid, ids[0], message)
1958-
1959- for line in ret.concept_ids:
1960- for xml in line.xml_ids:
1961- if xml.islr_xml_wh_doc.state!='done':
1962- if xml.period_id.id != period_id:
1963- self.pool.get('islr.xml.wh.line').write(cr,uid,xml.id,{'period_id':period_id, 'islr_xml_wh_doc':None})
1964- else:
1965- raise osv.except_osv(_('Invalid action !'),_("Impossible change the period accountig to a withholding that has already been declared."))
1966-# inv_obj.write(cr, uid, line.invoice_id.id, {'retention':True}, context=context)
1967+ ixwl_obj = self.pool.get('islr.xml.wh.line')
1968+ ret = self.browse(cr, uid, ids[0], context=context)
1969+ if not ret.date_uid:
1970+ self.write(cr, uid, [ret.id], {'date_uid':time.strftime('%Y-%m-%d')})
1971+
1972+ if not ret.date_ret:
1973+ self.write(cr, uid, [ret.id], {'date_ret':time.strftime('%Y-%m-%d')})
1974+
1975+ period_id = ret.period_id and ret.period_id.id or False
1976+ journal_id = ret.journal_id.id
1977+
1978+ if not period_id:
1979+ period_ids = self.pool.get('account.period').search(cr,uid,[('date_start','<=',ret.date_ret or time.strftime('%Y-%m-%d')),('date_stop','>=',ret.date_ret or time.strftime('%Y-%m-%d'))])
1980+ if len(period_ids):
1981+ period_id = period_ids[0]
1982+ else:
1983+ raise osv.except_osv(_('Warning !'), _("Not found a fiscal period to date: '%s' please check!") % (ret.date_ret or time.strftime('%Y-%m-%d')))
1984+
1985+ for line in ret.concept_ids:
1986+ if ret.type in ('in_invoice', 'in_refund'):
1987+ if line.concept_id.property_retencion_islr_payable:
1988+ acc_id = line.concept_id.property_retencion_islr_payable.id
1989+ inv_id = line.invoice_id.id
1990+ else:
1991+ raise osv.except_osv(_('Invalid action !'),_("Impossible income withholding, because the account for withholding of sale is not assigned to the Concept withholding '%s'!")% (line.concept_id.name))
1992+ else:
1993+ if line.concept_id.property_retencion_islr_receivable:
1994+ acc_id = line.concept_id.property_retencion_islr_receivable.id
1995+ inv_id = line.invoice_id.id
1996+ else:
1997+ raise osv.except_osv(_('Invalid action !'),_("Impossible income withholding, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!") % (line.concept_id.name))
1998+
1999+ writeoff_account_id = False
2000+ writeoff_journal_id = False
2001+ amount = line.amount
2002+
2003+ ret_move = self.wh_and_reconcile(cr, uid, [ret.id], inv_id,
2004+ amount, acc_id, period_id, journal_id, writeoff_account_id,
2005+ period_id, writeoff_journal_id, context)
2006+
2007+ # make the retencion line point to that move
2008+ rl = {
2009+ 'move_id': ret_move['move_id'],
2010+ }
2011+ #lines = [(op,id,values)] escribir en un one2many
2012+ lines = [(1, line.id, rl)]
2013+ self.write(cr, uid, [ret.id], {'concept_ids':lines})
2014+
2015+ if lines:
2016+ message = _("Income withholding voucher '%s' validated and accounting entry generated.") % self.browse(cr, uid, ids[0]).name
2017+ self.log(cr, uid, ids[0], message)
2018+
2019+ xml_ids = []
2020+ for line in ret.concept_ids:
2021+ xml_ids += [xml.id for xml in line.xml_ids]
2022+ ixwl_obj.write(cr,uid,xml_ids,{'period_id':period_id},context=context)
2023+ self.write(cr,uid,ids,{'period_id':period_id},context=context)
2024 return True
2025
2026
2027@@ -415,46 +410,13 @@
2028 self.pool.get('account.invoice').write(cr, uid, invoice_id, {}, context=context)
2029 return {'move_id': move_id}
2030
2031-
2032- def action_ret_islr(self, cr, uid, ids, context={}):
2033- #TODO: :
2034- inv_obj = self.pool.get('account.invoice')
2035- invoices_brw = inv_obj.browse(cr, uid, ids, context)
2036- wh_doc_list = []
2037- for invoice in invoices_brw:
2038- wh_doc_list = inv_obj.pool.get('islr.wh.doc.invoices').search(cr,uid,[('invoice_id','=',invoice.id)])
2039- if wh_doc_list: #Chequear que la factura no haya sido retenida.
2040- raise osv.except_osv(_('Invalid action !'),_("The Withholding invoice '%s' has already been done!") % (invoice.number))
2041- else: # 1.- Si la factura no ha sido retenida
2042- wh_dict={}
2043- dict_rate={}
2044- dict_completo={}
2045- vendor, buyer, apply_wh = inv_obj._get_partners(cr,uid,invoice) # Se obtiene el (vendedor, el comprador, si el comprador es agente de retencion)
2046- concept_list = inv_obj._get_concepts(cr,uid,invoice)# Se obtiene la lista de conceptos de las lineas de la factura actual.
2047- if concept_list: # 2.- Si existe algun concepto de retencion en las lineas de la factura.
2048- if apply_wh: # 3.- Si el comprador es agente de retencion
2049- wh_dict = inv_obj._get_service_wh(cr, uid, invoice, concept_list) # Se obtiene un dic con la lista de lineas de factura, si se aplico retencion alguna vez, el monto base total de las lineas.
2050- residence = inv_obj._get_residence(cr, uid, vendor, buyer) # Retorna el tipo de residencia del vendedor
2051- nature = inv_obj._get_nature(cr, uid, vendor) # Retorna la naturaleza del vendedor.
2052- dict_rate = inv_obj._get_rate_dict(cr, uid, concept_list, residence, nature,context) # Retorna las tasas por cada concepto
2053- inv_obj._pop_dict(cr,uid,concept_list,dict_rate,wh_dict) # Borra los conceptos y las lineas de factura que no tengan tasa asociada.
2054- dict_completo = inv_obj._get_wh_apply(cr,uid,dict_rate,wh_dict,nature) # Retorna el dict con todos los datos de la retencion por linea de factura.
2055- islr_wh_doc_id=inv_obj._logic_create(cr,uid,dict_completo,context.get('wh_doc_id',False))# Se escribe y crea en todos los modelos asociados al islr.
2056- else:
2057- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the supplier '%s' withholding agent is not!") % (buyer.name))
2058- else:
2059- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the lines of the invoice has not concept withholding!"))
2060- #~ break
2061- return islr_wh_doc_id
2062-
2063-
2064 islr_wh_doc()
2065
2066
2067 class account_invoice(osv.osv):
2068 _inherit = 'account.invoice'
2069 _columns = {
2070- 'islr_wh_doc_id': fields.many2one('islr.wh.doc','Withhold Document',readonly=True,help="Document Withholding Income tax generated from this bill"),
2071+ 'islr_wh_doc_id': fields.many2one('islr.wh.doc','Withhold Document',readonly=True,help="Document Income Withholding tax generated from this bill"),
2072 }
2073 _defaults = {
2074 'islr_wh_doc_id': lambda *a: 0,
2075@@ -474,7 +436,7 @@
2076 class islr_wh_doc_invoices(osv.osv):
2077 _name = "islr.wh.doc.invoices"
2078 _description = 'Document and Invoice Withheld Income'
2079-
2080+
2081 def _amount_all(self, cr, uid, ids, fieldname, args, context=None):
2082 res = {}
2083 for ret_line in self.browse(cr, uid, ids, context):
2084@@ -491,17 +453,226 @@
2085 _columns= {
2086 'islr_wh_doc_id': fields.many2one('islr.wh.doc','Withhold Document', ondelete='cascade', help="Document Retention income tax generated from this bill"),
2087 'invoice_id':fields.many2one('account.invoice','Invoice', help="Withheld invoice"),
2088- 'islr_xml_id':fields.one2many('islr.xml.wh.line','islr_wh_doc_inv_id','Withholding'),
2089- 'amount_islr_ret':fields.function(_amount_all, method=True, digits=(16,4), string='Wh. tax amount', multi='all', help="Withholding tax amount"),
2090- 'base_ret': fields.function(_amount_all, method=True, digits=(16,4), string='Wh. amount', multi='all', help="Withholding without tax amount"),
2091+ 'islr_xml_id':fields.one2many('islr.xml.wh.line','islr_wh_doc_inv_id','Withholding Lines'),
2092+ 'amount_islr_ret':fields.function(_amount_all, method=True, digits=(16,4), string='Withheld Amount', multi='all', help="Amount withheld from the base amount"),
2093+ 'base_ret': fields.function(_amount_all, method=True, digits=(16,4), string='Base Amount', multi='all', help="Amount where a withholding is going to be compute from"),
2094 }
2095 _rec_rame = 'invoice_id'
2096+
2097+ def _get_concepts(self, cr, uid, ids, context=None):
2098+ '''
2099+ Gets a list of withholdable concepts (concept_id) from the invoice lines
2100+ '''
2101+ context = context or {}
2102+ ids = isinstance(ids, (int, long)) and [ids] or ids
2103+ inv_obj = self.pool.get('account.invoice')
2104+ concept_set = set()
2105+ inv_brw = inv_obj.browse(cr, uid, ids[0], context=context)
2106+ for ail in inv_brw.invoice_line:
2107+ if ail.concept_id and ail.concept_id.withholdable:
2108+ concept_set.add(ail.concept_id.id)
2109+ return list(concept_set)
2110+
2111+ def _get_wh(self, cr, uid, ids, concept_id, context=None):
2112+ '''
2113+ Returns a dictionary containing all the values ​​of the retention of an invoice line.
2114+ '''
2115+ context= context or {}
2116+ ids = isinstance(ids, (int, long)) and [ids] or ids
2117+ ixwl_obj= self.pool.get('islr.xml.wh.line')
2118+ iwdl_obj= self.pool.get('islr.wh.doc.line')
2119+ iwdl_brw = iwdl_obj.browse(cr, uid, ids[0], context=context)
2120+
2121+ vendor, buyer, wh_agent = self._get_partners(cr, uid, iwdl_brw.invoice_id)
2122+ apply = not vendor.islr_exempt
2123+ residence = self._get_residence(cr, uid, vendor, buyer)
2124+ nature = self._get_nature(cr, uid, vendor)
2125+
2126+ #rate_base,rate_minimum,rate_wh_perc,rate_subtract,rate_code,rate_id,rate_name
2127+ rate_tuple = self._get_rate(cr, uid, concept_id, residence, nature, context=context)
2128+ base = 0
2129+ for line in iwdl_brw.xml_ids:
2130+ base += line.account_invoice_line_id.price_subtotal
2131+ apply = apply and base >= rate_tuple[0]*rate_tuple[1]/100.0
2132+ wh = 0.0
2133+ subtract = apply and rate_tuple[3] or 0.0
2134+ subtract_write=0.0
2135+ wh_concept = 0.0
2136+ sb_concept = subtract
2137+ for line in iwdl_brw.xml_ids:
2138+ if apply:
2139+ wh_calc = (rate_tuple[0]/100.0)*rate_tuple[2]*line.account_invoice_line_id.price_subtotal/100.0
2140+ if subtract >= wh_calc:
2141+ wh = 0.0
2142+ subtract -= wh_calc
2143+ else:
2144+ wh = wh_calc - subtract
2145+ subtract_write= subtract
2146+ subtract=0.0
2147+ ixwl_obj.write(cr,uid,line.id,{'wh':wh, 'sustract':subtract or subtract_write},
2148+ context=context)
2149+ wh_concept+=wh
2150+ iwdl_obj.write(cr, uid, ids[0],{'amount':wh_concept,
2151+ 'subtract':sb_concept, 'base_amount': base},context=context)
2152+ return True
2153+
2154+
2155+ def load_taxes(self, cr, uid, ids, context=None):
2156+ context = context or {}
2157+ ids = isinstance(ids, (int, long)) and [ids] or ids
2158+ ixwl_obj = self.pool.get('islr.xml.wh.line')
2159+ iwdl_obj = self.pool.get('islr.wh.doc.line')
2160+ ret_line = self.browse(cr, uid, ids[0], context=context)
2161+ lines = []
2162+ rates = {}
2163+ wh_perc= {}
2164+ xmls = {}
2165+ if ret_line.invoice_id:
2166+ #~ Searching & Unlinking for xml lines from the current invoice
2167+ xml_lines = ixwl_obj.search(cr, uid, [('islr_wh_doc_inv_id', '=', ret_line.id)],context=context)
2168+ if xml_lines:
2169+ ixwl_obj.unlink(cr, uid, xml_lines)
2170+
2171+ #~ Creating xml lines from the current invoices again
2172+ ail_brws= [i for i in ret_line.invoice_id.invoice_line if i.concept_id and i.concept_id.withholdable]
2173+ for i in ail_brws:
2174+ values = self._get_xml_lines(cr, uid, i, context=context)
2175+ values.update({'islr_wh_doc_inv_id':ret_line.id,})
2176+ #~ Vuelve a crear las lineas
2177+ xml_id = ixwl_obj.create(cr, uid, values, context=context)
2178+ #~ Write back the new xml_id into the account_invoice_line
2179+ i.write({'wh_xml_id':xml_id},context=context)
2180+ lines.append(xml_id)
2181+ #~ Keeps a log of the rate & percentage for a concept
2182+ rates[i.concept_id.id]=values['rate_id']
2183+ wh_perc[i.concept_id.id]=values['porcent_rete']
2184+ if xmls.get(i.concept_id.id):
2185+ xmls[i.concept_id.id]+=[xml_id]
2186+ else:
2187+ xmls[i.concept_id.id]=[xml_id]
2188+
2189+ #~ Searching & Unlinking for concept lines from the current invoice
2190+ iwdl_ids = iwdl_obj.search(cr, uid, [('invoice_id', '=', ret_line.invoice_id.id)],context=context)
2191+ if iwdl_ids:
2192+ iwdl_obj.unlink(cr, uid, iwdl_ids)
2193+ iwdl_ids=[]
2194+ #~ Creating concept lines for the current invoice
2195+ concept_list = self._get_concepts(cr, uid, ret_line.invoice_id.id, context=context)
2196+ for concept_id in concept_list:
2197+ iwdl_id=iwdl_obj.create(cr,uid,
2198+ {'islr_wh_doc_id':ret_line.islr_wh_doc_id.id,
2199+ 'concept_id':concept_id,
2200+ 'islr_rates_id':rates[concept_id],
2201+ 'invoice_id': ret_line.invoice_id.id,
2202+ 'retencion_islr':wh_perc[concept_id],
2203+ 'xml_ids': [(6,0,xmls[concept_id])],
2204+ }, context=context)
2205+ self._get_wh(cr, uid, iwdl_id, concept_id, context=context)
2206+ return True
2207+
2208+ def _get_partners(self, cr, uid, invoice):
2209+ '''
2210+ Se obtiene: el id del vendedor, el id del comprador de la factura y el campo booleano que determina si el comprador es agente de retencion.
2211+ '''
2212+ if invoice.type == 'in_invoice' or invoice.type == 'in_refund':
2213+ vendor = invoice.partner_id
2214+ buyer = invoice.company_id.partner_id
2215+ ret_code = invoice
2216+ else:
2217+ buyer = invoice.partner_id
2218+ vendor = invoice.company_id.partner_id
2219+ return (vendor, buyer, buyer.islr_withholding_agent)
2220+
2221+ def _get_residence(self, cr, uid, vendor, buyer):
2222+ '''
2223+ Se determina si la direccion fiscal del comprador es la misma que la del vendedor, con el fin de luego obtener la tasa asociada.
2224+ Retorna True si es una persona domiciliada o residente. Retorna False si es, no Residente o No Domicialiado.
2225+ '''
2226+ vendor_address = self._get_country_fiscal(cr, uid, vendor)
2227+ buyer_address = self._get_country_fiscal(cr, uid, buyer)
2228+ if vendor_address and buyer_address:
2229+ if vendor_address == buyer_address:
2230+ return True
2231+ else:
2232+ return False
2233+ return False
2234+
2235+ def _get_nature(self, cr, uid, partner_id):
2236+ '''
2237+ Se obtiene la naturaleza del vendedor a partir del RIF, retorna True si es persona de tipo natural, y False si es juridica.
2238+ '''
2239+ if not partner_id.vat:
2240+ raise osv.except_osv(_('Invalid action !'),_("Impossible income withholding, because the partner '%s' has not vat associated!") % (partner_id.name))
2241+ return False
2242+ else:
2243+ if partner_id.vat[2:3] in 'VvEe' or partner_id.spn:
2244+ return True
2245+ else:
2246+ return False
2247+
2248+ def _get_rate(self, cr, uid, concept_id, residence, nature,context):
2249+ '''
2250+ Se obtiene la tasa del concepto de retencion, siempre y cuando exista uno asociado a las especificaciones:
2251+ La naturaleza del vendedor coincida con una tasa.
2252+ La residencia del vendedor coindica con una tasa.
2253+ '''
2254+ ut_obj = self.pool.get('l10n.ut')
2255+ rate_brw_lst = self.pool.get('islr.wh.concept').browse(cr, uid, concept_id).rate_ids
2256+ for rate_brw in rate_brw_lst:
2257+ if rate_brw.nature == nature and rate_brw.residence == residence:
2258+ #~ (base,min,porc,sust,codigo,id_rate,name_rate)
2259+ rate_brw_minimum = ut_obj.compute_ut_to_money(cr, uid, rate_brw.minimum, False, context)#metodo que transforma los UVT en pesos
2260+ rate_brw_subtract = ut_obj.compute_ut_to_money(cr, uid, rate_brw.subtract, False, context)#metodo que transforma los UVT en pesos
2261+ return (rate_brw.base, rate_brw_minimum, rate_brw.wh_perc, rate_brw_subtract,rate_brw.code,rate_brw.id,rate_brw.name)
2262+ return ()
2263+
2264+ def _get_country_fiscal(self,cr, uid, partner_id,context=None):
2265+ '''
2266+ Get the country of the partner
2267+ '''
2268+ #TODO: THIS METHOD SHOULD BE IMPROVED
2269+ #DUE TO OPENER HAS CHANGED THE WAY PARTNER
2270+ #ARE USED FOR ACCOUNT_MOVE
2271+ context = context or {}
2272+ if not partner_id.country_id:
2273+ raise osv.except_osv(_('Invalid action !'),_("Impossible income withholding, because the partner '%s' country has not been defined in the address!") % (partner_id.name))
2274+ else:
2275+ return partner_id.country_id.id
2276+
2277+ def _get_xml_lines(self, cr, uid, ail_brw, context=None):
2278+ context = context or {}
2279+ vendor, buyer, wh_agent = self._get_partners(cr, uid, ail_brw.invoice_id)
2280+ residence = self._get_residence(cr, uid, vendor, buyer)
2281+ nature = self._get_nature(cr, uid, vendor)
2282+ rate_base,rate_minimum,rate_wh_perc,rate_subtract,rate_code,rate_id,rate_name = self._get_rate(cr, uid, ail_brw.concept_id.id, residence, nature,context=context)
2283+
2284+ wh = ((rate_base * ail_brw.price_subtotal /100) * rate_wh_perc)/100.0
2285+
2286+ return {
2287+ 'account_invoice_id':ail_brw.invoice_id.id,
2288+ 'islr_wh_doc_line_id':False,
2289+ 'islr_xml_wh_doc':False,
2290+ 'wh':wh, # Debo buscarlo
2291+ 'base':ail_brw.price_subtotal, # La consigo tambien pero desde el rate
2292+ 'period_id':False, # Debemos revisar la definicion porque esta en NOT NULL
2293+ 'invoice_number':ail_brw.invoice_id.reference,
2294+ 'rate_id':rate_id, # La consigo tambien pero desde el rate
2295+ 'partner_id':ail_brw.invoice_id.partner_id.id, #Warning Depende de si es cliente o proveedor
2296+ 'concept_id':ail_brw.concept_id.id,
2297+ 'partner_vat':vendor.vat[2:12], #Warning Depende si es cliente o proveedor
2298+ 'porcent_rete':rate_wh_perc, # La consigo tambien pero desde el rate
2299+ 'control_number':ail_brw.invoice_id.nro_ctrl,
2300+ 'sustract':rate_subtract,# La consigo tambien pero desde el rate
2301+ 'account_invoice_line_id':ail_brw.id,
2302+ 'concept_code':rate_code,# La consigo tambien pero desde el rate
2303+ }
2304+
2305 islr_wh_doc_invoices()
2306
2307
2308 class islr_wh_doc_line(osv.osv):
2309 _name = "islr.wh.doc.line"
2310- _description = 'Lines of Document Withholding Income'
2311+ _description = 'Lines of Document Income Withholding'
2312
2313 def _retention_rate(self, cr, uid, ids, name, args, context=None):
2314 res = {}
2315@@ -515,10 +686,12 @@
2316 _columns= {
2317 'name': fields.char('Description', size=64, help="Description of the voucher line"),
2318 'invoice_id': fields.many2one('account.invoice', 'Invoice', ondelete='set null', help="Invoice to withhold"),
2319- 'amount':fields.float('Amount', digits_compute= dp.get_precision('Withhold ISLR'), help="Withheld amount"),
2320+ 'amount':fields.float('Withheld Amount', digits_compute= dp.get_precision('Withhold ISLR'), help="Withheld amount"),
2321+ 'base_amount':fields.float('Base Amount', digits_compute= dp.get_precision('Withhold ISLR'), help="Base amount"),
2322+ 'subtract':fields.float('Subtract', digits_compute= dp.get_precision('Withhold ISLR'), help="Subtract"),
2323 'islr_wh_doc_id': fields.many2one('islr.wh.doc','Withhold Document', ondelete='cascade', help="Document Retention income tax generated from this bill"),
2324- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept', help="Withhold concept associated with this rate"),
2325- 'retencion_islr':fields.float('Percentage', digits_compute= dp.get_precision('Withhold ISLR'), help="Withholding percentage"),
2326+ 'concept_id': fields.many2one('islr.wh.concept','Withholding Concept', help="Withholding concept associated with this rate"),
2327+ 'retencion_islr':fields.float('Withholding Rate', digits_compute= dp.get_precision('Withhold ISLR'), help="Withholding Rate"),
2328 'retention_rate': fields.function(_retention_rate, method=True, string='Withholding Rate', type='float', help="Withhold rate has been applied to the invoice", digits_compute= dp.get_precision('Withhold ISLR')),
2329 'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, help="Accounting voucher"),
2330 'islr_rates_id': fields.many2one('islr.rates','Rates', help="Withhold rates"),
2331
2332=== modified file 'l10n_ve_withholding_islr/model/islr_xml_wh.py'
2333--- l10n_ve_withholding_islr/model/islr_xml_wh.py 2012-12-09 23:55:45 +0000
2334+++ l10n_ve_withholding_islr/model/islr_xml_wh.py 2012-12-26 22:37:22 +0000
2335@@ -57,7 +57,7 @@
2336 return res
2337
2338 _columns = {
2339- 'name':fields.char('Description',128, required=True, select=True, help = "Description about statement of withholding income"),
2340+ 'name':fields.char('Description',128, required=True, select=True, help = "Description about statement of income withholding"),
2341 'company_id': fields.many2one('res.company', 'Company', required=True, help="Company"),
2342 'state': fields.selection([
2343 ('draft','Draft'),
2344@@ -66,7 +66,7 @@
2345 ('cancel','Cancelled')
2346 ],'State', readonly=True, help="Voucher state"),
2347 'period_id':fields.many2one('account.period','Period',required=True, help="Period when the accounts entries were done"),
2348- 'amount_total_ret':fields.function(_get_amount_total,method=True, digits=(16, 2), readonly=True, string='Withholding Income Amount Total', help="Amount Total of withholding"),
2349+ 'amount_total_ret':fields.function(_get_amount_total,method=True, digits=(16, 2), readonly=True, string='Income Withholding Amount Total', help="Amount Total of withholding"),
2350 'amount_total_base':fields.function(_get_amount_total_base,method=True, digits=(16, 2), readonly=True, string='Without Tax Amount Total', help="Total without taxes"),
2351 'xml_ids':fields.one2many('islr.xml.wh.line','islr_xml_wh_doc','XML Document Lines', readonly=True ,states={'draft':[('readonly',False)]}),
2352 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),
2353@@ -79,7 +79,7 @@
2354 'user_id': lambda s, cr, u, c: u,
2355
2356 'period_id': lambda self,cr,uid,context: self.period_return(cr,uid,context),
2357- 'name':lambda self,cr,uid,context : 'Withholding Income '+time.strftime('%m/%Y')
2358+ 'name':lambda self,cr,uid,context : 'Income Withholding '+time.strftime('%m/%Y')
2359 }
2360
2361 def period_return(self,cr,uid,context=None):
2362@@ -193,17 +193,17 @@
2363 _description = 'Generate XML Lines'
2364
2365 _columns = {
2366- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Withhold concept associated with this rate",required=True, ondelete='cascade'),
2367- 'period_id':fields.many2one('account.period','Period',required=False, help="Period when the accounts entries were done"),
2368+ 'concept_id': fields.many2one('islr.wh.concept','Withholding Concept',help="Withholding concept associated with this rate",required=True, ondelete='cascade'),
2369+ 'period_id':fields.many2one('account.period','Period',required=False, help="Period when the journal entries were done"),
2370 'partner_vat': fields.char('VAT', size=10, required=True, help="Partner VAT"),
2371 'invoice_number': fields.char('Invoice Number',size=10,required=True, help="Number of invoice"),
2372 'control_number': fields.char('Control Number',size=8,required=True, help="Reference"),
2373 'concept_code': fields.char('Concept Code', size=10, required=True, help="Concept code"),
2374- 'base': fields.float('Without Tax Amount', required=True, help="Taxable", digits_compute= dp.get_precision('Withhold ISLR')),
2375- 'porcent_rete': fields.float('% Withhold', required=True, help="Percentage of Withhold", digits_compute= dp.get_precision('Withhold ISLR')),
2376+ 'base': fields.float('Base Amount', required=True, help="Amount where a withholding is going to be computed from", digits_compute= dp.get_precision('Withhold ISLR')),
2377+ 'porcent_rete': fields.float('Withholding Rate', required=True, help="Withholding Rate", digits_compute= dp.get_precision('Withhold ISLR')),
2378 'wh':fields.float('Withheld Amount',required=True, help="Withheld amount to partner", digits_compute= dp.get_precision('Withhold ISLR')),
2379 'rate_id':fields.many2one('islr.rates', 'Person Type',domain="[('concept_id','=',concept_id)]",required=True, help="Person type"),
2380- 'islr_wh_doc_line_id':fields.many2one('islr.wh.doc.line','Withholding Income Document', help="Withhold income document"),
2381+ 'islr_wh_doc_line_id':fields.many2one('islr.wh.doc.line','Income Withholding Document', help="Income Withholding Document"),
2382 'account_invoice_line_id':fields.many2one('account.invoice.line','Invoice Line', help="Invoice line to Withhold"),
2383 'account_invoice_id':fields.many2one('account.invoice','Invoice', help="Invoice to Withhold"),
2384 'islr_xml_wh_doc': fields.many2one('islr.xml.wh.doc','ISLR XML Document', help="Income tax XML Doc"),
2385
2386=== modified file 'l10n_ve_withholding_islr/model/partner.py'
2387--- l10n_ve_withholding_islr/model/partner.py 2012-12-09 23:55:45 +0000
2388+++ l10n_ve_withholding_islr/model/partner.py 2012-12-26 22:37:22 +0000
2389@@ -42,6 +42,9 @@
2390 'islr_exempt': fields.boolean('Is it exempt from income withholding?'),
2391 }
2392
2393+ _defaults = {
2394+ 'islr_withholding_agent': lambda *a: True,
2395+ }
2396 res_partner()
2397
2398
2399
2400=== modified file 'l10n_ve_withholding_islr/model/product.py'
2401--- l10n_ve_withholding_islr/model/product.py 2012-12-09 23:55:45 +0000
2402+++ l10n_ve_withholding_islr/model/product.py 2012-12-26 22:37:22 +0000
2403@@ -37,7 +37,7 @@
2404 _inherit = "product.template"
2405
2406 _columns = {
2407- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Concept Withholding Income to apply to the service", required=False),
2408+ 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Concept Income Withholding to apply to the service", required=False),
2409 }
2410
2411 product_template()
2412@@ -59,7 +59,7 @@
2413 if concept_id:
2414 concept_id = concept_obj.search(cr, uid, [('name','ilike','NO APLICA RETENCION')])[0]
2415 else:
2416- raise osv.except_osv(_('Invalid action !'),_("Must create the concept of withholding income"))
2417+ raise osv.except_osv(_('Invalid action !'),_("Must create the concept of income withholding"))
2418
2419 return {'value' : {'concept_id':concept_id or False}}
2420
2421
2422=== modified file 'l10n_ve_withholding_islr/report/islr_wh_report.xml'
2423--- l10n_ve_withholding_islr/report/islr_wh_report.xml 2012-12-19 18:17:09 +0000
2424+++ l10n_ve_withholding_islr/report/islr_wh_report.xml 2012-12-26 22:37:22 +0000
2425@@ -6,7 +6,7 @@
2426 model="islr.wh.doc"
2427 name="islr.wh.doc"
2428 rml="addons/l10n_ve_withholding_islr/report/wh_islr_report.rml"
2429- string="Voucher Withholding Income"
2430+ string="Voucher Income Withholding"
2431 auto="False"
2432 header="False"
2433 menu="False"
2434@@ -18,7 +18,7 @@
2435 model="islr.xml.wh.doc"
2436 name="list.wh.islr"
2437 rml="addons/l10n_ve_withholding_islr/report/list_wh_islr_report.rml"
2438- string="Withholding Income"
2439+ string="Income Withholding"
2440 auto = "True"
2441 header="False"/>
2442
2443
2444=== modified file 'l10n_ve_withholding_islr/view/installer.xml'
2445--- l10n_ve_withholding_islr/view/installer.xml 2012-12-12 01:44:29 +0000
2446+++ l10n_ve_withholding_islr/view/installer.xml 2012-12-26 22:37:22 +0000
2447@@ -4,18 +4,17 @@
2448 <record id="wh_islr_config_view" model="ir.ui.view">
2449 <field name="name">Configure your ISLR Withholdings</field>
2450 <field name="model">wh.islr.config</field>
2451- <field name="type">form</field>
2452 <field name="inherit_id" ref="base.res_config_view_base"/>
2453 <field name="arch" type="xml">
2454 <data>
2455 <form position="attributes">
2456- <attribute name="string">Withholding income Configuration</attribute>
2457+ <attribute name="string">Income withholding Configuration</attribute>
2458 </form>
2459
2460 <xpath expr='//group[@string="res_config_contents"]' position='before'>
2461 <group colspan="4" col="8">
2462 <group colspan="1" width="220">
2463- <label align="0.0" string="Configure your company's withholding income" width="200" colspan="2"/>
2464+ <label align="0.0" string="Configure your company's income withholding" width="200" colspan="2"/>
2465 </group>
2466 <separator orientation="vertical" colspan="1" rowspan="15"/>
2467 <group colspan="6">
2468
2469=== modified file 'l10n_ve_withholding_islr/view/invoice_view.xml'
2470--- l10n_ve_withholding_islr/view/invoice_view.xml 2012-12-14 19:49:40 +0000
2471+++ l10n_ve_withholding_islr/view/invoice_view.xml 2012-12-26 22:37:22 +0000
2472@@ -11,7 +11,6 @@
2473 <record id="account_invoice_wh_islr_customer" model="ir.ui.view">
2474 <field name="name">account.invoice.wh.islr.customer</field>
2475 <field name="model">account.invoice</field>
2476- <field name="type">form</field>
2477 <field name="inherit_id" ref="l10n_ve_withholding.wh_inv_customer"/>
2478 <field name="arch" type="xml">
2479 <xpath expr="//separator[@string='vsep']" position="after">
2480@@ -31,7 +30,6 @@
2481 <record id="account_invoice_wh_islr_supplier" model="ir.ui.view">
2482 <field name="name">account.invoice.wh.islr.supplier</field>
2483 <field name="model">account.invoice</field>
2484- <field name="type">form</field>
2485 <field name="inherit_id" ref="l10n_ve_withholding.wh_inv_supplier"/>
2486 <field name="arch" type="xml">
2487 <xpath expr="//separator[@string='vsep']" position="after">
2488@@ -51,7 +49,6 @@
2489 <record model="ir.ui.view" id="view_account_invoice_form_concept_islr">
2490 <field name="name">account_invoice_concept_islr</field>
2491 <field name="model">account.invoice</field>
2492- <field name="type">form</field>
2493 <field name="inherit_id" ref="account.invoice_supplier_form"/>
2494 <field name="arch" type="xml">
2495 <xpath expr="//field[@name='quantity']" position="before">
2496@@ -63,7 +60,6 @@
2497 <record model="ir.ui.view" id="view_invoice_line_form_islr">
2498 <field name="name">account_invoice_line_concept_islr</field>
2499 <field name="model">account.invoice.line</field>
2500- <field name="type">form</field>
2501 <field name="inherit_id" ref="account.view_invoice_line_form"/>
2502 <field name="arch" type="xml">
2503 <xpath expr="//field[@name='product_id']" position="before">
2504@@ -75,7 +71,6 @@
2505 <record model="ir.ui.view" id="view_invoice_line_tree_islr">
2506 <field name="name">account_invoice_line_tree_concept_islr</field>
2507 <field name="model">account.invoice.line</field>
2508- <field name="type">tree</field>
2509 <field name="inherit_id" ref="account.view_invoice_line_tree"/>
2510 <field name="arch" type="xml">
2511 <xpath expr="//field[@name='name']" position="after">
2512
2513=== modified file 'l10n_ve_withholding_islr/view/islr_wh_concept_view.xml'
2514--- l10n_ve_withholding_islr/view/islr_wh_concept_view.xml 2012-12-17 19:11:02 +0000
2515+++ l10n_ve_withholding_islr/view/islr_wh_concept_view.xml 2012-12-26 22:37:22 +0000
2516@@ -9,12 +9,11 @@
2517 <record id="view_wh_concept_filter" model="ir.ui.view">
2518 <field name="name">islr.wh.concept.search</field>
2519 <field name="model">islr.wh.concept</field>
2520- <field name="type">search</field>
2521 <field name="arch" type="xml">
2522- <search string="Search Concept of Withholding Income">
2523+ <search string="Search Concept of Income Withholding">
2524 <group col="10" colspan="4">
2525 <filter name="withholdable" string="Withhold" domain="[('withholdable','=','True')]" help="Concept withholding withheld"/>
2526- <filter domain="[('user_id','=',uid)]" help="My Withholding Income" separator="1"/>
2527+ <filter domain="[('user_id','=',uid)]" help="My Income Withholding" separator="1"/>
2528 </group>
2529 </search>
2530 </field>
2531@@ -23,7 +22,6 @@
2532 <record id="view_wh_islr_rate_form" model="ir.ui.view">
2533 <field name="name">tasas_form</field>
2534 <field name="model">islr.rates</field>
2535- <field name="type">form</field>
2536 <field name="arch" type="xml">
2537 <form string="Rates">
2538 <field name="name" colspan="4"/>
2539@@ -43,7 +41,6 @@
2540 <record id="view_wh_islr_rate_tree" model="ir.ui.view">
2541 <field name="name">tasas_tree</field>
2542 <field name="model">islr.rates</field>
2543- <field name="type">tree</field>
2544 <field name="arch" type="xml">
2545 <tree string="Rates">
2546 <field name="name"/>
2547@@ -61,9 +58,8 @@
2548 <record id="view_wh_concept_islr_tree" model="ir.ui.view">
2549 <field name="name">islr.wh.concept_tree</field>
2550 <field name="model">islr.wh.concept</field>
2551- <field name="type">tree</field>
2552 <field name="arch" type="xml">
2553- <tree string="Concept of Withholding Income">
2554+ <tree string="Concept of Income Withholding">
2555 <field name="name"/>
2556 <field name="withholdable"/>
2557 </tree>
2558@@ -73,9 +69,8 @@
2559 <record id="view_wh_concept_islr_form" model="ir.ui.view">
2560 <field name="name">islr.wh.concept_form</field>
2561 <field name="model">islr.wh.concept</field>
2562- <field name="type">form</field>
2563 <field name="arch" type="xml">
2564- <form string="Concept of Withholding Income">
2565+ <form string="Concept of Income Withholding">
2566 <group colspan="4" col="4">
2567 <field name="name"/>
2568 <field name="withholdable"/>
2569@@ -92,13 +87,13 @@
2570 </record>
2571
2572 <record model="ir.actions.act_window" id="action_wh_islr_concept">
2573- <field name="name">Concept of Withholding Income</field>
2574+ <field name="name">Concept of Income Withholding</field>
2575 <field name="res_model">islr.wh.concept</field>
2576 <field name="type">ir.actions.act_window</field>
2577 <field name="view_type">form</field>
2578 <field name="view_mode">tree,form</field>
2579 <field name="search_view_id" ref="view_wh_concept_filter"/>
2580- <field name="help">With "Concept of Withholding Income" you can create and manage the concept of wittholding income. For each concept is to create and manage rates associated.</field>
2581+ <field name="help">With "Concept of Income Withholding" you can create and manage the concept of wittholding income. For each concept is to create and manage rates associated.</field>
2582 </record>
2583
2584 <record model="ir.actions.act_window.view" id="action_wh_islr_concept_tree">
2585@@ -114,7 +109,7 @@
2586 <field name="act_window_id" ref="action_wh_islr_concept"/>
2587 </record>
2588
2589- <menuitem name="Concept of Withholding Income"
2590+ <menuitem name="Concept of Income Withholding"
2591 id="menu_action_concept_retention"
2592 parent="menu_wh_configuration_islr"
2593 action="action_wh_islr_concept"/>
2594
2595=== modified file 'l10n_ve_withholding_islr/view/islr_wh_doc_view.xml'
2596--- l10n_ve_withholding_islr/view/islr_wh_doc_view.xml 2012-12-18 13:23:28 +0000
2597+++ l10n_ve_withholding_islr/view/islr_wh_doc_view.xml 2012-12-26 22:37:22 +0000
2598@@ -8,10 +8,22 @@
2599 =====================================================
2600 -->
2601
2602+ <record id="view_islr_wh_doc_invoices_tree_" model="ir.ui.view">
2603+ <field name="name">islr.wh.doc.invoices_tree</field>
2604+ <field name="model">islr.wh.doc.invoices</field>
2605+ <field name="arch" type="xml">
2606+ <tree string="Withheld Invoices">
2607+ <field name="invoice_id"/>
2608+ <field name="islr_xml_id"/>
2609+ <field name="amount_islr_ret"/>
2610+ <field name="base_ret"/>
2611+ </tree>
2612+ </field>
2613+ </record>
2614+
2615 <record id="view_islr_wh_doc_invoices_form_" model="ir.ui.view">
2616 <field name="name">islr.wh.doc.invoices_form</field>
2617 <field name="model">islr.wh.doc.invoices</field>
2618- <field name="type">form</field>
2619 <field name="arch" type="xml">
2620 <form string="Invoices">
2621 <field
2622@@ -20,7 +32,8 @@
2623 colspan='6'/>
2624 <newline/>
2625 <field name="islr_xml_id" nolabel="1" colspan='4'>
2626- <tree string="Detail of the Concept of Withholding Income">
2627+ <tree string="Detail of the Concept of Income Withholding">
2628+ <field name="concept_code"/>
2629 <field name="rate_id"/>
2630 <field name="wh"/>
2631 <field name="porcent_rete"/>
2632@@ -43,15 +56,14 @@
2633 <record id="view_wh_islr_filter_customer" model="ir.ui.view">
2634 <field name="name">islr.wh.doc.search</field>
2635 <field name="model">islr.wh.doc</field>
2636- <field name="type">search</field>
2637 <field name="arch" type="xml">
2638- <search string="Search Withholding Income">
2639+ <search string="Search Income Withholding">
2640 <group col="10" colspan="4">
2641- <filter name="to_process" string="To Process" domain="[('state','=','to_process')]" help="To Process Withholding Income"/>
2642- <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Withholding Income"/>
2643- <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Withholding Income"/>
2644- <filter name="done" string="Done" domain="[('state','=','done')]" help="Done Withholding Income"/>
2645- <filter name="cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Withholding Income"/>
2646+ <filter name="to_process" string="To Process" domain="[('state','=','to_process')]" help="To Process Income Withholding"/>
2647+ <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Income Withholding"/>
2648+ <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Income Withholding"/>
2649+ <filter name="done" string="Done" domain="[('state','=','done')]" help="Done Income Withholding"/>
2650+ <filter name="cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Income Withholding"/>
2651 </group>
2652 <group expand="1" string="Group By...">
2653 <filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
2654@@ -67,9 +79,8 @@
2655 <record id="view_islr_line_tree" model="ir.ui.view">
2656 <field name="name">islr.wh.doc_line_tree</field>
2657 <field name="model">islr.wh.doc.line</field>
2658- <field name="type">tree</field>
2659 <field name="arch" type="xml">
2660- <tree string="Lines Withholding Income" editable="bottom" >
2661+ <tree string="Lines Income Withholding" editable="bottom" >
2662 <field name="name"/>
2663 <field name="concept_id"/>
2664 <field name="retencion_islr"/>
2665@@ -82,14 +93,13 @@
2666 <record id="view_islr_line_form" model="ir.ui.view">
2667 <field name="name">islr.wh.doc.line_form</field>
2668 <field name="model">islr.wh.doc.line</field>
2669- <field name="type">form</field>
2670 <field name="arch" type="xml">
2671- <form string="Lines Withholding Income">
2672+ <form string="Lines Income Withholding">
2673 <field name="concept_id" colspan='6'/>
2674 <field name="move_id" colspan='6'/>
2675 <newline/>
2676 <field name="xml_ids" nolabel="1" colspan='4'>
2677- <tree string="Detail of the Concept of Withholding Income">
2678+ <tree string="Detail of the Concept of Income Withholding">
2679 <field name="rate_id"/>
2680 <field name="wh"/>
2681 <field name="porcent_rete"/>
2682@@ -103,9 +113,8 @@
2683 <record id="view_islr_tree_customers" model="ir.ui.view">
2684 <field name="name">islr.wh.doc_tree_customers</field>
2685 <field name="model">islr.wh.doc</field>
2686- <field name="type">tree</field>
2687 <field name="arch" type="xml">
2688- <tree colors="blue:state=='draft'" string="Customer Withholding Income">
2689+ <tree colors="blue:state=='draft'" string="Customer Income Withholding">
2690 <field name="partner_id"/>
2691 <field name="date_ret"/>
2692 <field name="period_id"/>
2693@@ -122,9 +131,8 @@
2694 <record id="view_islr_form_customers" model="ir.ui.view">
2695 <field name="name">islr.wh.doc_form_customers</field>
2696 <field name="model">islr.wh.doc</field>
2697- <field name="type">form</field>
2698 <field name="arch" type="xml">
2699- <form string="Customer Withholding Income">
2700+ <form string="Customer Income Withholding">
2701 <group colspan="4" col="6">
2702 <field name="journal_id" domain="[('type','=','islr_sale')]"/>
2703 <field name="type"/>
2704@@ -138,10 +146,13 @@
2705 <field name="date_uid"/>
2706 </group>
2707 <notebook colspan="6">
2708+ <page string="Invoices to Be Withheld">
2709+ <field name='invoice_ids' nolabel='1'/>
2710+ </page>
2711 <page string="Invoices">
2712 <field domain="[('partner_id','=',partner_id),('status','=','no_pro'),('state','in',['open','paid']),('type','in',['out_invoice','out_refund'])]" colspan="6" name="islr_wh_doc_id" nolabel="1" widget="many2many"/>
2713 </page>
2714- <page string="Concept of Withholding Income">
2715+ <page string="Concept of Income Withholding">
2716 <field colspan="6" name="concept_ids" nolabel="1" widget="one2many_list"/>
2717 <group col="4" colspan="2">
2718 <field name="amount_total_ret"/>
2719@@ -154,10 +165,9 @@
2720 <group colspan="6" col="2">
2721 <group col="1">
2722 <field name="state"/>
2723- <button name="act_progress" string="Progress" states="draft" icon="gtk-go-forward"/>
2724- <button name="act_confirmed" string="Confirmed" states="progress" icon="gtk-go-forward"/>
2725+ <button name="act_confirm" string="Confirmed" states="draft" icon="gtk-go-forward"/>
2726 <button name="act_done" string="Done" states="confirmed" icon="gtk-execute" />
2727- <button name="%(voucher_report_withholding_islr)d" string="Print Withholding Income" states="done" colspan="3" type="action" icon="gtk-execute"/>
2728+ <button name="%(voucher_report_withholding_islr)d" string="Print Income Withholding" states="done" colspan="3" type="action" icon="gtk-execute"/>
2729 <button name="act_cancel" string="Cancel" states="draft,progress,confirmed,done" icon="gtk-cancel" />
2730 <button name="act_draft" colspan="2" string="Set to draft" states="cancel" icon="gtk-go-forward"/>
2731 </group>
2732@@ -175,14 +185,13 @@
2733 <record id="view_wh_islr_filter_suppliers" model="ir.ui.view">
2734 <field name="name">islr.wh.doc.search</field>
2735 <field name="model">islr.wh.doc</field>
2736- <field name="type">search</field>
2737 <field name="arch" type="xml">
2738- <search string="Search Withholding Income">
2739+ <search string="Search Income Withholding">
2740 <group col="10" colspan="4">
2741- <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Withholding Income"/>
2742- <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Withholding Income"/>
2743- <filter name="done" string="Done" domain="[('state','=','done')]" help="Done Withholding Income"/>
2744- <filter name="cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Withholding Income"/>
2745+ <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Income Withholding"/>
2746+ <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Income Withholding"/>
2747+ <filter name="done" string="Done" domain="[('state','=','done')]" help="Done Income Withholding"/>
2748+ <filter name="cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Income Withholding"/>
2749 </group>
2750 <newline/>
2751 <group expand="1" string="Group By...">
2752@@ -199,9 +208,8 @@
2753 <record id="view_wh_islr_tree_suppliers" model="ir.ui.view">
2754 <field name="name">islr.wh.doc_tree_suppliers</field>
2755 <field name="model">islr.wh.doc</field>
2756- <field name="type">tree</field>
2757 <field name="arch" type="xml">
2758- <tree colors="blue:state=='draft'" string="Supplier Withholding Income">
2759+ <tree colors="blue:state=='draft'" string="Supplier Income Withholding">
2760 <field name="partner_id"/>
2761 <field name="date_ret"/>
2762 <field name="period_id"/>
2763@@ -215,49 +223,11 @@
2764 </field>
2765 </record>
2766
2767- <record id="view_islr_line_tree" model="ir.ui.view">
2768- <field name="name">islr.wh.doc_line_tree2</field>
2769- <field name="model">islr.wh.doc.line</field>
2770- <field name="type">tree</field>
2771- <field name="arch" type="xml">
2772- <tree string="Lines Withholding Income" editable="bottom" >
2773- <field name="name"/>
2774- <field name="concept_id"/>
2775- <field name="retencion_islr"/>
2776- <field name="amount"/>
2777- <field name="move_id"/>
2778- </tree>
2779- </field>
2780- </record>
2781-
2782- <record id="view_islr_line_form" model="ir.ui.view">
2783- <field name="name">islr.wh.doc.line_form2</field>
2784- <field name="model">islr.wh.doc.line</field>
2785- <field name="type">form</field>
2786- <field name="arch" type="xml">
2787- <form string="Lines Withholding Income">
2788- <field name="concept_id" colspan='6'/>
2789- <field name="move_id" colspan='6'/>
2790- <newline/>
2791- <field name="xml_ids" nolabel="1" colspan='4'>
2792- <tree string="Detail of the Concept of Withholding Income">
2793- <field name="rate_id"/>
2794- <field name="wh"/>
2795- <field name="porcent_rete"/>
2796- <field name="base"/>
2797- </tree>
2798- </field>
2799- </form>
2800- </field>
2801- </record>
2802-
2803-
2804 <record id="view_wh_islr_form_suppliers" model="ir.ui.view">
2805 <field name="name">islr.wh.doc_form_suppliers</field>
2806 <field name="model">islr.wh.doc</field>
2807- <field name="type">form</field>
2808 <field name="arch" type="xml">
2809- <form string="Supplier Withholding Income">
2810+ <form string="Supplier Income Withholding">
2811 <group colspan="4" col="6">
2812 <field name="journal_id" domain="[('type','=','islr_purchase')]"/>
2813 <field name="type"/>
2814@@ -273,36 +243,60 @@
2815 <field name="invoice_id" />
2816 </group>
2817 <notebook colspan="6">
2818- <page string="Invoices">
2819+ <page string="Invoices to Be Withheld">
2820+ <field name="invoice_ids" nolabel='1'/>
2821+ </page>
2822+ <page string="Invoices" invisible='1'>
2823 <field domain="[('partner_id','=',partner_id),('status','=','no_pro'),('state','in',['open','paid']),('type','in',['in_invoice','in_refund'])]" colspan="6" name="islr_wh_doc_id" nolabel="1" widget="many2many"/>
2824 </page>
2825- <page string="Concept of Withholding Income">
2826- <field colspan="6" name="concept_ids" nolabel="1" widget="one2many_list"/>
2827- <group col="4" colspan="2">
2828- <field name="amount_total_ret"/>
2829- </group>
2830- </page>
2831- <page string="Invoices" invisible="1">
2832- <field name="invoice_ids" nolabel="1">
2833- <tree string="Invoices Withhelds">
2834+ <page string="Income Withholding Concepts">
2835+ <field colspan="6" name="concept_ids" nolabel="1">
2836+ <tree string="Income Withholding Concepts">
2837+ <field name="name" invisible='1'/>
2838 <field name="invoice_id"/>
2839- <field name="islr_xml_id"/>
2840- <field name="amount_islr_ret"/>
2841- <field name="base_ret"/>
2842+ <field name="concept_id"/>
2843+ <field name="base_amount"/>
2844+ <field name="retencion_islr"/>
2845+ <field name="subtract"/>
2846+ <field name="amount"/>
2847+ <field name="move_id"/>
2848 </tree>
2849+ <form string="Income Withholding Concepts">
2850+ <field name="invoice_id"/>
2851+ <newline/>
2852+ <field name="concept_id" colspan='6'/>
2853+ <newline/>
2854+ <field name="xml_ids" nolabel="1" colspan='4'>
2855+ <tree string="Detail of the Concept of Income Withholding">
2856+ <field name="concept_code"/>
2857+ <field name="rate_id"/>
2858+ <field name="wh"/>
2859+ <field name="porcent_rete"/>
2860+ <field name="base"/>
2861+ </tree>
2862+ </field>
2863+ <field name="base_amount"/>
2864+ <field name="subtract"/>
2865+ <field name="retencion_islr"/>
2866+ <field name="amount"/>
2867+ <field name="move_id" colspan='6'/>
2868+ </form>
2869 </field>
2870 </page>
2871 <page string="Other Information">
2872 <field name="company_id"/>
2873 </page>
2874 </notebook>
2875+ <group col="4" colspan="2">
2876+ <field name="amount_total_ret"/>
2877+ <button colspan="2" name="compute_amount_wh" string="Compute Income Withholding" type="object" icon="terp-stock_format-scientific"/>
2878+ </group>
2879 <group colspan="6" col="2">
2880 <group col="1">
2881 <field name="state"/>
2882- <button name="act_progress" string="Progress" states="draft" type="workflow" icon="gtk-go-forward"/>
2883- <button name="act_confirmed" string="Confirmed" states="progress" type="workflow" icon="gtk-go-forward"/>
2884+ <button name="act_confirm" string="Confirm" states="draft" type="workflow" icon="gtk-go-forward"/>
2885 <button name="act_done" string="Done" states="confirmed" type="workflow" icon="gtk-go-forward"/>
2886- <button name="%(voucher_report_withholding_islr)d" string="Print Withholding Income" colspan="3" states="done" type="action" icon="gtk-execute"/>
2887+ <button name="%(voucher_report_withholding_islr)d" string="Print Income Withholding" colspan="3" states="done" type="action" icon="gtk-execute"/>
2888 <button name="act_cancel" string="Cancel" states="draft,progress,confirmed,done" type="workflow" icon="gtk-go-forward"/>
2889 <button name="act_draft" colspan="2" string="Set to draft" states="cancel" type="workflow" icon="gtk-go-forward"/>
2890 </group>
2891@@ -313,7 +307,7 @@
2892
2893
2894 <record model="ir.actions.act_window" id="action_wh_islr_customer">
2895- <field name="name">Customer Withholding Income</field>
2896+ <field name="name">Customer Income Withholding</field>
2897 <field name="res_model">islr.wh.doc</field>
2898 <field name="type">ir.actions.act_window</field>
2899 <field name="view_type">form</field>
2900@@ -338,12 +332,12 @@
2901
2902 <menuitem
2903 id="menu_action_wh_islr_customer"
2904- name="Customer Withholding Income"
2905+ name="Customer Income Withholding"
2906 parent="account.menu_finance_receivables"
2907 action="action_wh_islr_customer"/>
2908
2909 <record model="ir.actions.act_window" id="action_wh_islr_supplier">
2910- <field name="name">Supplier Withholding Income</field>
2911+ <field name="name">Supplier Income Withholding</field>
2912 <field name="res_model">islr.wh.doc</field>
2913 <field name="type">ir.actions.act_window</field>
2914 <field name="view_type">form</field>
2915@@ -351,7 +345,7 @@
2916 <field name="domain">[('type','=','in_invoice')]</field>
2917 <field name="context">{'type':'in_invoice', 'search_default_draft': 1}</field>
2918 <field name="search_view_id" ref="view_wh_islr_filter_suppliers"/>
2919- <field name="help">With Supplier Withholding you can manage document withholding issued to your suppliers. OpenERP can Just generate document withholding for purchase process automatically from invoices. To generate the withholding income and all accounting process you must confirm and validate the document withholding.</field>
2920+ <field name="help">With Supplier Withholding you can manage document withholding issued to your suppliers. OpenERP can Just generate document withholding for purchase process automatically from invoices. To generate the Income Withholding and all accounting process you must confirm and validate the document withholding.</field>
2921
2922 </record>
2923 <record model="ir.actions.act_window.view" id="action_wh_islr_tree">
2924@@ -369,7 +363,7 @@
2925
2926 <menuitem
2927 id="menu_action_wh_islr_supplier"
2928- name="Supplier Withholding Income"
2929+ name="Supplier Income Withholding"
2930 parent="account.menu_finance_payables"
2931 action="action_wh_islr_supplier"/>
2932
2933
2934=== modified file 'l10n_ve_withholding_islr/view/islr_xml_wh.xml'
2935--- l10n_ve_withholding_islr/view/islr_xml_wh.xml 2012-12-17 23:45:56 +0000
2936+++ l10n_ve_withholding_islr/view/islr_xml_wh.xml 2012-12-26 22:37:22 +0000
2937@@ -11,7 +11,6 @@
2938 <record id="view_xml_islr_line_form" model="ir.ui.view">
2939 <field name="name">islr.xml.wh.line_form</field>
2940 <field name="model">islr.xml.wh.line</field>
2941- <field name="type">form</field>
2942 <field name="arch" type="xml">
2943 <form string="Export in XML data">
2944 <newline/>
2945@@ -22,7 +21,7 @@
2946 <field name="partner_vat"/>
2947 </group>
2948 <newline/>
2949- <separator string="Concept of Withholding Income" colspan="6"/>
2950+ <separator string="Concept of Income Withholding" colspan="6"/>
2951 <newline/>
2952 <group col="4" colspan="4">
2953 <field name="concept_id" colspan="4" />
2954@@ -54,7 +53,6 @@
2955 <record id="view_xml_islr_tree" model="ir.ui.view">
2956 <field name="name">islr.xml.wh.doc_tree</field>
2957 <field name="model">islr.xml.wh.doc</field>
2958- <field name="type">tree</field>
2959 <field name="arch" type="xml">
2960 <tree string="Lines Withholding for XML" >
2961 <field name="name"/>
2962@@ -67,7 +65,6 @@
2963 <record id="view_xml_islr_form" model="ir.ui.view">
2964 <field name="name">islr.xml.wh.doc_form</field>
2965 <field name="model">islr.xml.wh.doc</field>
2966- <field name="type">form</field>
2967 <field name="arch" type="xml">
2968 <form string="Lines Withholding for XML">
2969 <field name="name"/>
2970@@ -107,7 +104,6 @@
2971 <record id="view_generate_xml_filter" model="ir.ui.view">
2972 <field name="name">islr.xml.wh.doc.search</field>
2973 <field name="model">islr.xml.wh.doc</field>
2974- <field name="type">search</field>
2975 <field name="arch" type="xml">
2976 <search string="Search File XML">
2977 <group col="10" colspan="4">
2978@@ -118,7 +114,7 @@
2979 <separator orientation="vertical"/>
2980 <field name="company_id"/>
2981 <field name="user_id" select="1" widget="selection" string="Salesman">
2982- <filter domain="[('user_id','=',uid)]" help="My Withholding Income" icon="terp-personal" separator="1"/>
2983+ <filter domain="[('user_id','=',uid)]" help="My Income Withholding" icon="terp-personal" separator="1"/>
2984 </field>
2985 </group>
2986 <newline/>
2987
2988=== modified file 'l10n_ve_withholding_islr/view/partner_view.xml'
2989--- l10n_ve_withholding_islr/view/partner_view.xml 2012-10-02 18:30:33 +0000
2990+++ l10n_ve_withholding_islr/view/partner_view.xml 2012-12-26 22:37:22 +0000
2991@@ -11,7 +11,6 @@
2992 <record id="res_partner_wh_islr" model="ir.ui.view">
2993 <field name="name">res.partner.wh.islr</field>
2994 <field name="model">res.partner</field>
2995- <field name="type">form</field>
2996 <field name="inherit_id" ref="l10n_ve_withholding.wh_partner"/>
2997 <field name="arch" type="xml">
2998 <xpath expr="//separator[@string='vsep']" position="after">
2999
3000=== modified file 'l10n_ve_withholding_islr/view/product_view.xml'
3001--- l10n_ve_withholding_islr/view/product_view.xml 2012-11-07 21:33:58 +0000
3002+++ l10n_ve_withholding_islr/view/product_view.xml 2012-12-26 22:37:22 +0000
3003@@ -5,12 +5,11 @@
3004 <record model="ir.ui.view" id="view_product_product_islr">
3005 <field name="name">product.product.form.islr</field>
3006 <field name="model">product.product</field>
3007- <field name="type">form</field>
3008 <field name="inherit_id" ref="account.product_normal_form_view"/>
3009 <field name="arch" type="xml">
3010 <xpath expr="//group[@name='properties']" position="after">
3011 <newline/>
3012- <separator string="Concept of Withholding Income"/>
3013+ <separator string="Concept of Income Withholding"/>
3014 <newline/>
3015 <group col='6' colspan='6' >
3016 <field name="concept_id"/>
3017@@ -30,7 +29,6 @@
3018 <record id="product_normal_form_view_type" model="ir.ui.view">
3019 <field name="name">product.normal.form.type</field>
3020 <field name="model">product.product</field>
3021- <field name="type">form</field>
3022 <field name="inherit_id" ref="product.product_normal_form_view"/>
3023 <field name="arch" type="xml">
3024 <xpath expr="//field[@name='type']" position="replace">
3025
3026=== modified file 'l10n_ve_withholding_islr/view/wh_islr_view.xml'
3027--- l10n_ve_withholding_islr/view/wh_islr_view.xml 2011-10-25 20:33:16 +0000
3028+++ l10n_ve_withholding_islr/view/wh_islr_view.xml 2012-12-26 22:37:22 +0000
3029@@ -2,7 +2,7 @@
3030 <openerp>
3031 <data>
3032
3033- <menuitem id="menu_wh_configuration_islr" name="Withholding Income" parent="l10n_ve_withholding.menu_wh_configuration"/>
3034+ <menuitem id="menu_wh_configuration_islr" name="Income Withholding" parent="l10n_ve_withholding.menu_wh_configuration"/>
3035
3036 </data>
3037 </openerp>
3038
3039=== modified file 'l10n_ve_withholding_islr/workflow/account_workflow.xml'
3040--- l10n_ve_withholding_islr/workflow/account_workflow.xml 2012-12-18 13:37:25 +0000
3041+++ l10n_ve_withholding_islr/workflow/account_workflow.xml 2012-12-26 22:37:22 +0000
3042@@ -15,7 +15,7 @@
3043 <field name="name">Withholding Islr</field>
3044 <field name="kind">subflow</field>
3045 <field name="subflow_id" ref="wh_islr_order"/>
3046- <field name="action">action_ret_islr()</field>
3047+ <field name="action">_create_islr_wh_doc()</field>
3048 </record>
3049
3050 <record id="act_islr_router" model="workflow.activity">
3051@@ -39,8 +39,8 @@
3052 -->
3053 <record id="trans_wh_router_wh_islr" model="workflow.transition">
3054 <field name="act_from" ref="l10n_ve_withholding.act_wh_router"/>
3055- <field name="act_to" ref="act_islr_router"/>
3056- <field name="condition">check_invoice_type()</field>
3057+ <field name="act_to" ref="act_withold_islr"/>
3058+ <field name="condition">check_invoice_type() and check_withholdable_concept()</field>
3059 <field name="signal"></field>
3060 </record>
3061
3062
3063=== modified file 'l10n_ve_withholding_islr/workflow/islr_wh_workflow.xml'
3064--- l10n_ve_withholding_islr/workflow/islr_wh_workflow.xml 2012-05-04 14:44:55 +0000
3065+++ l10n_ve_withholding_islr/workflow/islr_wh_workflow.xml 2012-12-26 22:37:22 +0000
3066@@ -24,8 +24,7 @@
3067
3068 <record id="act_confirmed" model="workflow.activity">
3069 <field name="wkf_id" ref="wh_islr_order"/>
3070- <field name="action">action_number()
3071-write({'state':'confirmed'})</field>
3072+ <field name="action">action_confirm()</field>
3073 <field name="kind">function</field>
3074 <field name="name">confirmed</field>
3075 </record>
3076@@ -34,7 +33,8 @@
3077 <field name="wkf_id" ref="wh_islr_order"/>
3078 <field name="kind">function</field>
3079 <field name="name">done</field>
3080- <field name="action">action_move_create()
3081+ <field name="action">action_number()
3082+action_move_create()
3083 write({'state':'done'})</field>
3084 </record>
3085
3086@@ -63,7 +63,8 @@
3087 <record id="trans_draft_confirmed" model="workflow.transition">
3088 <field name="act_from" ref="act_draft"/>
3089 <field name="act_to" ref="act_confirmed"/>
3090- <field name="condition">validate(type,concept_ids,invoice_ids)</field>
3091+ <field name="condition">check_income_wh()</field>
3092+ <field name="signal">act_confirm</field>
3093 </record>
3094
3095 <record id="trans_draft_progress" model="workflow.transition">
3096@@ -82,7 +83,8 @@
3097 <record id="trans_progress_confirmed" model="workflow.transition">
3098 <field name="act_from" ref="act_progress"/>
3099 <field name="act_to" ref="act_confirmed"/>
3100- <field name="signal">act_confirmed</field>
3101+ <field name="condition">True</field>
3102+ <field name="signal"></field>
3103 </record>
3104
3105 <record id="trans_confirmed_cancel" model="workflow.transition">
3106
3107=== modified file 'l10n_ve_withholding_iva/model/__init__.py'
3108--- l10n_ve_withholding_iva/model/__init__.py 2012-11-07 21:33:58 +0000
3109+++ l10n_ve_withholding_iva/model/__init__.py 2012-12-26 22:37:22 +0000
3110@@ -29,6 +29,5 @@
3111 import generate_txt
3112 import report
3113 import installer
3114-import wizard
3115
3116 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: