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

Proposed by Katherine Zaoral (Vauxoo) on 2013-01-14
Status: Merged
Merged at revision: 771
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/ovl70-wh-rev-kty
Merge into: lp:~vauxoo/openerp-venezuela-localization/ovl70-wh-rev-hbto
Diff against target: 4482 lines (+1051/-1223)
65 files modified
l10n_ve_fiscal_requirements/model/__init__.py (+1/-0)
l10n_ve_fiscal_requirements/model/invoice.py (+9/-16)
l10n_ve_fiscal_requirements/model/res_users.py (+47/-0)
l10n_ve_fiscal_requirements/test/fr_damaged.yml (+1/-3)
l10n_ve_fiscal_requirements/test/fr_purchase_test.yml (+2/-2)
l10n_ve_fiscal_requirements/test/fr_refund_note.yml (+5/-11)
l10n_ve_fiscal_requirements/test/fr_sale_test.yml (+1/-3)
l10n_ve_fiscal_requirements/test/fr_vat_test.yml (+20/-13)
l10n_ve_fiscal_requirements/view/account_inv_refund_nctrl_view.xml (+0/-1)
l10n_ve_fiscal_requirements/view/account_invoice_view.xml (+0/-3)
l10n_ve_fiscal_requirements/view/account_tax_view.xml (+0/-1)
l10n_ve_fiscal_requirements/view/l10n_ut_view.xml (+0/-3)
l10n_ve_fiscal_requirements/view/partner_view.xml (+0/-1)
l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py (+15/-38)
l10n_ve_fiscal_requirements/wizard/account_invoice_debit_view.xml (+0/-1)
l10n_ve_fiscal_requirements/wizard/account_invoice_parent_view.xml (+0/-1)
l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py (+19/-26)
l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py (+0/-1)
l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.xml (+0/-1)
l10n_ve_fiscal_requirements/wizard/update_info_partner.py (+0/-1)
l10n_ve_fiscal_requirements/wizard/update_info_partner.xml (+0/-1)
l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml (+0/-1)
l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml (+0/-1)
l10n_ve_fiscal_requirements/wizard/wizard_url_seniat_view.xml (+0/-1)
l10n_ve_withholding/test/wh_pay_invoice.yml (+6/-5)
l10n_ve_withholding/view/account_view.xml (+2/-0)
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 (+11/-11)
l10n_ve_withholding_islr/view/islr_wh_concept_view.xml (+7/-12)
l10n_ve_withholding_islr/view/islr_wh_doc_view.xml (+85/-91)
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)
l10n_ve_withholding_src/__init__.py (+2/-0)
l10n_ve_withholding_src/__openerp__.py (+4/-1)
l10n_ve_withholding_src/data/data.xml (+22/-27)
l10n_ve_withholding_src/model/__init__.py (+1/-0)
l10n_ve_withholding_src/model/invoice.py (+36/-1)
l10n_ve_withholding_src/model/partner.py (+8/-10)
l10n_ve_withholding_src/model/wh_src.py (+43/-2)
l10n_ve_withholding_src/security/ir.model.access.csv (+1/-0)
l10n_ve_withholding_src/view/account_invoice_view.xml (+15/-2)
l10n_ve_withholding_src/view/company_view.xml (+3/-3)
l10n_ve_withholding_src/view/partner_view.xml (+12/-20)
l10n_ve_withholding_src/view/wh_src_view.xml (+23/-18)
l10n_ve_withholding_src/wizard/__init__.py (+2/-1)
l10n_ve_withholding_src/wizard/wizard_retention.py (+59/-0)
l10n_ve_withholding_src/wizard/wizard_retention_view.xml (+36/-0)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/ovl70-wh-rev-kty
Reviewer Review Type Date Requested Status
hbto [Vauxoo] http://www.vauxoo.com 2013-01-14 Pending
Review via email: mp+143170@code.launchpad.net

Description of the change

[FIX] First revision of wh module

To post a comment you must log in.

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/__init__.py'
2--- l10n_ve_fiscal_requirements/model/__init__.py 2012-12-04 10:35:10 +0000
3+++ l10n_ve_fiscal_requirements/model/__init__.py 2013-01-14 19:15:27 +0000
4@@ -25,6 +25,7 @@
5 import account
6 import invoice
7 import partner
8+import res_users
9 import res_company
10 import seniat_url
11 import l10n_ut
12
13=== modified file 'l10n_ve_fiscal_requirements/model/invoice.py'
14--- l10n_ve_fiscal_requirements/model/invoice.py 2012-12-04 21:56:01 +0000
15+++ l10n_ve_fiscal_requirements/model/invoice.py 2013-01-14 19:15:27 +0000
16@@ -79,22 +79,6 @@
17 _constraints = [
18 (_unique_invoice_per_partner, _('The Document you have been entering for this Partner has already been recorded'),['Control Number (nro_ctrl)','Reference (reference)']),
19 ]
20-
21- def _refund_cleanup_lines(self, cr, uid, lines):
22- """
23- Method created to clean invoice lines
24- """
25- for line in lines:
26- del line['id']
27- del line['invoice_id']
28- #TODO Verify one more elegant way to do this
29- for field in ('company_id', 'partner_id', 'account_id', 'product_id',
30- 'uos_id', 'account_analytic_id', 'tax_code_id', 'base_code_id',
31- "concept_id","tax_id"):
32- line[field] = line.get(field, False) and line[field][0]
33- if 'invoice_line_tax_id' in line:
34- line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ]
35- return map(lambda x: (0,0,x), lines)
36
37 def copy(self, cr, uid, id, default={}, context=None):
38 if context is None:
39@@ -108,4 +92,13 @@
40 account_invoice()
41
42
43+class account_invoice_tax(osv.osv):
44+ _inherit = 'account.invoice.tax'
45+ _columns = {
46+ 'tax_id': fields.many2one('account.tax', 'Tax', required=False, ondelete='set null',
47+ help="Tax relation to original tax, to be able to take off all data from invoices."),
48+ }
49+
50+account_invoice_tax()
51+
52 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
53
54=== added file 'l10n_ve_fiscal_requirements/model/res_users.py'
55--- l10n_ve_fiscal_requirements/model/res_users.py 1970-01-01 00:00:00 +0000
56+++ l10n_ve_fiscal_requirements/model/res_users.py 2013-01-14 19:15:27 +0000
57@@ -0,0 +1,47 @@
58+#!/usr/bin/python
59+# -*- encoding: utf-8 -*-
60+###########################################################################
61+# Module Writen to OpenERP, Open Source Management Solution
62+# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
63+# All Rights Reserved
64+###############Credits######################################################
65+# Coded by: Humberto Arocha <humberto@vauxoo.com>
66+# María Gabriela Quilarque <gabriela@vauxoo.com>
67+# Nhomar Hernandez <nhomar@vauxoo.com>
68+# Planified by: Humberto Arocha
69+# Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
70+# Audited by: Humberto Arocha humberto@openerp.com.ve
71+#############################################################################
72+# This program is free software: you can redistribute it and/or modify
73+# it under the terms of the GNU Affero General Public License as published by
74+# the Free Software Foundation, either version 3 of the License, or
75+# (at your option) any later version.
76+#
77+# This program is distributed in the hope that it will be useful,
78+# but WITHOUT ANY WARRANTY; without even the implied warranty of
79+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80+# GNU Affero General Public License for more details.
81+#
82+# You should have received a copy of the GNU Affero General Public License
83+# along with this program. If not, see <http://www.gnu.org/licenses/>.
84+##############################################################################
85+
86+from osv import fields, osv
87+import tools
88+from tools.translate import _
89+from tools import config
90+
91+class res_users(osv.osv):
92+ _inherit = 'res.users'
93+
94+ def create(self, cr, uid, vals, context=None):
95+ if context is None: context = {}
96+ context.update({'create_company':True})
97+ return super(res_users, self).create(cr, uid, vals, context=context)
98+
99+ def write(self, cr, uid, ids, values, context=None):
100+ context = context or {}
101+ context.update({'create_company':True})
102+ return super(res_users, self).write(cr, uid, ids, values, context=context)
103+
104+res_users()
105
106=== modified file 'l10n_ve_fiscal_requirements/test/fr_damaged.yml'
107--- l10n_ve_fiscal_requirements/test/fr_damaged.yml 2012-09-26 16:20:44 +0000
108+++ l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-01-14 19:15:27 +0000
109@@ -19,11 +19,9 @@
110 company_id: base.main_company
111 currency_id: base.EUR
112 date_invoice: !eval time.strftime('%Y-%m-%d')
113- address_contact_id: base.res_partner_address_3
114- address_invoice_id: base.res_partner_address_3
115 account_id: account.a_recv
116 invoice_line:
117- - product_id: product.product_product_pc2
118+ - product_id: product.product_product_3
119 quantity: 5
120 uos_id: product.product_uom_unit
121 price_unit: 20
122
123=== modified file 'l10n_ve_fiscal_requirements/test/fr_purchase_test.yml'
124--- l10n_ve_fiscal_requirements/test/fr_purchase_test.yml 2012-09-26 16:20:44 +0000
125+++ l10n_ve_fiscal_requirements/test/fr_purchase_test.yml 2013-01-14 19:15:27 +0000
126@@ -10,7 +10,7 @@
127 date_invoice: !eval time.strftime('%Y-%m-%d')
128 account_id: account.a_recv
129 invoice_line:
130- - product_id: product.product_product_pc1
131+ - product_id: product.product_product_4
132 quantity: 3
133 uos_id: product.product_uom_unit
134 price_unit: 3
135@@ -18,7 +18,7 @@
136 account_id: account.a_sale
137 invoice_line_tax_id:
138 - iva_purchase1
139- - product_id: product.product_product_pc2
140+ - product_id: product.product_product_3
141 quantity: 5
142 uos_id: product.product_uom_unit
143 price_unit: 2
144
145=== modified file 'l10n_ve_fiscal_requirements/test/fr_refund_note.yml'
146--- l10n_ve_fiscal_requirements/test/fr_refund_note.yml 2012-09-26 16:20:44 +0000
147+++ l10n_ve_fiscal_requirements/test/fr_refund_note.yml 2013-01-14 19:15:27 +0000
148@@ -8,11 +8,9 @@
149 company_id: base.main_company
150 currency_id: base.EUR
151 date_invoice: !eval time.strftime('%Y-%m-%d')
152- address_contact_id: base.res_partner_address_3
153- address_invoice_id: base.res_partner_address_3
154 account_id: account.a_recv
155 invoice_line:
156- - product_id: product.product_product_pc2
157+ - product_id: product.product_product_3
158 quantity: 5
159 uos_id: product.product_uom_unit
160 price_unit: 20
161@@ -105,10 +103,10 @@
162 for line in rf_brw.invoice_line:
163 for tax in line.invoice_line_tax_id:
164 tax1.append(tax.id)
165- rf_brw = self.browse(cr, uid, ai_id[0])
166+ rf_brw = ai_id and self.browse(cr, uid, ai_id[0])
167 tax2 = []
168 whc2 = []
169- for line in rf_brw.invoice_line:
170+ for line in rf_brw and rf_brw.invoice_line:
171 for tax in line.invoice_line_tax_id:
172 tax2.append(tax.id)
173 tax1 = set(tax1)
174@@ -126,11 +124,9 @@
175 company_id: base.main_company
176 currency_id: base.EUR
177 date_invoice: !eval time.strftime('%Y-%m-%d')
178- address_contact_id: base.res_partner_address_3
179- address_invoice_id: base.res_partner_address_3
180 account_id: account.a_recv
181 invoice_line:
182- - product_id: product.product_product_pc2
183+ - product_id: product.product_product_3
184 quantity: 5
185 uos_id: product.product_uom_unit
186 price_unit: 20
187@@ -232,11 +228,9 @@
188 company_id: base.main_company
189 currency_id: base.EUR
190 date_invoice: !eval time.strftime('%Y-%m-%d')
191- address_contact_id: base.res_partner_address_3
192- address_invoice_id: base.res_partner_address_3
193 account_id: account.a_recv
194 invoice_line:
195- - product_id: product.product_product_pc2
196+ - product_id: product.product_product_4
197 quantity: 5
198 uos_id: product.product_uom_unit
199 price_unit: 20
200
201=== modified file 'l10n_ve_fiscal_requirements/test/fr_sale_test.yml'
202--- l10n_ve_fiscal_requirements/test/fr_sale_test.yml 2012-09-26 16:20:44 +0000
203+++ l10n_ve_fiscal_requirements/test/fr_sale_test.yml 2013-01-14 19:15:27 +0000
204@@ -8,11 +8,9 @@
205 company_id: base.main_company
206 currency_id: base.EUR
207 date_invoice: !eval time.strftime('%Y-%m-%d')
208- address_contact_id: base.res_partner_address_3
209- address_invoice_id: base.res_partner_address_3
210 account_id: account.a_recv
211 invoice_line:
212- - product_id: product.product_product_pc2
213+ - product_id: product.product_product_3
214 quantity: 5
215 uos_id: product.product_uom_unit
216 price_unit: 20
217
218=== modified file 'l10n_ve_fiscal_requirements/test/fr_vat_test.yml'
219--- l10n_ve_fiscal_requirements/test/fr_vat_test.yml 2012-09-26 21:08:18 +0000
220+++ l10n_ve_fiscal_requirements/test/fr_vat_test.yml 2013-01-14 19:15:27 +0000
221@@ -1,15 +1,6 @@
222 -
223 5. Fiscal requirements Vat tests
224 -
225- 5.1 Add address
226--
227- !record {model: res.partner.address, id: test_fr_add01}:
228- type: invoice
229- street: Av Siempre Viva
230- phone: "(555) 5555555"
231- fax: "(555) 1111111"
232- email: fakemail@example.com
233--
234 5.2 I try to create a partner with wrong vat
235 -
236 !python {model: res.partner}: |
237@@ -19,7 +10,11 @@
238 'supplier': True,
239 'customer': True,
240 'vat': 'VEV333',
241- 'address':[(6, 0, [ref("test_fr_add01")])]
242+ 'type': 'invoice',
243+ 'street': 'Av Siempre Viva',
244+ 'phone': "(555) 5555555",
245+ 'fax': "(555) 1111111",
246+ 'email': 'fakemail@example.com',
247 }
248 part_id = False
249 try:
250@@ -46,7 +41,11 @@
251 'supplier': True,
252 'customer': True,
253 'vat': 'VEJ112223330',
254- 'address': [(6, 0, [ref("test_fr_add01")])],
255+ 'type': 'invoice',
256+ 'street': 'Av Siempre Viva',
257+ 'phone': "(555) 5555555",
258+ 'fax': "(555) 1111111",
259+ 'email': 'fakemail@example.com',
260 }
261 part_id = self.create(cr, uid, part)
262 assert part_id, 'Partner should be created'
263@@ -60,7 +59,11 @@
264 'supplier': True,
265 'customer': True,
266 'vat': 'VEJ112223330',
267- 'address': [(6, 0, [ref("test_fr_add01")])],
268+ 'type': 'invoice',
269+ 'street': 'Av Siempre Viva',
270+ 'phone': "(555) 5555555",
271+ 'fax': "(555) 1111111",
272+ 'email': 'fakemail@example.com',
273 }
274 try:
275 rollback = cr.rollback
276@@ -86,7 +89,11 @@
277 'supplier': True,
278 'customer': True,
279 'vat': 'VEJ223334445',
280- 'address': [(6, 0, [ref("test_fr_add01")])],
281+ 'type': 'invoice',
282+ 'street': 'Av Siempre Viva',
283+ 'phone': "(555) 5555555",
284+ 'fax': "(555) 1111111",
285+ 'email': 'fakemail@example.com',
286 }
287 try:
288 rollback = cr.rollback
289
290=== modified file 'l10n_ve_fiscal_requirements/view/account_inv_refund_nctrl_view.xml'
291--- l10n_ve_fiscal_requirements/view/account_inv_refund_nctrl_view.xml 2012-11-06 22:01:07 +0000
292+++ l10n_ve_fiscal_requirements/view/account_inv_refund_nctrl_view.xml 2013-01-14 19:15:27 +0000
293@@ -5,7 +5,6 @@
294 <record id="view_account_inv_nctrl_refund" model="ir.ui.view">
295 <field name="name">account.inv.nctrl.refund.form</field>
296 <field name="model">account.invoice.refund</field>
297- <field name="type">form</field>
298 <field name="inherit_id" ref="account.view_account_invoice_refund"/>
299 <field name="arch" type="xml">
300 <xpath expr="//field[@name='period']" position="after">
301
302=== modified file 'l10n_ve_fiscal_requirements/view/account_invoice_view.xml'
303--- l10n_ve_fiscal_requirements/view/account_invoice_view.xml 2012-12-04 22:37:47 +0000
304+++ l10n_ve_fiscal_requirements/view/account_invoice_view.xml 2013-01-14 19:15:27 +0000
305@@ -10,7 +10,6 @@
306 <record id="account_invoice_ext_view_form_loc_ve" model="ir.ui.view">
307 <field name="name">invoice_extended.account.invoice.form.loc_ve</field>
308 <field name="model">account.invoice</field>
309- <field name="type">form</field>
310 <field name="inherit_id" ref="account.invoice_form"/>
311 <field name="arch" type="xml">
312 <xpath expr="//field[@name='date_invoice']" position="replace">
313@@ -91,7 +90,6 @@
314 <record id="account_inv_ext_view_tree_crdr" model="ir.ui.view">
315 <field name="name">invoice_extended.tree.crdr</field>
316 <field name="model">account.invoice</field>
317- <field name="type">tree</field>
318 <field name="inherit_id" ref="account.invoice_tree"/>
319 <field name="arch" type="xml">
320 <xpath expr="//field[@name='origin']" position="after">
321@@ -109,7 +107,6 @@
322 <record id="account_invoice_ext_view_supp_form_loc_ve" model="ir.ui.view">
323 <field name="name">invoice_extended.account.invoice.supplier.form.loc_ve</field>
324 <field name="model">account.invoice</field>
325- <field name="type">form</field>
326 <field name="inherit_id" ref="account.invoice_supplier_form"/>
327 <field name="arch" type="xml">
328 <xpath expr="//field[@name='date_invoice']" position="replace">
329
330=== modified file 'l10n_ve_fiscal_requirements/view/account_tax_view.xml'
331--- l10n_ve_fiscal_requirements/view/account_tax_view.xml 2012-11-07 21:33:58 +0000
332+++ l10n_ve_fiscal_requirements/view/account_tax_view.xml 2013-01-14 19:15:27 +0000
333@@ -13,7 +13,6 @@
334 <record id="account_tax_applicability_2" model="ir.ui.view">
335 <field name="name">account.tax.applicability</field>
336 <field name="model">account.tax</field>
337- <field name="type">form</field>
338 <field name="inherit_id" ref="account.view_tax_form"/>
339 <field name="arch" type="xml">
340 <xpath expr="//field[@name='active']" position="after">
341
342=== modified file 'l10n_ve_fiscal_requirements/view/l10n_ut_view.xml'
343--- l10n_ve_fiscal_requirements/view/l10n_ut_view.xml 2012-11-06 22:01:07 +0000
344+++ l10n_ve_fiscal_requirements/view/l10n_ut_view.xml 2013-01-14 19:15:27 +0000
345@@ -5,7 +5,6 @@
346 <record id="view_l10n_ut_filter" model="ir.ui.view">
347 <field name="name">l10n.ut.search</field>
348 <field name="model">l10n.ut</field>
349- <field name="type">search</field>
350 <field name="arch" type="xml">
351 <search string="Search Tax Unit" version="7.0">
352 <group col="10" colspan="4">
353@@ -24,7 +23,6 @@
354 <record model="ir.ui.view" id="view_l10n_ut_form">
355 <field name="name">l10n.ut.form</field>
356 <field name="model">l10n.ut</field>
357- <field name="type">form</field>
358 <field name="arch" type="xml">
359 <form string="Tax Unit" version="7.0">
360 <group col="6" colspan="4">
361@@ -39,7 +37,6 @@
362 <record model="ir.ui.view" id="view_l10n_ut_tree">
363 <field name="name">l10n.ut.tree</field>
364 <field name="model">l10n.ut</field>
365- <field name="type">tree</field>
366 <field name="arch" type="xml">
367 <tree string="Tax Unit per date" editable="top">
368 <field name="name"/>
369
370=== modified file 'l10n_ve_fiscal_requirements/view/partner_view.xml'
371--- l10n_ve_fiscal_requirements/view/partner_view.xml 2012-12-09 23:00:04 +0000
372+++ l10n_ve_fiscal_requirements/view/partner_view.xml 2013-01-14 19:15:27 +0000
373@@ -5,7 +5,6 @@
374 <record id="view_partner_form2" model="ir.ui.view">
375 <field name="name">res.partner.vat.inherit2</field>
376 <field name="model">res.partner</field>
377- <field name="type">form</field>
378 <field name="inherit_id" ref="base.view_partner_form"/>
379 <field name="arch" type="xml">
380
381
382=== modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py'
383--- l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py 2012-12-04 19:17:53 +0000
384+++ l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py 2013-01-14 19:15:27 +0000
385@@ -81,19 +81,6 @@
386 res['fields'][field]['selection'] = journal_select
387 return res
388
389- def _get_period(self, cr, uid, context=None):
390- """
391- Return default account period value
392- """
393- if context is None:
394- context = {}
395- account_period_obj = self.pool.get('account.period')
396- ids = account_period_obj.find(cr, uid, context=context)
397- period_id = False
398- if ids:
399- period_id = ids[0]
400- return period_id
401-
402 def _get_orig(self, cr, uid, inv, ref, context=None):
403 """
404 Return default origin value
405@@ -130,45 +117,39 @@
406 date = False
407 period = False
408 description = False
409- company = res_users_obj.browse(cr, uid, uid, context=context).company_id
410+
411 journal_id = form.journal_id and form.journal_id.id or False
412 inv = inv_obj.browse(cr, uid, context.get('active_ids')[0], context=context)
413+ #~ TODOK: no seria mejor ids=context.get(active_id)
414+
415+ company_id = inv.company_id.id
416+ context.update({'company_id':company_id})
417+
418 if inv.state in ['draft', 'proforma2', 'cancel']:
419 raise osv.except_osv(_('Error !'), _('Can not create a debit note from draft/proforma/cancel invoice.'))
420 if inv.reconciled in ('cancel', 'modify'):
421 raise osv.except_osv(_('Error !'), _('Can not create a debit note from invoice which is already reconciled, invoice should be unreconciled first. You can only Refund or Debit this invoice'))
422 if inv.type not in ['in_invoice', 'out_invoice']:
423 raise osv.except_osv(_('Error !'), _('Can not make a debit note on a refund invoice.'))
424+
425+ #Check for the form fields
426+
427 if form.period:
428 period = form.period.id
429 else:
430 #Take period from the current date
431- #period = inv.period_id and inv.period_id.id or False
432- period = self._get_period(cr, uid, context)
433+ period = self.pool.get('account.period').find(cr, uid, context=context)
434+ period = period and period[0] or False
435+ if not period:
436+ raise osv.except_osv(_('No Pediod Defined'), \
437+ _('You have been left empty the period field that automatically fill with the current period. However there is not period defined for the current company. Please check in Accounting/Configuration/Periods'))
438+ self.write(cr, uid, ids, {'period': period }, context=context)
439
440 if not journal_id:
441 journal_id = inv.journal_id.id
442
443 if form.date:
444 date = form.date
445- if not form.period.id:
446- cr.execute("select name from ir_model_fields \
447- where model = 'account.period' \
448- and name = 'company_id'")
449- result_query = cr.fetchone()
450- if result_query:
451- #in multi company mode
452- cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \
453- and date(%s) between p.date_start AND p.date_stop and y.company_id = %s limit 1""", (date, company.id,))
454- else:
455- #in mono company mode
456- cr.execute("""SELECT id
457- from account_period where date(%s)
458- between date_start AND date_stop \
459- limit 1 """, (date,))
460- res = cr.fetchone()
461- if res:
462- period = res[0]
463 else:
464 #Take current date
465 #date = inv.date_invoice
466@@ -178,10 +159,6 @@
467 else:
468 description = inv.name
469
470- if not period:
471- raise osv.except_osv(_('Data Insufficient !'), \
472- _('No Period found on Invoice!'))
473-
474 #we get original data of invoice to create a new invoice that is the copy of the original
475 invoice = inv_obj.read(cr, uid, [inv.id],
476 ['name', 'type', 'number', 'reference',
477
478=== modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_debit_view.xml'
479--- l10n_ve_fiscal_requirements/wizard/account_invoice_debit_view.xml 2012-11-06 22:01:07 +0000
480+++ l10n_ve_fiscal_requirements/wizard/account_invoice_debit_view.xml 2013-01-14 19:15:27 +0000
481@@ -5,7 +5,6 @@
482 <record id="view_account_invoice_debit" model="ir.ui.view">
483 <field name="name">account.invoice.debit.form</field>
484 <field name="model">account.invoice.debit</field>
485- <field name="type">form</field>
486 <field name="arch" type="xml">
487 <form string="Debit Note" version="7.0">
488 <separator string="Debit Note Options" colspan="4"/>
489
490=== modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_parent_view.xml'
491--- l10n_ve_fiscal_requirements/wizard/account_invoice_parent_view.xml 2011-11-10 15:21:35 +0000
492+++ l10n_ve_fiscal_requirements/wizard/account_invoice_parent_view.xml 2013-01-14 19:15:27 +0000
493@@ -5,7 +5,6 @@
494 <record id="view_account_invoice_parent" model="ir.ui.view">
495 <field name="name">account.invoice.parent.form</field>
496 <field name="model">account.invoice.parent</field>
497- <field name="type">form</field>
498 <field name="arch" type="xml">
499 <form string="Debit Note">
500 <separator string="Debit Note Options" colspan="4"/>
501
502=== modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py'
503--- l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py 2012-11-07 15:19:17 +0000
504+++ l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py 2013-01-14 19:15:27 +0000
505@@ -79,21 +79,6 @@
506 res['fields'][field]['selection'] = journal_select
507 return res
508
509- def _get_period(self, cr, uid, context={}):
510- """
511- Return default account period value
512- """
513- period_id= False
514- if context.get('active_id',False):
515- invo_obj = self.pool.get('account.invoice')
516- invo_brw = invo_obj.browse(cr,uid,context.get('active_id'),{})
517- period_id = invo_brw and invo_brw.period_id and invo_brw.period_id.id
518- return period_id
519-
520-
521-
522- return period_id
523-
524 def _get_orig(self, cr, uid, inv, ref, context={}):
525 """
526 Return default origin value
527@@ -165,8 +150,15 @@
528 raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode))
529 if inv.reconciled and mode in ('cancel', 'modify'):
530 raise osv.except_osv(_('Error !'), _('Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice') % (mode))
531- #Take period from the current date
532- period = form.get('period') and form.get('period')[0] or self._get_period(cr, uid, context)
533+ period = form.get('period') and form.get('period')[0] or False
534+ if not period:
535+ #Take period from the current date
536+ period = self.pool.get('account.period').find(cr, uid, context=context)
537+ period = period and period[0] or False
538+ if not period:
539+ raise osv.except_osv(_('No Pediod Defined'), \
540+ _('You have been left empty the period field that automatically fill with the current period. However there is not period defined for the current company. Please check in Accounting/Configuration/Periods'))
541+ self.write(cr, uid, ids, {'period': period }, context=context)
542
543 if not journal_brw:
544 journal_id = inv.journal_id.id
545@@ -253,9 +245,10 @@
546 'journal_id', 'period_id'], context=context)
547 invoice = invoice[0]
548 del invoice['id']
549- invoice_lines = inv_line_obj.read(cr, uid, invoice['invoice_line'], context=context)
550+ invoice_lines = inv_line_obj.browse(cr, uid, invoice['invoice_line'], context=context)
551+
552 invoice_lines = inv_obj._refund_cleanup_lines(cr, uid, invoice_lines)
553- tax_lines = inv_tax_obj.read(cr, uid, invoice['tax_line'], context=context)
554+ tax_lines = inv_tax_obj.browse(cr, uid, invoice['tax_line'], context=context)
555 tax_lines = inv_obj._refund_cleanup_lines(cr, uid, tax_lines)
556 #Add origin value
557 orig = self._get_orig(cr, uid, inv, invoice['reference'], context)
558@@ -283,12 +276,12 @@
559
560 new_inv_brw = inv_obj.browse(cr,uid,created_inv[1],context=context)
561 inv_obj.write(cr,uid,created_inv[0],{'name':wzd_brw.description,'origin':new_inv_brw.origin},context=context)
562- inv_obj.write(cr,uid,created_inv[1],{'origin':inv.origin,'description':''},context=context)
563+ inv_obj.write(cr,uid,created_inv[1],{'origin':inv.origin,'name':wzd_brw.description},context=context)
564 if inv.type in ('out_invoice', 'out_refund'):
565 xml_id = 'action_invoice_tree3'
566- if hasattr(inv, 'sale_ids'):
567- for i in inv.sale_ids:
568- cr.execute('insert into sale_order_invoice_rel (order_id,invoice_id) values (%s,%s)', (i.id, refund_id[0]))
569+ #~ if hasattr(inv, 'sale_ids'):
570+ #~ for i in inv.sale_ids:
571+ #~ cr.execute('insert into sale_order_invoice_rel (order_id,invoice_id) values (%s,%s)', (i.id, refund_id[0]))
572 else:
573 xml_id = 'action_invoice_tree4'
574 result = mod_obj.get_object_reference(cr, uid, 'account', xml_id)
575@@ -300,11 +293,11 @@
576
577 if wzd_brw.filter_refund == 'cancel':
578 orig = self._get_orig(cr, uid, inv, inv.reference, context)
579- inv_obj.write(cr,uid,created_inv[0],{'origin':orig,'description':wzd_brw.description},context=context)
580+ inv_obj.write(cr,uid,created_inv[0],{'origin':orig,'name':wzd_brw.description},context=context)
581
582 if wzd_brw.filter_refund == 'refund':
583 orig = self._get_orig(cr, uid, inv, inv.reference, context)
584- inv_obj.write(cr,uid,created_inv[0],{'origin':inv.origin,'description':wzd_brw.description},context=context)
585+ inv_obj.write(cr,uid,created_inv[0],{'origin':inv.origin,'name':wzd_brw.description},context=context)
586 return result
587
588 def validate_total_payment_inv(self, cr, uid, ids, context=None):
589@@ -354,7 +347,7 @@
590 if moveline.reconcile_partial_id:
591 rec += [moveline.reconcile_partial_id.id]
592 movelines = moveline_obj.search(cr, uid, [('|'),('reconcile_id','in',rec),('reconcile_partial_id','in',rec)],context=context)
593- for mids in moveline_obj.browse(cr, uid, movelines, ['move_id']):
594+ for mids in moveline_obj.browse(cr, uid, movelines, context=context):
595 mid +=[mids.move_id.id]
596 voucherids = voucher_pool.search(cr, uid,[('move_id','in',mid)])
597 if voucherids:
598
599=== modified file 'l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py'
600--- l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py 2012-12-02 17:44:27 +0000
601+++ l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py 2013-01-14 19:15:27 +0000
602@@ -19,7 +19,6 @@
603 # along with this program. If not, see <http://www.gnu.org/licenses/>.
604 #
605 ##############################################################################
606-import wizard
607 import pooler
608 from osv import osv, fields
609 from tools.translate import _
610
611=== modified file 'l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.xml'
612--- l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.xml 2012-09-26 21:07:02 +0000
613+++ l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.xml 2013-01-14 19:15:27 +0000
614@@ -4,7 +4,6 @@
615 <record model="ir.ui.view" id="view_vat_search">
616 <field name="name">search.info.partner.seniat.form</field>
617 <field name="model">search.info.partner.seniat</field>
618- <field name="type">form</field>
619 <field name="arch" type="xml">
620 <form string="Wizard to search partner on SENIAT">
621 <group colspan="4">
622
623=== modified file 'l10n_ve_fiscal_requirements/wizard/update_info_partner.py'
624--- l10n_ve_fiscal_requirements/wizard/update_info_partner.py 2012-12-02 18:34:29 +0000
625+++ l10n_ve_fiscal_requirements/wizard/update_info_partner.py 2013-01-14 19:15:27 +0000
626@@ -19,7 +19,6 @@
627 # along with this program. If not, see <http://www.gnu.org/licenses/>.
628 #
629 ##############################################################################
630-import wizard
631 import pooler
632 from osv import osv, fields
633 from tools.translate import _
634
635=== modified file 'l10n_ve_fiscal_requirements/wizard/update_info_partner.xml'
636--- l10n_ve_fiscal_requirements/wizard/update_info_partner.xml 2011-10-25 20:33:16 +0000
637+++ l10n_ve_fiscal_requirements/wizard/update_info_partner.xml 2013-01-14 19:15:27 +0000
638@@ -7,7 +7,6 @@
639 <record id="view_wizard_update_info_partner" model="ir.ui.view">
640 <field name="name">view.update.info.partner</field>
641 <field name="model">update.info.partner</field>
642- <field name="type">form</field>
643 <field name="arch" type="xml">
644 <form string="">
645 <separator string="Are you sure you want to do this?" colspan="4"/>
646
647=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml'
648--- l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml 2012-04-11 21:48:15 +0000
649+++ l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml 2013-01-14 19:15:27 +0000
650@@ -4,7 +4,6 @@
651 <record id="view_wizard_invoice_nro_ctrl" model="ir.ui.view">
652 <field name="name">view.wizard.invoice.nro.ctrl</field>
653 <field name="model">wizard.invoice.nro.ctrl</field>
654- <field name="type">form</field>
655 <field name="arch" type="xml">
656 <form string="Create an invoice to justify the damaged one">
657 <group colspan="8" col="8">
658
659=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml'
660--- l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml 2012-02-09 21:33:03 +0000
661+++ l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml 2013-01-14 19:15:27 +0000
662@@ -4,7 +4,6 @@
663 <record model="ir.ui.view" id="wizard_nro_ctrl_form">
664 <field name="name">wizard.nro.ctrl.form</field>
665 <field name="model">wiz.nroctrl</field>
666- <field name="type">form</field>
667 <field name="arch" type="xml">
668 <form string="Changing the Control Number">
669 <field name="name" />
670
671=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_url_seniat_view.xml'
672--- l10n_ve_fiscal_requirements/wizard/wizard_url_seniat_view.xml 2012-07-16 18:55:40 +0000
673+++ l10n_ve_fiscal_requirements/wizard/wizard_url_seniat_view.xml 2013-01-14 19:15:27 +0000
674@@ -4,7 +4,6 @@
675 <record id="view_wizard_url_seniat" model="ir.ui.view">
676 <field name="name">view.wizard.seniat.url</field>
677 <field name="model">wizard.seniat.url</field>
678- <field name="type">form</field>
679 <field name="arch" type="xml">
680 <form string="Update Url From Seniat">
681 <separator string="URL Seniat for Partner Information" colspan="4"/>
682
683=== modified file 'l10n_ve_withholding/test/wh_pay_invoice.yml'
684--- l10n_ve_withholding/test/wh_pay_invoice.yml 2012-09-27 21:43:13 +0000
685+++ l10n_ve_withholding/test/wh_pay_invoice.yml 2013-01-14 19:15:27 +0000
686@@ -14,14 +14,14 @@
687 journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
688 res = self.onchange_partner_id(cr, uid, [], inv_brw.partner_id.id, journal_id, 0.0, 1, ttype='receipt', date=False)
689 ap_obj = self.pool.get('account.period')
690- period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})
691+ period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})[0]
692 vals = {
693 'account_id': ref('account.cash'),
694- 'amount': inv_brw.amount,
695+ 'amount': inv_brw.amount_total,
696 'company_id': ref('base.main_company'),
697 'currency_id': ref('base.EUR'),
698 'journal_id': ref('account.bank_journal'),
699- 'partner_id': ref('inv_brw.partner_id.id'),
700+ 'partner_id': inv_brw.partner_id.id,
701 'period_id': period,
702 'type': 'receipt',
703 }
704@@ -39,9 +39,10 @@
705 1.2 I check that the invoice state is "Open"
706 -
707 !python {model: account.voucher}: |
708+ import time
709 inv_obj = self.pool.get("account.invoice")
710 inv_brw = inv_obj.browse(cr, uid, ref("l10n_ve_fiscal_requirements.test_fr01"))
711 lines = inv_brw.invoice_line
712 data = self.onchange_journal(cr, uid, [ref("l10n_ve_fiscal_requirements.test_fr01")], 5, lines, False,
713- inv_brw.partner_id, time.strftime('%Y-%m-%d'),
714- inv_brw.amount, ttype, base.main_company, context=None)
715+ inv_brw.partner_id.id, time.strftime('%Y-%m-%d'),
716+ inv_brw.amount_total, 'receipt', ref('base.main_company'), context=None)
717
718=== modified file 'l10n_ve_withholding/view/account_view.xml'
719--- l10n_ve_withholding/view/account_view.xml 2012-12-10 12:16:26 +0000
720+++ l10n_ve_withholding/view/account_view.xml 2013-01-14 19:15:27 +0000
721@@ -24,6 +24,7 @@
722 </field>
723 </record>
724
725+<!--
726 <record id="view_move_line_tax_tree_iva" model="ir.ui.view">
727 <field name="name">account.move.line.tax.tree.iva</field>
728 <field name="model">account.move.line</field>
729@@ -36,6 +37,7 @@
730 </field>
731 </field>
732 </record>
733+-->
734
735
736 <record id="view_move_form_iva" model="ir.ui.view">
737
738=== modified file 'l10n_ve_withholding_islr/__init__.py'
739--- l10n_ve_withholding_islr/__init__.py 2012-12-09 23:55:45 +0000
740+++ l10n_ve_withholding_islr/__init__.py 2013-01-14 19:15:27 +0000
741@@ -28,4 +28,4 @@
742 import model
743 import report
744 import wizard
745-import edi
746+#import edi
747
748=== modified file 'l10n_ve_withholding_islr/__openerp__.py'
749--- l10n_ve_withholding_islr/__openerp__.py 2012-12-18 17:46:39 +0000
750+++ l10n_ve_withholding_islr/__openerp__.py 2013-01-14 19:15:27 +0000
751@@ -27,16 +27,16 @@
752 ##############################################################################
753
754 {
755- "name" : "Automatically Calculation Withholding Income",
756+ "name" : "Automatically Calculation Income Withholding",
757 "version" : "0.1",
758 "author" : "Vauxoo",
759 "category" : "General",
760 "website": "http://wiki.openerp.org.ve/",
761- "description": ''' - Generate the voucher of withholding income to validate the invoice.
762- - Generate the report of voucher of withholding income.
763- - Generate the file .xml required by the Venezuelan laws, for agent of withholding income specials.
764+ "description": ''' - Generate the voucher of income withholding to validate the invoice.
765+ - Generate the report of voucher of income withholding.
766+ - Generate the file .xml required by the Venezuelan laws, for agent of income withholding specials.
767 - Generate view for load the concepts of wittholding whith their rates.
768- - Generate view for visualize the withholding income for suppilers and customers.
769+ - Generate view for visualize the income withholding for suppilers and customers.
770 - Load data of the 86 concepts of wittholdings whith their rates.
771 - Send an email to supplier with approved withholdings, if not opt_out in the partner
772 If you want be able to propose withholding concepts from sales and purchases you must install extra module @section{l10n_ve_sale_purchase}.
773@@ -63,7 +63,7 @@
774 "view/islr_xml_wh.xml",
775 "workflow/islr_wh_workflow.xml",
776 "workflow/account_workflow.xml",
777- "edi/islr_wh_doc_action_data.xml",
778+ #"edi/islr_wh_doc_action_data.xml",
779
780 ],
781 'test': [
782
783=== modified file 'l10n_ve_withholding_islr/demo/retencion_islr_sequence.xml'
784--- l10n_ve_withholding_islr/demo/retencion_islr_sequence.xml 2012-12-19 18:17:09 +0000
785+++ l10n_ve_withholding_islr/demo/retencion_islr_sequence.xml 2013-01-14 19:15:27 +0000
786@@ -4,12 +4,12 @@
787
788 <!-- Sequences type for account.retention -->
789 <record id="seq_type_islr_wh" model="ir.sequence.type">
790- <field name="name">Withholding Income</field>
791+ <field name="name">Income Withholding</field>
792 <field name="code">islr.wh.doc</field>
793 </record>
794
795 <record id="seq_account_wh_islr" model="ir.sequence">
796- <field name="name">Withholding Income</field>
797+ <field name="name">Income Withholding</field>
798 <field name="code">islr.wh.doc</field>
799 <field name="prefix">RE:</field>
800 <field name="padding">8</field>
801@@ -17,12 +17,12 @@
802 </record>
803
804 <record id="seq_type_wh_islr_purchase" model="ir.sequence.type">
805- <field name="name">Purchase Withholding Income</field>
806+ <field name="name">Purchase Income Withholding</field>
807 <field name="code">islr.wh.doc.in_invoice</field>
808 </record>
809
810 <record id="seq_wh_islr_purchase" model="ir.sequence">
811- <field name="name">Purchase Withholding Income</field>
812+ <field name="name">Purchase Income Withholding</field>
813 <field name="code">islr.wh.doc.in_invoice</field>
814 <field name="prefix">%(year)s-%(month)s-</field>
815 <field name="padding">8</field>
816@@ -30,12 +30,12 @@
817 </record>
818
819 <record id="seq_type_wh_islr_sales" model="ir.sequence.type">
820- <field name="name">Sale Withholding Income</field>
821+ <field name="name">Sale Income Withholding</field>
822 <field name="code">islr.wh.doc.out_invoice</field>
823 </record>
824
825 <record id="seq_wh_islr_sales" model="ir.sequence">
826- <field name="name">Sale Withholding Income</field>
827+ <field name="name">Sale Income Withholding</field>
828 <field name="code">islr.wh.doc.out_invoice</field>
829 <field name="prefix">%(year)s-%(month)s-</field>
830 <field name="padding">8</field>
831
832=== modified file 'l10n_ve_withholding_islr/i18n/es.po'
833--- l10n_ve_withholding_islr/i18n/es.po 2012-02-09 19:23:11 +0000
834+++ l10n_ve_withholding_islr/i18n/es.po 2013-01-14 19:15:27 +0000
835@@ -22,7 +22,7 @@
836
837 #. module: l10n_ve_withholding_islr
838 #: view:islr.wh.doc:0
839-msgid "Print Withholding Income"
840+msgid "Print Income Withholding"
841 msgstr "Imprimir comprobante de retención"
842
843 #. module: l10n_ve_withholding_islr
844@@ -37,7 +37,7 @@
845
846 #. module: l10n_ve_withholding_islr
847 #: field:islr.xml.wh.doc,amount_total_ret:0
848-msgid "Withholding Income Amount Total"
849+msgid "Income Withholding Amount Total"
850 msgstr "Monto Total de Retención de ISLR"
851
852 #. module: l10n_ve_withholding_islr
853@@ -53,7 +53,7 @@
854 #. module: l10n_ve_withholding_islr
855 #: code:addons/l10n_ve_withholding_islr/invoice.py:461
856 #, python-format
857-msgid "Impossible withholding income, because the journal of withholding income for the '%s' has not been created with the type '%s'"
858+msgid "Impossible income withholding, because the journal of income withholding for the '%s' has not been created with the type '%s'"
859 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'"
860
861 #. module: l10n_ve_withholding_islr
862@@ -63,7 +63,7 @@
863
864 #. module: l10n_ve_withholding_islr
865 #: help:res.partner,islr_withholding_agent:0
866-msgid "Check if the partner is an agent for withholding income"
867+msgid "Check if the partner is an agent for income withholding"
868 msgstr "Marque en caso de que la empresa sea agente de retención de ISLR"
869
870 #. module: l10n_ve_withholding_islr
871@@ -146,12 +146,12 @@
872 #. module: l10n_ve_withholding_islr
873 #: code:addons/l10n_ve_withholding_islr/invoice.py:171
874 #, python-format
875-msgid "Impossible withholding income, because the partner '%s' has not fiscal direction set!."
876+msgid "Impossible income withholding, because the partner '%s' has not fiscal direction set!."
877 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el partner '%s' no tiene dirección fiscal asociada!."
878
879 #. module: l10n_ve_withholding_islr
880 #: view:islr.wh.doc.line:0
881-msgid "Lines Withholding Income"
882+msgid "Lines Income Withholding"
883 msgstr "Líneas de Retención de ISLR"
884
885 #. module: l10n_ve_withholding_islr
886@@ -204,7 +204,7 @@
887
888 #. module: l10n_ve_withholding_islr
889 #: help:wh.islr.config,journal_sale:0
890-msgid "Journal for sale operations involving Withholding Income"
891+msgid "Journal for sale operations involving Income Withholding"
892 msgstr "Diario para operaciones de venta que involucran retención de ISLR"
893
894 #. module: l10n_ve_withholding_islr
895@@ -230,7 +230,7 @@
896
897 #. module: l10n_ve_withholding_islr
898 #: help:wh.islr.config,journal_purchase:0
899-msgid "Journal for purchase operations involving Withholding Income"
900+msgid "Journal for purchase operations involving Income Withholding"
901 msgstr "Diario para operaciones de venta que involucran ISLR"
902
903 #. module: l10n_ve_withholding_islr
904@@ -283,7 +283,7 @@
905 #: model:ir.actions.act_window,name:l10n_ve_withholding_islr.action_wh_islr_customer
906 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_action_wh_islr_customer
907 #: view:islr.wh.doc:0
908-msgid "Customer Withholding Income"
909+msgid "Customer Income Withholding"
910 msgstr "Retención de ISLR de Cliente"
911
912 #. module: l10n_ve_withholding_islr
913@@ -298,7 +298,7 @@
914
915 #. module: l10n_ve_withholding_islr
916 #: field:wh.islr.config,account_purchase:0
917-msgid "Account Withholding Income Purchase"
918+msgid "Account Income Withholding Purchase"
919 msgstr "Cuenta contable para ISLR (compras)"
920
921 #. module: l10n_ve_withholding_islr
922@@ -347,7 +347,7 @@
923 #: model:ir.actions.act_window,name:l10n_ve_withholding_islr.action_wh_islr_supplier
924 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_action_wh_islr_supplier
925 #: view:islr.wh.doc:0
926-msgid "Supplier Withholding Income"
927+msgid "Supplier Income Withholding"
928 msgstr "Retención de ISLR de Proveedores"
929
930 #. module: l10n_ve_withholding_islr
931@@ -373,7 +373,7 @@
932 #. module: l10n_ve_withholding_islr
933 #: code:addons/l10n_ve_withholding_islr/invoice.py:270
934 #, python-format
935-msgid "Impossible withholding income,because the invoice number: '%s' has not number reference free!"
936+msgid "Impossible income withholding,because the invoice number: '%s' has not number reference free!"
937 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que la factura número: '%s' no tiene Número de Referencia Libre!"
938
939 #. module: l10n_ve_withholding_islr
940@@ -425,7 +425,7 @@
941 #. module: l10n_ve_withholding_islr
942 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:282
943 #, python-format
944-msgid "Impossible withholding income, because the account for withholding of sale is not assigned to the Concept withholding '%s'!"
945+msgid "Impossible income withholding, because the account for withholding of sale is not assigned to the Concept withholding '%s'!"
946 msgstr "Imposible realizar Retención ISLR, debido a que la cuenta contable para retención de venta no esta asignada al Concepto '%s' !!"
947
948 #. module: l10n_ve_withholding_islr
949@@ -441,7 +441,7 @@
950 #. module: l10n_ve_withholding_islr
951 #: code:addons/l10n_ve_withholding_islr/invoice.py:194
952 #, python-format
953-msgid "Impossible withholding income, because the partner '%s' has not vat associated!"
954+msgid "Impossible income withholding, because the partner '%s' has not vat associated!"
955 msgstr "Imposible realizar Comprobante de Retencion ISLR, debido a que el partner, '%s' no tiene RIF asociado!"
956
957 #. module: l10n_ve_withholding_islr
958@@ -461,7 +461,7 @@
959
960 #. module: l10n_ve_withholding_islr
961 #: model:ir.actions.act_window,help:l10n_ve_withholding_islr.action_wh_islr_supplier
962-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."
963+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."
964 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."
965
966 #. module: l10n_ve_withholding_islr
967@@ -537,13 +537,13 @@
968
969 #. module: l10n_ve_withholding_islr
970 #: field:islr.xml.wh.line,islr_wh_doc_line_id:0
971-msgid "Withholding Income Document"
972+msgid "Income Withholding Document"
973 msgstr "Documento de Retención de ISLR"
974
975 #. module: l10n_ve_withholding_islr
976 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:288
977 #, python-format
978-msgid "Impossible withholding income, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!"
979+msgid "Impossible income withholding, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!"
980 msgstr "Imposible realizar Retención ISLR, debido a que la cuenta contable para retención de compra no esta asignada al Concepto '%s' !"
981
982 #. module: l10n_ve_withholding_islr
983@@ -629,7 +629,7 @@
984
985 #. module: l10n_ve_withholding_islr
986 #: help:account.invoice.line,concept_id:0
987-msgid "Concept of Withholding Income asociate this rate"
988+msgid "Concept of Income Withholding asociate this rate"
989 msgstr "Concepto de Retención asociado a esta tasa"
990
991 #. module: l10n_ve_withholding_islr
992@@ -649,7 +649,7 @@
993
994 #. module: l10n_ve_withholding_islr
995 #: view:islr.wh.doc:0
996-msgid "Search Withholding Income"
997+msgid "Search Income Withholding"
998 msgstr "Búsqueda - Documento de ISLR"
999
1000 #. module: l10n_ve_withholding_islr
1001@@ -665,7 +665,7 @@
1002 #. module: l10n_ve_withholding_islr
1003 #: code:addons/l10n_ve_withholding_islr/installer.py:92
1004 #, python-format
1005-msgid "Journal Withholding Income Purchase"
1006+msgid "Journal Income Withholding Purchase"
1007 msgstr "Diario ISLR para compras"
1008
1009 #. module: l10n_ve_withholding_islr
1010@@ -680,12 +680,12 @@
1011
1012 #. module: l10n_ve_withholding_islr
1013 #: field:wh.islr.config,wh_agent:0
1014-msgid "Withholding Income Agent"
1015+msgid "Income Withholding Agent"
1016 msgstr "Eres agente de retención de ISLR?"
1017
1018 #. module: l10n_ve_withholding_islr
1019 #: model:ir.module.module,shortdesc:l10n_ve_withholding_islr.module_meta_information
1020-msgid "Automatically Calculation Withholding Income"
1021+msgid "Automatically Calculation Income Withholding"
1022 msgstr "Calculo Automático de Impuesto Sobre la Renta (ISLR)"
1023
1024 #. module: l10n_ve_withholding_islr
1025@@ -701,7 +701,7 @@
1026
1027 #. module: l10n_ve_withholding_islr
1028 #: model:ir.actions.act_window,help:l10n_ve_withholding_islr.action_wh_islr_concept
1029-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."
1030+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."
1031 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."
1032
1033 #. module: l10n_ve_withholding_islr
1034@@ -712,7 +712,7 @@
1035
1036 #. module: l10n_ve_withholding_islr
1037 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_doc_line
1038-msgid "Lines of Document Withholding Income"
1039+msgid "Lines of Document Income Withholding"
1040 msgstr "Líneas del Documento de Retención de ISLR"
1041
1042 #. module: l10n_ve_withholding_islr
1043@@ -757,7 +757,7 @@
1044 #. module: l10n_ve_withholding_islr
1045 #: model:ir.actions.report.xml,name:l10n_ve_withholding_islr.list_report_withholding_islr
1046 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_wh_configuration_islr
1047-msgid "Withholding Income"
1048+msgid "Income Withholding"
1049 msgstr "Retención de ISLR"
1050
1051 #. module: l10n_ve_withholding_islr
1052@@ -777,7 +777,7 @@
1053
1054 #. module: l10n_ve_withholding_islr
1055 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_doc
1056-msgid "Document Withholding Income"
1057+msgid "Document Income Withholding"
1058 msgstr "Documento de Retención de ISLR"
1059
1060 #. module: l10n_ve_withholding_islr
1061@@ -787,7 +787,7 @@
1062
1063 #. module: l10n_ve_withholding_islr
1064 #: help:product.template,concept_id:0
1065-msgid "Concept Withholding Income to apply to the service"
1066+msgid "Concept Income Withholding to apply to the service"
1067 msgstr "Concepto de Retención a aplicar para el servicio"
1068
1069 #. module: l10n_ve_withholding_islr
1070@@ -812,7 +812,7 @@
1071
1072 #. module: l10n_ve_withholding_islr
1073 #: model:ir.actions.report.xml,name:l10n_ve_withholding_islr.voucher_report_withholding_islr
1074-msgid "Voucher Withholding Income"
1075+msgid "Voucher Income Withholding"
1076 msgstr "Comprobante de ISLR"
1077
1078 #. module: l10n_ve_withholding_islr
1079@@ -827,7 +827,7 @@
1080
1081 #. module: l10n_ve_withholding_islr
1082 #: view:islr.wh.doc.line:0
1083-msgid "Detail of the Concept of Withholding Income"
1084+msgid "Detail of the Concept of Income Withholding"
1085 msgstr "Detalle del Concepto de Retención de ISLR"
1086
1087 #. module: l10n_ve_withholding_islr
1088@@ -871,7 +871,7 @@
1089 #. module: l10n_ve_withholding_islr
1090 #: code:addons/l10n_ve_withholding_islr/installer.py:93
1091 #, python-format
1092-msgid "Journal Withholding Income Sale"
1093+msgid "Journal Income Withholding Sale"
1094 msgstr "Diario ISLR para ventas"
1095
1096 #. module: l10n_ve_withholding_islr
1097@@ -973,7 +973,7 @@
1098
1099 #. module: l10n_ve_withholding_islr
1100 #: field:wh.islr.config,account_sale:0
1101-msgid "Account Withholding Income Sale"
1102+msgid "Account Income Withholding Sale"
1103 msgstr "Cuenta contable ISLR (ventas)"
1104
1105 #. module: l10n_ve_withholding_islr
1106@@ -1014,7 +1014,7 @@
1107 #. module: l10n_ve_withholding_islr
1108 #: code:addons/l10n_ve_withholding_islr/invoice.py:229
1109 #, python-format
1110-msgid "Impossible withholding income, because the Concept of Withholding associated with type line is not withheld!"
1111+msgid "Impossible income withholding, because the Concept of Withholding associated with type line is not withheld!"
1112 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!"
1113
1114 #. module: l10n_ve_withholding_islr
1115@@ -1037,7 +1037,7 @@
1116 #. module: l10n_ve_withholding_islr
1117 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_concept
1118 #: field:islr.wh.doc,concept_ids:0
1119-msgid "Withholding Income Concept"
1120+msgid "Income Withholding Concept"
1121 msgstr "Concepto de Retención de ISLR"
1122
1123 #. module: l10n_ve_withholding_islr
1124@@ -1052,7 +1052,7 @@
1125
1126 #. module: l10n_ve_withholding_islr
1127 #: help:wh.islr.config,account_purchase:0
1128-msgid "Account for purchase operations involving Withholding Income"
1129+msgid "Account for purchase operations involving Income Withholding"
1130 msgstr "Cuenta contable para operaciones de compra que involucran ISLR"
1131
1132 #. module: l10n_ve_withholding_islr
1133@@ -1077,8 +1077,8 @@
1134
1135 #. module: l10n_ve_withholding_islr
1136 #: help:islr.xml.wh.doc,name:0
1137-msgid "Description about statement of withholding income"
1138-msgstr "Description about statement of withholding income"
1139+msgid "Description about statement of income withholding"
1140+msgstr "Description about statement of income withholding"
1141
1142 #. module: l10n_ve_withholding_islr
1143 #: report:islr.wh.doc:0
1144@@ -1087,12 +1087,12 @@
1145
1146 #. module: l10n_ve_withholding_islr
1147 #: view:islr.wh.concept:0
1148-msgid "Search Concept of Withholding Income"
1149+msgid "Search Concept of Income Withholding"
1150 msgstr "Búsqueda - Concepto de Retención de ISLR"
1151
1152 #. module: l10n_ve_withholding_islr
1153 #: field:res.partner,islr_withholding_agent:0
1154-msgid "Withholding Income Agent?"
1155+msgid "Income Withholding Agent?"
1156 msgstr "Agente de Retención de ISLR?"
1157
1158 #. module: l10n_ve_withholding_islr
1159@@ -1173,7 +1173,7 @@
1160 #. module: l10n_ve_withholding_islr
1161 #: code:addons/l10n_ve_withholding_islr/invoice.py:166
1162 #, python-format
1163-msgid "Impossible withholding income, because the partner '%s' country has not defined direction in fiscal!"
1164+msgid "Impossible income withholding, because the partner '%s' country has not defined direction in fiscal!"
1165 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el partner '%s' no tiene país en su facturación fiscal!"
1166
1167 #. module: l10n_ve_withholding_islr
1168@@ -1251,7 +1251,7 @@
1169
1170 #. module: l10n_ve_withholding_islr
1171 #: help:wh.islr.config,account_sale:0
1172-msgid "Account for sale operations involving Withholding Income"
1173+msgid "Account for sale operations involving Income Withholding"
1174 msgstr "Cuenta para operaciones de ventas que involucran ISLR"
1175
1176 #. module: l10n_ve_withholding_islr
1177@@ -1293,7 +1293,7 @@
1178 #. module: l10n_ve_withholding_islr
1179 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:410
1180 #, python-format
1181-msgid "Impossible withholding income, because the supplier '%s' withholding agent is not!"
1182+msgid "Impossible income withholding, because the supplier '%s' withholding agent is not!"
1183 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el comprador '%s' no es agente de Retención!"
1184
1185 #. module: l10n_ve_withholding_islr
1186@@ -1304,22 +1304,22 @@
1187 #. module: l10n_ve_withholding_islr
1188 #: model:ir.module.module,description:l10n_ve_withholding_islr.module_meta_information
1189 msgid "\n"
1190-" ----------Automatically Calculated Withholding Income------------\n"
1191+" ----------Automatically Calculated Income Withholding------------\n"
1192 "\n"
1193 " What make this module?\n"
1194 " \n"
1195-" --Generate the voucher of withholding income to validate the invoice.\n"
1196-" --Generate the report of voucher of withholding income.\n"
1197+" --Generate the voucher of income withholding to validate the invoice.\n"
1198+" --Generate the report of voucher of income withholding.\n"
1199 " --Generate the file .xml required by the Venezuelan laws, for agent\n"
1200-" of withholding income specials.\n"
1201+" of income withholding specials.\n"
1202 " --Generate view for load the concepts of wittholding whith their rates.\n"
1203-" --Generate view for visualize the withholding income for suppilers and \n"
1204+" --Generate view for visualize the income withholding for suppilers and \n"
1205 " customers.\n"
1206 " --Load data of the 86 concepts of wittholdings whith their rates.\n"
1207 "\n"
1208 " Impromevents\n"
1209 " \n"
1210-" --For include the functionality of the withholding income to sales, \n"
1211+" --For include the functionality of the income withholding to sales, \n"
1212 " purchases and stock you should installer the module: l10n_ve_sale_purchase.\n"
1213 " "
1214 msgstr "\n"
1215@@ -1352,7 +1352,7 @@
1216 #. module: l10n_ve_withholding_islr
1217 #: code:addons/l10n_ve_withholding_islr/product.py:62
1218 #, python-format
1219-msgid "Must create the concept of withholding income"
1220+msgid "Must create the concept of income withholding"
1221 msgstr "Debe crear el concepto de retención de ISLR"
1222
1223 #. module: l10n_ve_withholding_islr
1224@@ -1368,12 +1368,12 @@
1225 #: view:islr.xml.wh.line:0
1226 #: view:product.product:0
1227 #: view:product.template:0
1228-msgid "Concept of Withholding Income"
1229+msgid "Concept of Income Withholding"
1230 msgstr "Concepto de Retención de ISLR"
1231
1232 #. module: l10n_ve_withholding_islr
1233 #: help:wh.islr.config,wh_agent:0
1234-msgid "Check if this company is a withholding income agent"
1235+msgid "Check if this company is a income withholding agent"
1236 msgstr "Determine si su cumpañía es un agente de retención de ISLR"
1237
1238 #. module: l10n_ve_withholding_islr
1239@@ -1384,7 +1384,7 @@
1240 #. module: l10n_ve_withholding_islr
1241 #: code:addons/l10n_ve_withholding_islr/invoice.py:280
1242 #, python-format
1243-msgid "Impossible withholding income, because the invoice number: '%s' has not control number associated!"
1244+msgid "Impossible income withholding, because the invoice number: '%s' has not control number associated!"
1245 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que la factura número: '%s' no tiene Número de Control Asociado!"
1246
1247 #. module: l10n_ve_withholding_islr
1248@@ -1425,12 +1425,12 @@
1249 #. module: l10n_ve_withholding_islr
1250 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:412
1251 #, python-format
1252-msgid "Impossible withholding income, because the lines of the invoice has not concept withholding!"
1253+msgid "Impossible income withholding, because the lines of the invoice has not concept withholding!"
1254 msgstr "Imposible realizar retención de ISLR, porque las lineas de la factura no tienen concepto de retención asociado!"
1255
1256 #. module: l10n_ve_withholding_islr
1257 #: view:wh.islr.config:0
1258-msgid "Withholding income Configuration"
1259+msgid "Income withholding Configuration"
1260 msgstr "Configuración de la Retención de ISLR"
1261
1262 #. module: l10n_ve_withholding_islr
1263@@ -1441,7 +1441,7 @@
1264 #. module: l10n_ve_withholding_islr
1265 #: view:wh.islr.config:0
1266 msgid "\n"
1267-"Configure your company's withholding income \n"
1268+"Configure your company's income withholding \n"
1269 " "
1270 msgstr "\n"
1271 "Configure los datos de su compañía para la Retención del Impuesto Sobre La Renta (ISLR) \n"
1272
1273=== modified file 'l10n_ve_withholding_islr/i18n/es_VE.po'
1274--- l10n_ve_withholding_islr/i18n/es_VE.po 2012-02-09 19:23:11 +0000
1275+++ l10n_ve_withholding_islr/i18n/es_VE.po 2013-01-14 19:15:27 +0000
1276@@ -27,7 +27,7 @@
1277
1278 #. module: l10n_ve_withholding_islr
1279 #: view:islr.wh.doc:0
1280-msgid "Print Withholding Income"
1281+msgid "Print Income Withholding"
1282 msgstr "Imprimir comprobante de retención"
1283
1284
1285@@ -38,7 +38,7 @@
1286
1287 #. module: l10n_ve_withholding_islr
1288 #: field:islr.xml.wh.doc,amount_total_ret:0
1289-msgid "Withholding Income Amount Total"
1290+msgid "Income Withholding Amount Total"
1291 msgstr "Monto Total de Retención de ISLR"
1292
1293 #. module: l10n_ve_withholding_islr
1294@@ -54,7 +54,7 @@
1295 #. module: l10n_ve_withholding_islr
1296 #: code:addons/l10n_ve_withholding_islr/invoice.py:461
1297 #, python-format
1298-msgid "Impossible withholding income, because the journal of withholding income for the '%s' has not been created with the type '%s'"
1299+msgid "Impossible income withholding, because the journal of income withholding for the '%s' has not been created with the type '%s'"
1300 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'"
1301
1302 #. module: l10n_ve_withholding_islr
1303@@ -64,7 +64,7 @@
1304
1305 #. module: l10n_ve_withholding_islr
1306 #: help:res.partner,islr_withholding_agent:0
1307-msgid "Check if the partner is an agent for withholding income"
1308+msgid "Check if the partner is an agent for income withholding"
1309 msgstr "Marque en caso de que la empresa sea agente de retención de ISLR"
1310
1311 #. module: l10n_ve_withholding_islr
1312@@ -147,12 +147,12 @@
1313 #. module: l10n_ve_withholding_islr
1314 #: code:addons/l10n_ve_withholding_islr/invoice.py:171
1315 #, python-format
1316-msgid "Impossible withholding income, because the partner '%s' has not fiscal direction set!."
1317+msgid "Impossible income withholding, because the partner '%s' has not fiscal direction set!."
1318 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el partner '%s' no tiene dirección fiscal asociada!."
1319
1320 #. module: l10n_ve_withholding_islr
1321 #: view:islr.wh.doc.line:0
1322-msgid "Lines Withholding Income"
1323+msgid "Lines Income Withholding"
1324 msgstr "Líneas de Retención de ISLR"
1325
1326 #. module: l10n_ve_withholding_islr
1327@@ -205,7 +205,7 @@
1328
1329 #. module: l10n_ve_withholding_islr
1330 #: help:wh.islr.config,journal_sale:0
1331-msgid "Journal for sale operations involving Withholding Income"
1332+msgid "Journal for sale operations involving Income Withholding"
1333 msgstr "Diario para operaciones de venta que involucran retención de ISLR"
1334
1335 #. module: l10n_ve_withholding_islr
1336@@ -231,7 +231,7 @@
1337
1338 #. module: l10n_ve_withholding_islr
1339 #: help:wh.islr.config,journal_purchase:0
1340-msgid "Journal for purchase operations involving Withholding Income"
1341+msgid "Journal for purchase operations involving Income Withholding"
1342 msgstr "Diario para operaciones de venta que involucran ISLR"
1343
1344 #. module: l10n_ve_withholding_islr
1345@@ -284,7 +284,7 @@
1346 #: model:ir.actions.act_window,name:l10n_ve_withholding_islr.action_wh_islr_customer
1347 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_action_wh_islr_customer
1348 #: view:islr.wh.doc:0
1349-msgid "Customer Withholding Income"
1350+msgid "Customer Income Withholding"
1351 msgstr "Retención de ISLR de Cliente"
1352
1353 #. module: l10n_ve_withholding_islr
1354@@ -299,7 +299,7 @@
1355
1356 #. module: l10n_ve_withholding_islr
1357 #: field:wh.islr.config,account_purchase:0
1358-msgid "Account Withholding Income Purchase"
1359+msgid "Account Income Withholding Purchase"
1360 msgstr "Cuenta contable para ISLR (compras)"
1361
1362 #. module: l10n_ve_withholding_islr
1363@@ -348,7 +348,7 @@
1364 #: model:ir.actions.act_window,name:l10n_ve_withholding_islr.action_wh_islr_supplier
1365 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_action_wh_islr_supplier
1366 #: view:islr.wh.doc:0
1367-msgid "Supplier Withholding Income"
1368+msgid "Supplier Income Withholding"
1369 msgstr "Retención de ISLR de Proveedores"
1370
1371 #. module: l10n_ve_withholding_islr
1372@@ -374,7 +374,7 @@
1373 #. module: l10n_ve_withholding_islr
1374 #: code:addons/l10n_ve_withholding_islr/invoice.py:270
1375 #, python-format
1376-msgid "Impossible withholding income,because the invoice number: '%s' has not number reference free!"
1377+msgid "Impossible income withholding,because the invoice number: '%s' has not number reference free!"
1378 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que la factura número: '%s' no tiene Número de Referencia Libre!"
1379
1380 #. module: l10n_ve_withholding_islr
1381@@ -426,7 +426,7 @@
1382 #. module: l10n_ve_withholding_islr
1383 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:282
1384 #, python-format
1385-msgid "Impossible withholding income, because the account for withholding of sale is not assigned to the Concept withholding '%s'!"
1386+msgid "Impossible income withholding, because the account for withholding of sale is not assigned to the Concept withholding '%s'!"
1387 msgstr "Imposible realizar Retención ISLR, debido a que la cuenta contable para retención de venta no esta asignada al Concepto '%s' !!"
1388
1389 #. module: l10n_ve_withholding_islr
1390@@ -442,7 +442,7 @@
1391 #. module: l10n_ve_withholding_islr
1392 #: code:addons/l10n_ve_withholding_islr/invoice.py:194
1393 #, python-format
1394-msgid "Impossible withholding income, because the partner '%s' has not vat associated!"
1395+msgid "Impossible income withholding, because the partner '%s' has not vat associated!"
1396 msgstr "Imposible realizar Comprobante de Retencion ISLR, debido a que el partner, '%s' no tiene RIF asociado!"
1397
1398 #. module: l10n_ve_withholding_islr
1399@@ -462,7 +462,7 @@
1400
1401 #. module: l10n_ve_withholding_islr
1402 #: model:ir.actions.act_window,help:l10n_ve_withholding_islr.action_wh_islr_supplier
1403-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."
1404+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."
1405 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."
1406
1407 #. module: l10n_ve_withholding_islr
1408@@ -538,13 +538,13 @@
1409
1410 #. module: l10n_ve_withholding_islr
1411 #: field:islr.xml.wh.line,islr_wh_doc_line_id:0
1412-msgid "Withholding Income Document"
1413+msgid "Income Withholding Document"
1414 msgstr "Documento de Retención de ISLR"
1415
1416 #. module: l10n_ve_withholding_islr
1417 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:288
1418 #, python-format
1419-msgid "Impossible withholding income, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!"
1420+msgid "Impossible income withholding, because the account for withholding of purchase is not assigned to the Concept withholding '%s'!"
1421 msgstr "Imposible realizar Retención ISLR, debido a que la cuenta contable para retención de compra no esta asignada al Concepto '%s' !"
1422
1423 #. module: l10n_ve_withholding_islr
1424@@ -630,7 +630,7 @@
1425
1426 #. module: l10n_ve_withholding_islr
1427 #: help:account.invoice.line,concept_id:0
1428-msgid "Concept of Withholding Income asociate this rate"
1429+msgid "Concept of Income Withholding asociate this rate"
1430 msgstr "Concepto de Retención asociado a esta tasa"
1431
1432 #. module: l10n_ve_withholding_islr
1433@@ -650,7 +650,7 @@
1434
1435 #. module: l10n_ve_withholding_islr
1436 #: view:islr.wh.doc:0
1437-msgid "Search Withholding Income"
1438+msgid "Search Income Withholding"
1439 msgstr "Búsqueda - Documento de ISLR"
1440
1441 #. module: l10n_ve_withholding_islr
1442@@ -666,7 +666,7 @@
1443 #. module: l10n_ve_withholding_islr
1444 #: code:addons/l10n_ve_withholding_islr/installer.py:92
1445 #, python-format
1446-msgid "Journal Withholding Income Purchase"
1447+msgid "Journal Income Withholding Purchase"
1448 msgstr "Diario ISLR para compras"
1449
1450 #. module: l10n_ve_withholding_islr
1451@@ -681,12 +681,12 @@
1452
1453 #. module: l10n_ve_withholding_islr
1454 #: field:wh.islr.config,wh_agent:0
1455-msgid "Withholding Income Agent"
1456+msgid "Income Withholding Agent"
1457 msgstr "Eres agente de retención de ISLR?"
1458
1459 #. module: l10n_ve_withholding_islr
1460 #: model:ir.module.module,shortdesc:l10n_ve_withholding_islr.module_meta_information
1461-msgid "Automatically Calculation Withholding Income"
1462+msgid "Automatically Calculation Income Withholding"
1463 msgstr "Calculo Automático de Impuesto Sobre la Renta (ISLR)"
1464
1465 #. module: l10n_ve_withholding_islr
1466@@ -702,7 +702,7 @@
1467
1468 #. module: l10n_ve_withholding_islr
1469 #: model:ir.actions.act_window,help:l10n_ve_withholding_islr.action_wh_islr_concept
1470-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."
1471+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."
1472 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."
1473
1474 #. module: l10n_ve_withholding_islr
1475@@ -713,7 +713,7 @@
1476
1477 #. module: l10n_ve_withholding_islr
1478 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_doc_line
1479-msgid "Lines of Document Withholding Income"
1480+msgid "Lines of Document Income Withholding"
1481 msgstr "Líneas del Documento de Retención de ISLR"
1482
1483 #. module: l10n_ve_withholding_islr
1484@@ -758,7 +758,7 @@
1485 #. module: l10n_ve_withholding_islr
1486 #: model:ir.actions.report.xml,name:l10n_ve_withholding_islr.list_report_withholding_islr
1487 #: model:ir.ui.menu,name:l10n_ve_withholding_islr.menu_wh_configuration_islr
1488-msgid "Withholding Income"
1489+msgid "Income Withholding"
1490 msgstr "Retención de ISLR"
1491
1492 #. module: l10n_ve_withholding_islr
1493@@ -778,7 +778,7 @@
1494
1495 #. module: l10n_ve_withholding_islr
1496 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_doc
1497-msgid "Document Withholding Income"
1498+msgid "Document Income Withholding"
1499 msgstr "Documento de Retención de ISLR"
1500
1501 #. module: l10n_ve_withholding_islr
1502@@ -788,7 +788,7 @@
1503
1504 #. module: l10n_ve_withholding_islr
1505 #: help:product.template,concept_id:0
1506-msgid "Concept Withholding Income to apply to the service"
1507+msgid "Concept Income Withholding to apply to the service"
1508 msgstr "Concepto de Retención a aplicar para el servicio"
1509
1510 #. module: l10n_ve_withholding_islr
1511@@ -813,7 +813,7 @@
1512
1513 #. module: l10n_ve_withholding_islr
1514 #: model:ir.actions.report.xml,name:l10n_ve_withholding_islr.voucher_report_withholding_islr
1515-msgid "Voucher Withholding Income"
1516+msgid "Voucher Income Withholding"
1517 msgstr "Comprobante de ISLR"
1518
1519 #. module: l10n_ve_withholding_islr
1520@@ -828,7 +828,7 @@
1521
1522 #. module: l10n_ve_withholding_islr
1523 #: view:islr.wh.doc.line:0
1524-msgid "Detail of the Concept of Withholding Income"
1525+msgid "Detail of the Concept of Income Withholding"
1526 msgstr "Detalle del Concepto de Retención de ISLR"
1527
1528 #. module: l10n_ve_withholding_islr
1529@@ -872,7 +872,7 @@
1530 #. module: l10n_ve_withholding_islr
1531 #: code:addons/l10n_ve_withholding_islr/installer.py:93
1532 #, python-format
1533-msgid "Journal Withholding Income Sale"
1534+msgid "Journal Income Withholding Sale"
1535 msgstr "Diario ISLR para ventas"
1536
1537 #. module: l10n_ve_withholding_islr
1538@@ -974,7 +974,7 @@
1539
1540 #. module: l10n_ve_withholding_islr
1541 #: field:wh.islr.config,account_sale:0
1542-msgid "Account Withholding Income Sale"
1543+msgid "Account Income Withholding Sale"
1544 msgstr "Cuenta contable ISLR (ventas)"
1545
1546 #. module: l10n_ve_withholding_islr
1547@@ -1015,7 +1015,7 @@
1548 #. module: l10n_ve_withholding_islr
1549 #: code:addons/l10n_ve_withholding_islr/invoice.py:229
1550 #, python-format
1551-msgid "Impossible withholding income, because the Concept of Withholding associated with type line is not withheld!"
1552+msgid "Impossible income withholding, because the Concept of Withholding associated with type line is not withheld!"
1553 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!"
1554
1555 #. module: l10n_ve_withholding_islr
1556@@ -1038,7 +1038,7 @@
1557 #. module: l10n_ve_withholding_islr
1558 #: model:ir.model,name:l10n_ve_withholding_islr.model_islr_wh_concept
1559 #: field:islr.wh.doc,concept_ids:0
1560-msgid "Withholding Income Concept"
1561+msgid "Income Withholding Concept"
1562 msgstr "Concepto de Retención de ISLR"
1563
1564 #. module: l10n_ve_withholding_islr
1565@@ -1053,7 +1053,7 @@
1566
1567 #. module: l10n_ve_withholding_islr
1568 #: help:wh.islr.config,account_purchase:0
1569-msgid "Account for purchase operations involving Withholding Income"
1570+msgid "Account for purchase operations involving Income Withholding"
1571 msgstr "Cuenta contable para operaciones de compra que involucran ISLR"
1572
1573 #. module: l10n_ve_withholding_islr
1574@@ -1078,8 +1078,8 @@
1575
1576 #. module: l10n_ve_withholding_islr
1577 #: help:islr.xml.wh.doc,name:0
1578-msgid "Description about statement of withholding income"
1579-msgstr "Description about statement of withholding income"
1580+msgid "Description about statement of income withholding"
1581+msgstr "Description about statement of income withholding"
1582
1583 #. module: l10n_ve_withholding_islr
1584 #: report:islr.wh.doc:0
1585@@ -1088,12 +1088,12 @@
1586
1587 #. module: l10n_ve_withholding_islr
1588 #: view:islr.wh.concept:0
1589-msgid "Search Concept of Withholding Income"
1590+msgid "Search Concept of Income Withholding"
1591 msgstr "Búsqueda - Concepto de Retención de ISLR"
1592
1593 #. module: l10n_ve_withholding_islr
1594 #: field:res.partner,islr_withholding_agent:0
1595-msgid "Withholding Income Agent?"
1596+msgid "Income Withholding Agent?"
1597 msgstr "Agente de Retención de ISLR?"
1598
1599 #. module: l10n_ve_withholding_islr
1600@@ -1174,7 +1174,7 @@
1601 #. module: l10n_ve_withholding_islr
1602 #: code:addons/l10n_ve_withholding_islr/invoice.py:166
1603 #, python-format
1604-msgid "Impossible withholding income, because the partner '%s' country has not defined direction in fiscal!"
1605+msgid "Impossible income withholding, because the partner '%s' country has not defined direction in fiscal!"
1606 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el partner '%s' no tiene país en su facturación fiscal!"
1607
1608 #. module: l10n_ve_withholding_islr
1609@@ -1252,7 +1252,7 @@
1610
1611 #. module: l10n_ve_withholding_islr
1612 #: help:wh.islr.config,account_sale:0
1613-msgid "Account for sale operations involving Withholding Income"
1614+msgid "Account for sale operations involving Income Withholding"
1615 msgstr "Cuenta para operaciones de ventas que involucran ISLR"
1616
1617 #. module: l10n_ve_withholding_islr
1618@@ -1294,7 +1294,7 @@
1619 #. module: l10n_ve_withholding_islr
1620 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:410
1621 #, python-format
1622-msgid "Impossible withholding income, because the supplier '%s' withholding agent is not!"
1623+msgid "Impossible income withholding, because the supplier '%s' withholding agent is not!"
1624 msgstr "Imposible realizar Comprobante de Retención de ISLR, debido a que el comprador '%s' no es agente de Retención!"
1625
1626 #. module: l10n_ve_withholding_islr
1627@@ -1305,22 +1305,22 @@
1628 #. module: l10n_ve_withholding_islr
1629 #: model:ir.module.module,description:l10n_ve_withholding_islr.module_meta_information
1630 msgid "\n"
1631-" ----------Automatically Calculated Withholding Income------------\n"
1632+" ----------Automatically Calculated Income Withholding------------\n"
1633 "\n"
1634 " What make this module?\n"
1635 " \n"
1636-" --Generate the voucher of withholding income to validate the invoice.\n"
1637-" --Generate the report of voucher of withholding income.\n"
1638+" --Generate the voucher of income withholding to validate the invoice.\n"
1639+" --Generate the report of voucher of income withholding.\n"
1640 " --Generate the file .xml required by the Venezuelan laws, for agent\n"
1641-" of withholding income specials.\n"
1642+" of income withholding specials.\n"
1643 " --Generate view for load the concepts of wittholding whith their rates.\n"
1644-" --Generate view for visualize the withholding income for suppilers and \n"
1645+" --Generate view for visualize the income withholding for suppilers and \n"
1646 " customers.\n"
1647 " --Load data of the 86 concepts of wittholdings whith their rates.\n"
1648 "\n"
1649 " Impromevents\n"
1650 " \n"
1651-" --For include the functionality of the withholding income to sales, \n"
1652+" --For include the functionality of the income withholding to sales, \n"
1653 " purchases and stock you should installer the module: l10n_ve_sale_purchase.\n"
1654 " "
1655 msgstr "\n"
1656@@ -1353,7 +1353,7 @@
1657 #. module: l10n_ve_withholding_islr
1658 #: code:addons/l10n_ve_withholding_islr/product.py:62
1659 #, python-format
1660-msgid "Must create the concept of withholding income"
1661+msgid "Must create the concept of income withholding"
1662 msgstr "Debe crear el concepto de retención de ISLR"
1663
1664 #. module: l10n_ve_withholding_islr
1665@@ -1369,12 +1369,12 @@
1666 #: view:islr.xml.wh.line:0
1667 #: view:product.product:0
1668 #: view:product.template:0
1669-msgid "Concept of Withholding Income"
1670+msgid "Concept of Income Withholding"
1671 msgstr "Concepto de Retención de ISLR"
1672
1673 #. module: l10n_ve_withholding_islr
1674 #: help:wh.islr.config,wh_agent:0
1675-msgid "Check if this company is a withholding income agent"
1676+msgid "Check if this company is a income withholding agent"
1677 msgstr "Determine si su cumpañía es un agente de retención de ISLR"
1678
1679 #. module: l10n_ve_withholding_islr
1680@@ -1385,7 +1385,7 @@
1681 #. module: l10n_ve_withholding_islr
1682 #: code:addons/l10n_ve_withholding_islr/invoice.py:280
1683 #, python-format
1684-msgid "Impossible withholding income, because the invoice number: '%s' has not control number associated!"
1685+msgid "Impossible income withholding, because the invoice number: '%s' has not control number associated!"
1686 msgstr "Imposible realizar Comprobante de Retención ISLR, debido a que la factura número: '%s' no tiene Número de Control Asociado!"
1687
1688 #. module: l10n_ve_withholding_islr
1689@@ -1426,12 +1426,12 @@
1690 #. module: l10n_ve_withholding_islr
1691 #: code:addons/l10n_ve_withholding_islr/islr_wh_doc.py:412
1692 #, python-format
1693-msgid "Impossible withholding income, because the lines of the invoice has not concept withholding!"
1694+msgid "Impossible income withholding, because the lines of the invoice has not concept withholding!"
1695 msgstr "Imposible realizar retención de ISLR, porque las lineas de la factura no tienen concepto de retención asociado!"
1696
1697 #. module: l10n_ve_withholding_islr
1698 #: view:wh.islr.config:0
1699-msgid "Withholding income Configuration"
1700+msgid "Income withholding Configuration"
1701 msgstr "Configuración de la Retención de ISLR"
1702
1703 #. module: l10n_ve_withholding_islr
1704@@ -1442,7 +1442,7 @@
1705 #. module: l10n_ve_withholding_islr
1706 #: view:wh.islr.config:0
1707 msgid "\n"
1708-"Configure your company's withholding income \n"
1709+"Configure your company's income withholding \n"
1710 " "
1711 msgstr "\n"
1712 "Configure los datos de su compañía para la Retención del Impuesto Sobre La Renta (ISLR) \n"
1713
1714=== modified file 'l10n_ve_withholding_islr/model/installer.py'
1715--- l10n_ve_withholding_islr/model/installer.py 2012-12-09 23:55:45 +0000
1716+++ l10n_ve_withholding_islr/model/installer.py 2013-01-14 19:15:27 +0000
1717@@ -74,24 +74,24 @@
1718 self._set_wh_agent(cr, uid)
1719
1720 _columns = {
1721- 'journal_purchase': fields.char("Journal Wh Income Purchase", 64, help="Journal for purchase operations involving Withholding Income"),
1722- 'journal_sale': fields.char("Journal Wh Income Sale", 64, help="Journal for sale operations involving Withholding Income"),
1723+ 'journal_purchase': fields.char("Journal Wh Income Purchase", 64, help="Journal for purchase operations involving Income Withholding"),
1724+ 'journal_sale': fields.char("Journal Wh Income Sale", 64, help="Journal for sale operations involving Income Withholding"),
1725 'account_purchase': fields.many2one(
1726 "account.account",
1727- "Account Withholding Income Purchase",
1728- help="Account for purchase operations involving Withholding Income"
1729+ "Account Income Withholding Purchase",
1730+ help="Account for purchase operations involving Income Withholding"
1731 ),
1732 'account_sale': fields.many2one(
1733 "account.account",
1734- "Account Withholding Income Sale",
1735- help="Account for sale operations involving Withholding Income",
1736+ "Account Income Withholding Sale",
1737+ help="Account for sale operations involving Income Withholding",
1738 ),
1739- 'wh_agent': fields.boolean("Withholding Income Agent", help="Check if this company is a withholding income agent"),
1740+ 'wh_agent': fields.boolean("Income Withholding Agent", help="Check if this company is a income withholding agent"),
1741 }
1742
1743 _defaults = {
1744- 'journal_purchase': _("Journal Withholding Income Purchase"),
1745- 'journal_sale': _("Journal Withholding Income Sale"),
1746+ 'journal_purchase': _("Journal Income Withholding Purchase"),
1747+ 'journal_sale': _("Journal Income Withholding Sale"),
1748 }
1749
1750 wh_islr_config()
1751
1752=== modified file 'l10n_ve_withholding_islr/model/invoice.py'
1753--- l10n_ve_withholding_islr/model/invoice.py 2012-12-09 23:55:45 +0000
1754+++ l10n_ve_withholding_islr/model/invoice.py 2013-01-14 19:15:27 +0000
1755@@ -39,7 +39,7 @@
1756 _inherit = "account.invoice.line"
1757 _columns = {
1758 '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."),
1759- 'concept_id': fields.many2one('islr.wh.concept','Withholding Concept',help="Concept of Withholding Income asociate this rate",required=False),
1760+ 'concept_id': fields.many2one('islr.wh.concept','Withholding Concept',help="Concept of Income Withholding asociate this rate",required=False),
1761 }
1762 _defaults = {
1763 'apply_wh': lambda *a: False,
1764@@ -93,6 +93,76 @@
1765 _defaults = {
1766 'status': lambda *a: "no_pro",
1767 }
1768+## BEGIN OF REWRITING ISLR
1769+
1770+ def check_invoice_type(self, cr, uid, ids, context=None):
1771+ '''
1772+ This method check if the given invoice record is from a supplier
1773+ '''
1774+ context = context or {}
1775+ ids = isinstance(ids, (int, long)) and [ids] or ids
1776+ inv_brw = self.browse(cr, uid, ids[0],context=context)
1777+ return inv_brw.type in ('in_invoice', 'in_refund')
1778+
1779+ def check_withholdable_concept(self, cr, uid, ids, context=None):
1780+ '''
1781+ Check if the given invoice record is ISLR Withholdable
1782+ '''
1783+ context = context or {}
1784+ ids = isinstance(ids, (int, long)) and [ids] or ids
1785+ iwdi_obj = self.pool.get('islr.wh.doc.invoices')
1786+ return iwdi_obj._get_concepts(cr, uid, ids, context=context)
1787+
1788+ def _create_doc_invoices(self,cr,uid,ids,islr_wh_doc_id,context=None):
1789+ '''
1790+ This method link the invoices to be withheld
1791+ with the withholding document.
1792+ '''
1793+ #TODO: CHECK IF THIS METHOD SHOULD BE HERE OR IN THE ISLR WH DOC
1794+ context = context or {}
1795+ ids = isinstance(ids, (int, long)) and [ids] or ids
1796+ doc_inv_obj = self.pool.get('islr.wh.doc.invoices')
1797+ iwhdi_ids=[]
1798+ for inv_id in ids:
1799+ iwhdi_ids.append(doc_inv_obj.create(cr,uid,
1800+ {'invoice_id':inv_id,'islr_wh_doc_id':islr_wh_doc_id}))
1801+ return iwhdi_ids
1802+
1803+ def _create_islr_wh_doc(self,cr,uid,ids,context=None):
1804+ '''
1805+ Funcion para crear en el modelo islr_wh_doc
1806+ '''
1807+ context = context or {}
1808+ ids = isinstance(ids, (int, long)) and [ids] or ids
1809+
1810+ doc_line_obj = self.pool.get('islr.wh.doc.line')
1811+ wh_doc_obj = self.pool.get('islr.wh.doc')
1812+ inv_obj =self.pool.get('account.invoice.line')
1813+ rate_obj = self.pool.get('islr.rates')
1814+
1815+ row = self.browse(cr,uid,ids[0],context=context)
1816+ context['type']=row.type
1817+ wh_ret_code = wh_doc_obj.retencion_seq_get(cr, uid)
1818+
1819+ if wh_ret_code:
1820+ islr_wh_doc_id = wh_doc_obj.create(cr,uid,
1821+ {'name': wh_ret_code,
1822+ 'partner_id': row.partner_id.id,
1823+ 'invoice_id': row.id,
1824+ 'period_id': row.period_id.id,
1825+ 'account_id': row.account_id.id,
1826+ 'type': row.type,
1827+ 'journal_id': wh_doc_obj._get_journal(cr,uid,context=context),})
1828+ self._create_doc_invoices(cr,uid,row.id,islr_wh_doc_id)
1829+ else:
1830+ raise osv.except_osv(_('Invalid action !'),_("No se ha encontrado el numero de secuencia!"))
1831+
1832+ self.write(cr,uid,ids,{'islr_wh_doc_id':islr_wh_doc_id,'islr_wh_doc_name':wh_ret_code})
1833+
1834+ #wf_service = netsvc.LocalService("workflow")
1835+ #wf_service.trg_validate(uid, 'islr.wh.doc', islr_wh_doc_id, 'button_confirm', cr)
1836+ return islr_wh_doc_id
1837+## END OF REWRITING ISLR
1838
1839 def copy(self, cr, uid, id, default=None, context=None):
1840
1841@@ -125,572 +195,6 @@
1842 list.append((x,y,res))
1843 return list
1844
1845- def _get_partners(self, cr, uid, invoice):
1846- '''
1847- Get the seller id, the buyer id from the invoice, and the boolean field that determines whether the buyer is the withholding agent
1848- '''
1849- if invoice.type == 'in_invoice' or invoice.type == 'in_refund':
1850- vendor = invoice.partner_id
1851- buyer = invoice.company_id.partner_id
1852- else:
1853- buyer = invoice.partner_id
1854- vendor = invoice.company_id.partner_id
1855- return (vendor, buyer, buyer.islr_withholding_agent)
1856-
1857- def _get_concepts(self, cr, uid, invoice):
1858- '''
1859- Gets a list of concepts (cocenpt_id) from the invoice lines
1860- '''
1861- service_list = []
1862- for invoice_line in invoice.invoice_line:
1863- if invoice_line.concept_id and invoice_line.concept_id.withholdable:
1864- service_list.append(invoice_line.concept_id.id)
1865- else:
1866- pass
1867- return list(set(service_list))
1868-
1869- def _get_service_wh(self, cr, uid, invoice, concept_list):
1870- '''
1871- Gets all the vendor invoice lines, filtering by the period of the current invoice and the invoice state equal to {done, onpen}
1872- 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
1873- A search in the lines is done seeking for lines that have withholding concepts equals to the current invoice. This is done to verify:
1874- 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.
1875- 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
1876-
1877- '''
1878- dict={}
1879- for key in concept_list:
1880- dict[key]={'lines':[],'wh':False,'base':0.0}
1881- #~ inv_obj = self.pool.get('account.invoice')
1882- #~ 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.
1883- #~
1884- #~ inv_line_lst=[]
1885- #~ for id in inv_lst:
1886- #~ inv_line_brw = inv_obj.browse(cr, uid, id).invoice_line #lista de lineas de facturas
1887- for line in invoice.invoice_line:
1888- 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.
1889- 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.
1890- dict[line.concept_id.id]['lines'].append(line.id)
1891- dict[line.concept_id.id]['base']+= line.price_subtotal
1892- 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.
1893- dict[line.concept_id.id]['wh']=True
1894- #~ dict[key]={'lines':[],'wh':False,'base':0.0}
1895- return dict
1896-
1897- def _get_country_fiscal(self,cr, uid, partner_id):
1898- '''
1899- Gets depending on the parameters the country of the seller or buyer from the fiscal address.
1900- '''
1901- for i in partner_id.address:
1902- if i.type == 'invoice':
1903- if not i.country_id:
1904- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the partner '%s' country has not defined direction in fiscal!") % (partner_id.name))
1905- return False
1906- else:
1907- return i.country_id.id
1908- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the partner '%s' has not fiscal direction set!.") % (partner_id.name))
1909- return False
1910-
1911- def _get_residence(self, cr, uid, vendor, buyer):
1912- '''
1913- Determines whether the buyer fiscal address is the same that the seller. with the objective of later get the associated rate.
1914- Return True if is a domiciled or resident person, False if is not
1915- '''
1916- vendor_address = self._get_country_fiscal(cr, uid, vendor)
1917- buyer_address = self._get_country_fiscal(cr, uid, buyer)
1918- if vendor_address and buyer_address:
1919- if vendor_address == buyer_address:
1920- return True
1921- else:
1922- return False
1923- return False
1924-
1925- def _get_nature(self, cr, uid, partner_id):
1926- '''
1927- Gets the nature of the seller from RIF. Return True if is a natural person type, False if is a legal entity.
1928- '''
1929- if not partner_id.vat:
1930- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the partner '%s' has not vat associated!") % (partner_id.name))
1931- return False
1932- else:
1933- if partner_id.vat[2:3] in 'VvEe':
1934- return True
1935- else:
1936- return False
1937-
1938- def _get_rate(self, cr, uid, concept_id, residence, nature,context):
1939- '''
1940- Gets the withholding concept rate, provided if is associated to the below specifications:
1941- - the nature of the seller match with a rate
1942- - the residence of the seller match with a rate
1943- '''
1944- ut_obj = self.pool.get('l10n.ut')
1945- rate_brw_lst = self.pool.get('islr.wh.concept').browse(cr, uid, concept_id).rate_ids
1946- for rate_brw in rate_brw_lst:
1947- if rate_brw.nature == nature and rate_brw.residence == residence:
1948- #~ (base,min,porc,sust,codigo,id_rate,name_rate)
1949- rate_brw_minimum = ut_obj.compute_ut_to_money(cr, uid, rate_brw.minimum, False, context)#metodo que transforma los UVT en pesos
1950- rate_brw_subtract = ut_obj.compute_ut_to_money(cr, uid, rate_brw.subtract, False, context)#metodo que transforma los UVT en pesos
1951- return (rate_brw.base, rate_brw_minimum, rate_brw.wh_perc, rate_brw_subtract,rate_brw.code,rate_brw.id,rate_brw.name)
1952- return ()
1953-
1954- def _get_rate_dict(self, cr, uid, concept_list, residence, nature,context):
1955- '''
1956- Returns a dictionary with the rate of each withholding concept.
1957- '''
1958- dictd = {}
1959- cont = 0
1960- for concept_id in concept_list:
1961- dictd[concept_id] = self._get_rate(cr, uid, concept_id, residence, nature,context)
1962- if dictd[concept_id]:
1963- cont += 1
1964- if not cont:
1965- 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!"))
1966- return dictd
1967-
1968-
1969- def _pop_dict(self,cr,uid,concept_list,dict_rate,wh_dict):
1970- '''
1971- 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.
1972- '''
1973- for concept in concept_list:
1974- if not dict_rate[concept]:
1975- dict_rate.pop(concept)
1976- wh_dict.pop(concept)
1977-
1978- def _get_wh_calc(self,cr,uid,line,dict_rate_concept):
1979- base = self.pool.get('account.invoice.line').browse(cr,uid,line).price_subtotal
1980- return (base * (dict_rate_concept[0]/100) * (dict_rate_concept[2]/100), base)
1981-
1982- def _get_number(self,cr,uid,number,long):
1983- num1 = number[::-1]
1984- result= ''
1985- for i in num1:
1986- if i.isdigit():
1987- if len(result)<long:
1988- result = i + result
1989- else:
1990- break
1991- else:
1992- break
1993- return result.strip()
1994-
1995-
1996- def _get_inv_data(self,cr, uid, line):
1997- '''
1998- Gets the RIF of the supplier, the invoice number and the control number of the invoice. Data required for XML, among others.
1999- '''
2000- inv_brw = self.pool.get('account.invoice.line').browse(cr, uid, line).invoice_id
2001- vat = inv_brw.partner_id.vat[2:]
2002- if inv_brw.type == 'in_invoice' or inv_brw.type == 'in_refund':
2003- #~ number = inv_brw.reference.strip()
2004- if not inv_brw.reference:
2005- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income,because the invoice number: '%s' has not number reference free!") % (inv_brw.number))
2006- number = 0
2007- else:
2008- number = self._get_number(cr,uid,inv_brw.reference.strip(),10)
2009- else:
2010- if not inv_brw.number:
2011- number = 0
2012- else:
2013- number = self._get_number(cr,uid,inv_brw.number.strip(),10)
2014- if not inv_brw.nro_ctrl:
2015- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the invoice number: '%s' has not control number associated!") % (inv_brw.number))
2016- else:
2017- control = self._get_number(cr,uid,inv_brw.nro_ctrl.strip(),8)
2018-
2019- return (vat, number, control)
2020-
2021- def _write_wh_apply(self,cr, uid,line,dict,apply,type):
2022- '''
2023- If wh_xml_id field in the invoice line has an associated xml id:
2024- Write over the boolean field in the invoice line True o False depending on whether it holds withholding or not.
2025- 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.
2026- Otherwise:
2027- Create a new xml line.
2028- Write True or False value on the invoice line, and assigns the xml id created in the previuos step.
2029- '''
2030- il_ids = self.pool.get('account.invoice.line').browse(cr, uid,line)
2031-
2032- if il_ids.wh_xml_id:
2033- self.pool.get('account.invoice.line').write(cr, uid, line, {'apply_wh': apply})
2034- self.pool.get('islr.xml.wh.line').write(cr,uid,il_ids.wh_xml_id.id,{'wh':dict['wh']})
2035- else:
2036- if type in ('out_invoice', 'out_refund'):
2037- self.pool.get('account.invoice.line').write(cr, uid, line, {'apply_wh': apply})
2038- else:
2039- 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)})
2040- message = _("Withholding income xml line generated.")
2041- self.log(cr, uid, line, message)
2042-
2043- def _create_islr_xml_wh_line(self,cr, uid, line, dict):
2044- '''
2045- Create a new xml line
2046- '''
2047- inv_id = self.pool.get('account.invoice.line').browse(cr, uid,line).invoice_id
2048- return self.pool.get('islr.xml.wh.line').create(cr, uid, {'name': dict['name_rate'],
2049- 'concept_id': dict['concept'],
2050- 'period_id': inv_id.period_id.id,
2051- 'partner_vat':dict['vat'],
2052- 'invoice_number': dict['number'],
2053- 'control_number': dict['control'],
2054- 'concept_code':dict['code'],
2055- 'base': dict['subtotal'],
2056- 'porcent_rete':dict['perc'],
2057- 'wh':dict['wh'],
2058- 'rate_id': dict['rate_id'],
2059- 'account_invoice_line_id': line,
2060- 'account_invoice_id': inv_id.id,
2061- 'partner_id': inv_id.partner_id.id,
2062- })
2063-
2064- def _get_wh(self,cr, uid, subtract,concept, wh_dict, dict_rate, apply,context=None):
2065- '''
2066- Returns a dictionary containing all the values ​​of the retention of an invoice line.
2067- '''
2068- if context is None:
2069- context={}
2070- res= {}
2071- inv_obj= self.pool.get('account.invoice')
2072- if apply: # Si se va a aplicar retencion.
2073- for line in wh_dict[concept]['lines']:
2074- 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
2075- if subtract >= wh_calc:
2076- wh = 0.0
2077- subtract -= wh_calc
2078- else:
2079- wh = wh_calc - subtract
2080- subtract_write= subtract
2081- subtract=0.0
2082- inv_id = self.pool.get('account.invoice.line').browse(cr, uid,line).invoice_id.id
2083- type = inv_obj.browse(cr,uid,inv_id).type
2084- res[line]={ 'vat': self._get_inv_data(cr, uid, line)[0],
2085- 'number': self._get_inv_data(cr, uid, line)[1],
2086- 'control': self._get_inv_data(cr, uid, line)[2],
2087- 'concept': concept,
2088- 'code':dict_rate[concept][4],
2089- 'subtotal': subtotal,
2090- 'perc':dict_rate[concept][2],
2091- 'wh':wh,
2092- 'apply':apply,
2093- 'rate_id':dict_rate[concept][5],
2094- 'name_rate': dict_rate[concept][6]}
2095- if not context.get('test_from_wkf',False):
2096- self._write_wh_apply(cr,uid,line,res[line],apply,type)
2097- inv_obj.write(cr, uid, inv_id, {'status': 'pro'})
2098- else: # Si no aplica retencion
2099- for line in wh_dict[concept]['lines']:
2100- subtotal = self._get_wh_calc(cr,uid,line,dict_rate[concept])[1]
2101- inv_id = self.pool.get('account.invoice.line').browse(cr, uid,line).invoice_id.id
2102- type = inv_obj.browse(cr,uid,inv_id).type
2103- res[line]={ 'vat': self._get_inv_data(cr, uid, line)[0],
2104- 'number': self._get_inv_data(cr, uid, line)[1],
2105- 'control': self._get_inv_data(cr, uid, line)[2],
2106- 'concept': concept,
2107- 'code':dict_rate[concept][4],
2108- 'subtotal': subtotal,
2109- 'perc':dict_rate[concept][2],
2110- 'wh':0.0,
2111- 'apply':apply,
2112- 'rate_id':dict_rate[concept][5],
2113- 'name_rate': dict_rate[concept][6]}
2114- if not context.get('test_from_wkf',False):
2115- self._write_wh_apply(cr,uid,line,res[line],apply,type)
2116- inv_obj.write(cr, uid, inv_id, {'status': 'pro'})
2117- return res
2118-
2119-
2120- def _get_wh_apply(self,cr,uid,dict_rate,wh_dict,nature,context=None):
2121- '''
2122- Returns a dictionary containing all data for the withholding. Each item is an invoice line.
2123- '''
2124- if context is None:
2125- context={}
2126- res = {}
2127- for concept in wh_dict:
2128- if not wh_dict[concept]['wh']: #Si nunca se ha aplicado retencion con este concepto.
2129- 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.
2130- subtract = dict_rate[concept][3] # Obtengo el sustraendo a aplicar. Existe sustraendo porque es la primera vez.
2131- 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.
2132- else: # Si el monto base no supera el monto minimo de la tasa(de igual forma se deb declarar asi no supere.)
2133- subtract = 0.0
2134- res.update(self._get_wh(cr, uid, subtract,concept, wh_dict, dict_rate, False,context=context))
2135- 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)
2136- if nature:
2137- subtract = dict_rate[concept][3]
2138- res.update(self._get_wh(cr, uid, subtract,concept, wh_dict, dict_rate, True,context=context))
2139- else:
2140- subtract = 0.0
2141- 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.
2142- return res
2143-
2144-
2145- def _get_amount(self,cr,uid,dict):
2146- '''
2147- Get the sum of the withholding amount by concept.
2148- '''
2149- dict_concept = {}
2150- for key in dict:
2151- x = dict[key]['concept']
2152- y = dict[key]['wh']
2153- if not dict_concept.get(x,False):
2154- dict_concept[x] = y
2155- else:
2156- dict_concept[x]+= y
2157- return dict_concept
2158-
2159-
2160- def _get_dict_concepts(self,cr,uid,dict):
2161- '''
2162- Get a dictionary grouped by concept:
2163- {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'}},
2164- {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'}}
2165- ],
2166- 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'}}
2167- ]}
2168- '''
2169- dict_concepts = {}
2170- for key in dict:
2171- x = dict[key]['concept']
2172- y = dict[key]
2173- if not dict_concepts.get(x,False):
2174- if dict[key]['apply']:
2175- dict_concepts[x]=[]
2176- dict_concepts[x].append({key:y})
2177- else:
2178- if dict[key]['apply']:
2179- dict_concepts[x].append({key:y})
2180- return dict_concepts
2181-
2182-
2183- def get_journal(self,cr,uid,inv_brw):
2184- '''
2185- Assign the corresponding journal according to each type of withholding (purchase, sale). The journal types are created in retencion_iva
2186- '''
2187- tipo='Sale'
2188- tipo2='islr_sale'
2189- journal_id = None
2190- journal_obj = self.pool.get('account.journal')
2191- if inv_brw.type == 'out_invoice' or inv_brw.type =='out_refund':
2192- journal_id = journal_obj.search(cr, uid, [('type', '=', 'islr_sale')], limit=1)
2193- else:
2194- journal_id = journal_obj.search(cr, uid, [('type', '=', 'islr_purchase')], limit=1)
2195- tipo = 'Purchase'
2196- tipo2 = 'islr_purchase'
2197- if not journal_id:
2198- 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))
2199-
2200- return journal_id[0] or None
2201-
2202- def button_confirm(self, cr, uid, ids, context=None):
2203- return self.write(cr, uid, ids, {'state': 'confirmed'})
2204-
2205- def _create_islr_wh_doc(self,cr,uid,inv_brw,dict):
2206- '''
2207- To create in the islr_wh_doc model
2208- '''
2209- islr_wh_doc_id=0
2210- wh_doc_obj = self.pool.get('islr.wh.doc')
2211- inv_obj =self.pool.get('account.invoice.line')
2212- inv_brw = inv_brw.invoice_id
2213- inv_brw2 = inv_obj.browse(cr,uid,dict.keys())
2214- islr_wh_doc_id = wh_doc_obj.create(cr,uid,
2215- {'name': wh_doc_obj.retencion_seq_get(cr, uid),
2216- 'partner_id': inv_brw.partner_id.id,
2217- 'invoice_id': inv_brw.id,
2218- 'period_id': inv_brw.period_id.id,
2219- 'account_id': inv_brw.account_id.id,
2220- 'type': inv_brw.type,
2221- 'journal_id': self.get_journal(cr,uid,inv_brw),
2222- 'islr_wh_doc_id': [(6,0,[i.invoice_id.id for i in inv_brw2])]
2223- })
2224-
2225- wf_service = netsvc.LocalService("workflow")
2226- wf_service.trg_validate(uid, 'islr.wh.doc', islr_wh_doc_id, 'button_confirm', cr)
2227-# wf_service.trg_write(uid, 'islr.wh.doc', islr_wh_doc_id, cr)
2228- return islr_wh_doc_id
2229-
2230-
2231- def _create_doc_line(self,cr,uid, inv_brw,key2,islr_wh_doc_id,dictt,dictc):
2232- '''
2233- To create in the islr_wh_doc_line model
2234- '''
2235- doc_line_obj = self.pool.get('islr.wh.doc.line')
2236- rate_obj = self.pool.get('islr.rates')
2237- dict_concept = self._get_amount(cr,uid,dictt)
2238- inv_line_id = dictc[key2][0].keys()[0]
2239- rate_id = dictc[key2][0][inv_line_id]['rate_id']
2240-
2241- islr_wh_doc_line_id = doc_line_obj.create(cr,uid,
2242- {'islr_wh_doc_id':islr_wh_doc_id,
2243- 'concept_id':key2,
2244- 'islr_rates_id':rate_id,
2245- 'invoice_id': inv_brw.invoice_id.id,
2246- 'retencion_islr': rate_obj.browse(cr,uid,rate_id).wh_perc,
2247- 'amount':dict_concept[key2],})
2248-
2249- return islr_wh_doc_line_id
2250-
2251- def _create_doc_invoices(self,cr,uid,key,islr_wh_doc_id):
2252- '''
2253- To create in the islr_wh_doc_invoices model
2254- '''
2255- doc_inv_obj = self.pool.get('islr.wh.doc.invoices')
2256- inv_id = key
2257- islr_wh_doc_invoices_id = doc_inv_obj.create(cr,uid,{'invoice_id':inv_id,'islr_wh_doc_id':islr_wh_doc_id})
2258-
2259-
2260- def _write_wh_xml(self,cr,uid,key,islr_wh_doc_line_id):
2261- '''
2262- Write in the xml_wh_line model
2263- '''
2264- inv_obj =self.pool.get('account.invoice.line')
2265- xml_obj = self.pool.get('islr.xml.wh.line')
2266- xml_id = inv_obj.browse(cr,uid,key).wh_xml_id.id
2267- xml_obj.write(cr, uid, xml_id, {'islr_wh_doc_line_id':islr_wh_doc_line_id})
2268-
2269-
2270- def _get_inv_id(self,cr,uid,dict):
2271- '''
2272- Get the invoice obj_browse
2273- '''
2274- inv_obj =self.pool.get('account.invoice.line')
2275- line_ids = [key for key in dict if dict[key]['apply']]
2276- line_ids.sort()
2277- return line_ids and inv_obj.browse(cr,uid,line_ids[-1]) or False
2278-
2279-
2280- def _logic_create(self,cr,uid,dict,wh_doc_id):
2281- '''
2282- Handling of all the logic for generating lines on models.
2283- '''
2284- dictc = self._get_dict_concepts(cr,uid,dict)
2285- inv_brw = self._get_inv_id(cr,uid,dict)
2286- inv_obj =self.pool.get('account.invoice.line')
2287- islr_wh_doc_id=None
2288-
2289- if inv_brw:
2290- if dictc and not wh_doc_id:
2291- islr_wh_doc_id = self._create_islr_wh_doc(cr,uid,inv_brw,dict)
2292- else:
2293- islr_wh_doc_id = wh_doc_id
2294- key_lst = []
2295- if islr_wh_doc_id:
2296- for key2 in dictc:
2297- inv_line_id = dictc[key2][0].keys()[0]
2298- islr_wh_doc_line_id = self._create_doc_line(cr,uid,inv_brw,key2,islr_wh_doc_id,dict,dictc)
2299- for line in dictc[key2]:
2300- inv_line_id2 = dictc[key2][0].keys()[0]
2301- for key in line:
2302- key_lst.append(inv_obj.browse(cr,uid,key).invoice_id.id)
2303- if not wh_doc_id:
2304- self._write_wh_xml(cr,uid,key,islr_wh_doc_line_id)
2305- for key in set(key_lst):
2306- self._create_doc_invoices(cr,uid,key,islr_wh_doc_id)
2307-
2308- self.pool.get('account.invoice').write(cr,uid,inv_brw.invoice_id.id,{'islr_wh_doc_id':islr_wh_doc_id})
2309-
2310- message = _("Withholding income voucher '%s' generated.") % self.pool.get('islr.wh.doc').browse(cr,uid,islr_wh_doc_id).name
2311- self.log(cr, uid, islr_wh_doc_id, message)
2312- else:
2313- pass
2314- else:
2315- pass
2316- return islr_wh_doc_id
2317-
2318- def action_ret_islr(self, cr, uid, ids, context={}):
2319- return self.pool.get('islr.wh.doc').action_ret_islr(cr,uid,ids,context)
2320-
2321- def _check_wh_islr(self, cr, uid, ids, context=None):
2322- if context is None:
2323- context={}
2324-
2325- wh_apply=[]
2326- # The two function being called below should undergo overhauling
2327- # right now it takes an object as and argument instead of an integer
2328- invoice = self.browse(cr, uid, ids[0], context=context)
2329- vendor, buyer, wh = self._get_partners(cr, uid, invoice)
2330- concept_list = self._get_concepts(cr, uid, invoice)
2331- wh_apply.append(wh)
2332- wh_apply.append(concept_list)
2333-
2334- return invoice, vendor, buyer, concept_list, all(wh_apply)
2335-
2336- def _check_do_wh(self, cr, uid, ids, invoice, vendor, buyer, concept_list, context=None):
2337- if context is None:
2338- context={}
2339- wh_dict = self._get_service_wh(cr, uid, invoice, concept_list)
2340- residence = self._get_residence(cr, uid, vendor, buyer)
2341- nature = self._get_nature(cr, uid, vendor)
2342- dict_rate = self._get_rate_dict(cr, uid, concept_list, residence, nature,context=context)
2343- self._pop_dict(cr,uid,concept_list,dict_rate,wh_dict)
2344- dict_completo = self._get_wh_apply(cr,uid,dict_rate,wh_dict,nature,context=context)
2345- inv_brw = self._get_inv_id(cr,uid,dict_completo)
2346-
2347- return bool(inv_brw)
2348-
2349- def check_wh_islr_apply(self, cr, uid, ids, context=None):
2350- '''
2351- This Method test if given certain conditions it is
2352- possible to create a new withholding document
2353- '''
2354- #TODO: Este metodo deberia devolver true ya que es un metodo "check"
2355- if context is None:
2356- context={}
2357-
2358- invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
2359-
2360- do_wh = False
2361- if wh_apply:
2362- context.update({'test_from_wkf':True})
2363- do_wh = self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
2364-
2365- return all([wh_apply,do_wh])
2366-
2367- def check_wh_islr_xml(self, cr, uid, ids, context=None):
2368- '''
2369- This Method test if given certain conditions it is
2370- __not__ possible to create a new withholding document
2371- but the xml elements needed to create a legal report
2372- '''
2373- if context is None:
2374- context={}
2375-
2376- invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
2377-
2378- do_wh = True
2379- if wh_apply:
2380- context.update({'test_from_wkf':True})
2381- do_wh = self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
2382-
2383- return all([wh_apply,not do_wh])
2384-
2385- def action_islr_xml(self, cr, uid, ids, context=None):
2386- '''
2387- This Method creates the xml elements needed to provide a legal report
2388- '''
2389- if context is None:
2390- context={}
2391-
2392- invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
2393-
2394- if wh_apply:
2395- self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
2396-
2397- return True
2398-
2399- def check_invoice_type(self, cr, uid, ids, context=None):
2400- '''
2401- This method test the invoice types to create a new withholding document
2402- '''
2403- #TODO: change on workflow
2404- if context is None:
2405- context={}
2406- obj = self.browse(cr, uid, ids[0],context=context)
2407- if obj.type in ('in_invoice', 'in_refund'):
2408- return True
2409- return False
2410-
2411 def validate_wh_income_done(self, cr, uid, ids, context=None):
2412 """
2413 Method that check if wh income is validated in invoice refund.
2414@@ -710,12 +214,3 @@
2415 return True
2416
2417 account_invoice()
2418-
2419-
2420-
2421-
2422-
2423-
2424-
2425-
2426-
2427
2428=== modified file 'l10n_ve_withholding_islr/model/islr_wh_concept.py'
2429--- l10n_ve_withholding_islr/model/islr_wh_concept.py 2012-12-09 23:55:45 +0000
2430+++ l10n_ve_withholding_islr/model/islr_wh_concept.py 2013-01-14 19:15:27 +0000
2431@@ -38,7 +38,7 @@
2432 Model to create the withholding concepts
2433 '''
2434 _name='islr.wh.concept'
2435- _description = 'Withholding Income Concept'
2436+ _description = 'Income Withholding Concept'
2437
2438 _columns={
2439 'name':fields.char('Withholding Concept', translate=True,size=256,required=True,help="Name of Withholding Concept, Example: Honorarios Profesionales, Comisiones a..."),
2440
2441=== modified file 'l10n_ve_withholding_islr/model/islr_wh_doc.py'
2442--- l10n_ve_withholding_islr/model/islr_wh_doc.py 2012-12-09 23:55:45 +0000
2443+++ l10n_ve_withholding_islr/model/islr_wh_doc.py 2013-01-14 19:15:27 +0000
2444@@ -41,13 +41,14 @@
2445 type = context.get('type', 'in_invoice')
2446 return type
2447
2448- def _get_journal(self, cr, uid, context):
2449+ def _get_journal(self, cr, uid, context=None):
2450 if context is None:
2451 context = {}
2452- type_inv = context.get('type')
2453- type2journal = {'out_invoice': 'retislrSale', 'in_invoice': 'retislrPurchase', 'out_refund': 'retislrSale', 'in_refund': 'retislrPurchase'}
2454 journal_obj = self.pool.get('account.journal')
2455- res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'retislrPurchase'))], limit=1)
2456+ if context.get('type') in ('out_invoice', 'out_refund'):
2457+ res = journal_obj.search(cr, uid, [('type', '=', 'islr_sale')], limit=1)
2458+ else:
2459+ res = journal_obj.search(cr, uid, [('type', '=', 'islr_purchase')], limit=1)
2460 if res:
2461 return res[0]
2462 else:
2463@@ -68,18 +69,6 @@
2464 res[rete.id] += line.amount
2465 return res
2466
2467- def _get_period(self,cr,uid,ids,name,args,context={}):
2468- res = {}
2469- wh_doc_brw = self.browse(cr,uid,ids, context=None)
2470- for doc in wh_doc_brw:
2471- res[doc.id] = False
2472- if doc.date_ret:
2473- 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'))])
2474- if len(period_ids):
2475- period_id = period_ids[0]
2476- res[doc.id] = period_id
2477- return res
2478-
2479 def filter_lines_invoice(self,cr,uid,partner_id,context):
2480 inv_obj = self.pool.get('account.invoice')
2481 invoice_obj = self.pool.get('islr.wh.doc.invoices')
2482@@ -95,7 +84,7 @@
2483 return inv_ids
2484
2485 _name = "islr.wh.doc"
2486- _description = 'Document Withholding Income'
2487+ _description = 'Document Income Withholding'
2488 _columns= {
2489 'name': fields.char('Description', size=64,readonly=True, states={'draft':[('readonly',False)]}, required=True, help="Voucher description"),
2490 'code': fields.char('Code', size=32, readonly=True, states={'draft':[('readonly',False)]}, help="Voucher reference"),
2491@@ -116,14 +105,14 @@
2492 ],'State', readonly=True, help="Voucher state"),
2493 'date_ret': fields.date('Accounting Date', help="Keep empty to use the current date"),
2494 'date_uid': fields.date('Withhold Date', readonly=True, states={'draft':[('readonly',False)]}, help="Voucher date"),
2495- '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"),
2496+ 'period_id': fields.many2one('account.period', 'Period', help="Period when the accounts entries were done"),
2497 'account_id': fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Account Receivable or Account Payable of partner"),
2498 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True, required=True, states={'draft':[('readonly',False)]}, help="Partner object of withholding"),
2499 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Currency in which the transaction takes place"),
2500 'journal_id': fields.many2one('account.journal', 'Journal', required=True,readonly=True, states={'draft':[('readonly',False)]}, help="Journal where accounting entries are recorded"),
2501 'company_id': fields.many2one('res.company', 'Company', required=True, help="Company"),
2502 '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"),
2503- 'concept_ids': fields.one2many('islr.wh.doc.line','islr_wh_doc_id','Withholding Income Concept', readonly=True, states={'draft':[('readonly',False)]}),
2504+ 'concept_ids': fields.one2many('islr.wh.doc.line','islr_wh_doc_id','Income Withholding Concept', readonly=True, states={'draft':[('readonly',False)]}),
2505 'invoice_ids':fields.one2many('islr.wh.doc.invoices','islr_wh_doc_id','Withheld Invoices'),
2506 'invoice_id':fields.many2one('account.invoice','Invoice',readonly=False,help="Invoice to make the accounting entry"),
2507 'islr_wh_doc_id': fields.one2many('account.invoice','islr_wh_doc_id','Invoices',states={'draft':[('readonly',False)]}),
2508@@ -142,22 +131,39 @@
2509 'user_id': lambda s, cr, u, c: u,
2510 }
2511
2512+ def check_income_wh(self, cr, uid, ids, context=None):
2513+ context = context or {}
2514+ ids = isinstance(ids, (int, long)) and [ids] or ids
2515+ obj = self.browse(cr, uid, ids[0],context=context)
2516+ res = {}
2517+ for wh_line in obj.invoice_ids:
2518+ if not wh_line.islr_xml_id:
2519+ res[wh_line.id] = (wh_line.invoice_id.name,
2520+ wh_line.invoice_id.number, wh_line.invoice_id.reference)
2521+ if res:
2522+ note = _('The Following Invoices Have not yet been withheld:\n\n')
2523+ for i in res:
2524+ note += '* %s, %s, %s\n'%res[i]
2525+ note += _('\nPlease, Load the Taxes to be withheld and Try Again')
2526+ raise osv.except_osv(_('Invoices with Missing Withheld Taxes!'),note)
2527+ return True
2528+
2529+ def compute_amount_wh(self, cr, uid, ids, context=None):
2530+ context = context or {}
2531+ ids = isinstance(ids, (int, long)) and [ids] or ids
2532+ iwdi_obj = self.pool.get('islr.wh.doc.invoices')
2533+ iwd_brw = self.browse(cr, uid, ids[0], context=context)
2534+ for iwdi_brw in iwd_brw.invoice_ids:
2535+ iwdi_obj.load_taxes(cr, uid, iwdi_brw.id, context=context)
2536+ return True
2537 def validate(self, cr,uid,ids,*args):
2538
2539 if args[0]in ['in_invoice','in_refund'] and args[1] and args[2]:
2540 return True
2541
2542- def action_process(self,cr,uid,ids, *args):
2543- inv_obj=self.pool.get('account.invoice')
2544- context = {}
2545- wh_doc_brw = self.browse(cr, uid, ids, context=None)
2546- inv_ids = []
2547-
2548- for wh_doc in wh_doc_brw:
2549- for wh_doc_line in wh_doc.islr_wh_doc_id:
2550- inv_ids.append(wh_doc_line.id)
2551- context["wh_doc_id"]=ids[0]
2552- inv_obj.action_ret_islr(cr, uid, inv_ids,context)
2553+ def action_process(self,cr,uid,ids, context=None):
2554+ # TODO: ERASE THE REGARDING NODE IN THE WORKFLOW
2555+ # METHOD HAVE BEEN LEFT FOR BACKWARD COMPATIBILITY
2556 return True
2557
2558 def action_cancel_process(self,cr,uid,ids,context=None):
2559@@ -226,9 +232,10 @@
2560 vals['code'] = code
2561 return super(islr_wh_doc, self).create(cr, uid, vals, context)
2562
2563- def action_confirm1(self, cr, uid, ids, context={}):
2564- return self.write(cr, uid, ids, {'state':'confirmed'})
2565-
2566+ def action_confirm(self, cr, uid, ids, context=None):
2567+ context = context or {}
2568+ ids = isinstance(ids, (int, long)) and [ids] or ids
2569+ return self.write(cr, uid, ids[0], {'state':'confirmed'})
2570
2571 def action_number(self, cr, uid, ids, *args):
2572 obj_ret = self.browse(cr, uid, ids)[0]
2573@@ -243,21 +250,12 @@
2574 'WHERE id=%s', (number, id))
2575 return True
2576
2577- def action_done1(self, cr, uid, ids, context={}):
2578- self.action_number(cr, uid, ids)
2579- self.action_move_create(cr, uid, ids)
2580- self.write(cr, uid, ids, {'state':'done'})
2581- return True
2582-
2583 def action_cancel(self,cr,uid,ids,context={}):
2584 #~ if self.browse(cr,uid,ids)[0].type=='in_invoice':
2585 #~ return True
2586 self.cancel_move(cr,uid,ids)
2587 self.action_cancel_process(cr,uid,ids,context=context)
2588 return True
2589-
2590-
2591-
2592
2593 def cancel_move (self,cr,uid,ids, *args):
2594 context={}
2595@@ -279,72 +277,69 @@
2596 self.write(cr, uid, ids, {'state':'draft'})
2597 return True
2598
2599- def action_move_create(self, cr, uid, ids, *args):
2600+ def action_move_create(self, cr, uid, ids, context=None):
2601 wh_doc_obj = self.pool.get('islr.wh.doc.line')
2602- context = {}
2603+ context = context or {}
2604+ ids = isinstance(ids, (int, long)) and [ids] or ids
2605 inv_id = None
2606 doc_brw = None
2607-
2608- for ret in self.browse(cr, uid, ids):
2609- if not ret.date_uid:
2610- self.write(cr, uid, [ret.id], {'date_uid':time.strftime('%Y-%m-%d')})
2611-
2612- if not ret.date_ret:
2613- self.write(cr, uid, [ret.id], {'date_ret':time.strftime('%Y-%m-%d')})
2614-
2615- period_id = ret.period_id and ret.period_id.id or False
2616- journal_id = ret.journal_id.id
2617-
2618- if not period_id:
2619- 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'))])
2620- if len(period_ids):
2621- period_id = period_ids[0]
2622- else:
2623- raise osv.except_osv(_('Warning !'), _("Not found a fiscal period to date: '%s' please check!") % (ret.date_ret or time.strftime('%Y-%m-%d')))
2624-
2625- if ret.concept_ids:
2626- for line in ret.concept_ids:
2627- if ret.type in ('in_invoice', 'in_refund'):
2628- if line.concept_id.property_retencion_islr_payable:
2629- acc_id = line.concept_id.property_retencion_islr_payable.id
2630- inv_id = ret.invoice_id.id
2631- else:
2632- 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))
2633- else:
2634- if line.concept_id.property_retencion_islr_receivable:
2635- acc_id = line.concept_id.property_retencion_islr_receivable.id
2636- inv_id = line.invoice_id.id
2637- else:
2638- 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))
2639-
2640- writeoff_account_id = False
2641- writeoff_journal_id = False
2642- amount = line.amount
2643-
2644- ret_move = self.wh_and_reconcile(cr, uid, [ret.id], inv_id,
2645- amount, acc_id, period_id, journal_id, writeoff_account_id,
2646- period_id, writeoff_journal_id, context)
2647-
2648- # make the retencion line point to that move
2649- rl = {
2650- 'move_id': ret_move['move_id'],
2651- }
2652- #lines = [(op,id,values)] escribir en un one2many
2653- lines = [(1, line.id, rl)]
2654- self.write(cr, uid, [ret.id], {'concept_ids':lines})
2655-
2656- if lines:
2657- message = _("Withholding income voucher '%s' validated and accounting entry generated.") % self.browse(cr, uid, ids[0]).name
2658- self.log(cr, uid, ids[0], message)
2659-
2660- for line in ret.concept_ids:
2661- for xml in line.xml_ids:
2662- if xml.islr_xml_wh_doc.state!='done':
2663- if xml.period_id.id != period_id:
2664- self.pool.get('islr.xml.wh.line').write(cr,uid,xml.id,{'period_id':period_id, 'islr_xml_wh_doc':None})
2665- else:
2666- raise osv.except_osv(_('Invalid action !'),_("Impossible change the period accountig to a withholding that has already been declared."))
2667-# inv_obj.write(cr, uid, line.invoice_id.id, {'retention':True}, context=context)
2668+ ixwl_obj = self.pool.get('islr.xml.wh.line')
2669+ ret = self.browse(cr, uid, ids[0], context=context)
2670+ if not ret.date_uid:
2671+ self.write(cr, uid, [ret.id], {'date_uid':time.strftime('%Y-%m-%d')})
2672+
2673+ if not ret.date_ret:
2674+ self.write(cr, uid, [ret.id], {'date_ret':time.strftime('%Y-%m-%d')})
2675+
2676+ period_id = ret.period_id and ret.period_id.id or False
2677+ journal_id = ret.journal_id.id
2678+
2679+ if not period_id:
2680+ 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'))])
2681+ if len(period_ids):
2682+ period_id = period_ids[0]
2683+ else:
2684+ raise osv.except_osv(_('Warning !'), _("Not found a fiscal period to date: '%s' please check!") % (ret.date_ret or time.strftime('%Y-%m-%d')))
2685+
2686+ for line in ret.concept_ids:
2687+ if ret.type in ('in_invoice', 'in_refund'):
2688+ if line.concept_id.property_retencion_islr_payable:
2689+ acc_id = line.concept_id.property_retencion_islr_payable.id
2690+ inv_id = line.invoice_id.id
2691+ else:
2692+ 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))
2693+ else:
2694+ if line.concept_id.property_retencion_islr_receivable:
2695+ acc_id = line.concept_id.property_retencion_islr_receivable.id
2696+ inv_id = line.invoice_id.id
2697+ else:
2698+ 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))
2699+
2700+ writeoff_account_id = False
2701+ writeoff_journal_id = False
2702+ amount = line.amount
2703+
2704+ ret_move = self.wh_and_reconcile(cr, uid, [ret.id], inv_id,
2705+ amount, acc_id, period_id, journal_id, writeoff_account_id,
2706+ period_id, writeoff_journal_id, context)
2707+
2708+ # make the retencion line point to that move
2709+ rl = {
2710+ 'move_id': ret_move['move_id'],
2711+ }
2712+ #lines = [(op,id,values)] escribir en un one2many
2713+ lines = [(1, line.id, rl)]
2714+ self.write(cr, uid, [ret.id], {'concept_ids':lines})
2715+
2716+ if lines:
2717+ message = _("Income withholding voucher '%s' validated and accounting entry generated.") % self.browse(cr, uid, ids[0]).name
2718+ self.log(cr, uid, ids[0], message)
2719+
2720+ xml_ids = []
2721+ for line in ret.concept_ids:
2722+ xml_ids += [xml.id for xml in line.xml_ids]
2723+ ixwl_obj.write(cr,uid,xml_ids,{'period_id':period_id},context=context)
2724+ self.write(cr,uid,ids,{'period_id':period_id},context=context)
2725 return True
2726
2727
2728@@ -415,46 +410,13 @@
2729 self.pool.get('account.invoice').write(cr, uid, invoice_id, {}, context=context)
2730 return {'move_id': move_id}
2731
2732-
2733- def action_ret_islr(self, cr, uid, ids, context={}):
2734- #TODO: :
2735- inv_obj = self.pool.get('account.invoice')
2736- invoices_brw = inv_obj.browse(cr, uid, ids, context)
2737- wh_doc_list = []
2738- for invoice in invoices_brw:
2739- wh_doc_list = inv_obj.pool.get('islr.wh.doc.invoices').search(cr,uid,[('invoice_id','=',invoice.id)])
2740- if wh_doc_list: #Chequear que la factura no haya sido retenida.
2741- raise osv.except_osv(_('Invalid action !'),_("The Withholding invoice '%s' has already been done!") % (invoice.number))
2742- else: # 1.- Si la factura no ha sido retenida
2743- wh_dict={}
2744- dict_rate={}
2745- dict_completo={}
2746- vendor, buyer, apply_wh = inv_obj._get_partners(cr,uid,invoice) # Se obtiene el (vendedor, el comprador, si el comprador es agente de retencion)
2747- concept_list = inv_obj._get_concepts(cr,uid,invoice)# Se obtiene la lista de conceptos de las lineas de la factura actual.
2748- if concept_list: # 2.- Si existe algun concepto de retencion en las lineas de la factura.
2749- if apply_wh: # 3.- Si el comprador es agente de retencion
2750- 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.
2751- residence = inv_obj._get_residence(cr, uid, vendor, buyer) # Retorna el tipo de residencia del vendedor
2752- nature = inv_obj._get_nature(cr, uid, vendor) # Retorna la naturaleza del vendedor.
2753- dict_rate = inv_obj._get_rate_dict(cr, uid, concept_list, residence, nature,context) # Retorna las tasas por cada concepto
2754- 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.
2755- 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.
2756- 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.
2757- else:
2758- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the supplier '%s' withholding agent is not!") % (buyer.name))
2759- else:
2760- raise osv.except_osv(_('Invalid action !'),_("Impossible withholding income, because the lines of the invoice has not concept withholding!"))
2761- #~ break
2762- return islr_wh_doc_id
2763-
2764-
2765 islr_wh_doc()
2766
2767
2768 class account_invoice(osv.osv):
2769 _inherit = 'account.invoice'
2770 _columns = {
2771- 'islr_wh_doc_id': fields.many2one('islr.wh.doc','Withhold Document',readonly=True,help="Document Withholding Income tax generated from this bill"),
2772+ 'islr_wh_doc_id': fields.many2one('islr.wh.doc','Withhold Document',readonly=True,help="Document Income Withholding tax generated from this bill"),
2773 }
2774 _defaults = {
2775 'islr_wh_doc_id': lambda *a: 0,
2776@@ -474,7 +436,7 @@
2777 class islr_wh_doc_invoices(osv.osv):
2778 _name = "islr.wh.doc.invoices"
2779 _description = 'Document and Invoice Withheld Income'
2780-
2781+
2782 def _amount_all(self, cr, uid, ids, fieldname, args, context=None):
2783 res = {}
2784 for ret_line in self.browse(cr, uid, ids, context):
2785@@ -491,17 +453,226 @@
2786 _columns= {
2787 'islr_wh_doc_id': fields.many2one('islr.wh.doc','Withhold Document', ondelete='cascade', help="Document Retention income tax generated from this bill"),
2788 'invoice_id':fields.many2one('account.invoice','Invoice', help="Withheld invoice"),
2789- 'islr_xml_id':fields.one2many('islr.xml.wh.line','islr_wh_doc_inv_id','Withholding'),
2790- 'amount_islr_ret':fields.function(_amount_all, method=True, digits=(16,4), string='Wh. tax amount', multi='all', help="Withholding tax amount"),
2791- 'base_ret': fields.function(_amount_all, method=True, digits=(16,4), string='Wh. amount', multi='all', help="Withholding without tax amount"),
2792+ 'islr_xml_id':fields.one2many('islr.xml.wh.line','islr_wh_doc_inv_id','Withholding Lines'),
2793+ 'amount_islr_ret':fields.function(_amount_all, method=True, digits=(16,4), string='Withheld Amount', multi='all', help="Amount withheld from the base amount"),
2794+ '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"),
2795 }
2796 _rec_rame = 'invoice_id'
2797+
2798+ def _get_concepts(self, cr, uid, ids, context=None):
2799+ '''
2800+ Gets a list of withholdable concepts (concept_id) from the invoice lines
2801+ '''
2802+ context = context or {}
2803+ ids = isinstance(ids, (int, long)) and [ids] or ids
2804+ inv_obj = self.pool.get('account.invoice')
2805+ concept_set = set()
2806+ inv_brw = inv_obj.browse(cr, uid, ids[0], context=context)
2807+ for ail in inv_brw.invoice_line:
2808+ if ail.concept_id and ail.concept_id.withholdable:
2809+ concept_set.add(ail.concept_id.id)
2810+ return list(concept_set)
2811+
2812+ def _get_wh(self, cr, uid, ids, concept_id, context=None):
2813+ '''
2814+ Returns a dictionary containing all the values ​​of the retention of an invoice line.
2815+ '''
2816+ context= context or {}
2817+ ids = isinstance(ids, (int, long)) and [ids] or ids
2818+ ixwl_obj= self.pool.get('islr.xml.wh.line')
2819+ iwdl_obj= self.pool.get('islr.wh.doc.line')
2820+ iwdl_brw = iwdl_obj.browse(cr, uid, ids[0], context=context)
2821+
2822+ vendor, buyer, wh_agent = self._get_partners(cr, uid, iwdl_brw.invoice_id)
2823+ apply = not vendor.islr_exempt
2824+ residence = self._get_residence(cr, uid, vendor, buyer)
2825+ nature = self._get_nature(cr, uid, vendor)
2826+
2827+ #rate_base,rate_minimum,rate_wh_perc,rate_subtract,rate_code,rate_id,rate_name
2828+ rate_tuple = self._get_rate(cr, uid, concept_id, residence, nature, context=context)
2829+ base = 0
2830+ for line in iwdl_brw.xml_ids:
2831+ base += line.account_invoice_line_id.price_subtotal
2832+ apply = apply and base >= rate_tuple[0]*rate_tuple[1]/100.0
2833+ wh = 0.0
2834+ subtract = apply and rate_tuple[3] or 0.0
2835+ subtract_write=0.0
2836+ wh_concept = 0.0
2837+ sb_concept = subtract
2838+ for line in iwdl_brw.xml_ids:
2839+ if apply:
2840+ wh_calc = (rate_tuple[0]/100.0)*rate_tuple[2]*line.account_invoice_line_id.price_subtotal/100.0
2841+ if subtract >= wh_calc:
2842+ wh = 0.0
2843+ subtract -= wh_calc
2844+ else:
2845+ wh = wh_calc - subtract
2846+ subtract_write= subtract
2847+ subtract=0.0
2848+ ixwl_obj.write(cr,uid,line.id,{'wh':wh, 'sustract':subtract or subtract_write},
2849+ context=context)
2850+ wh_concept+=wh
2851+ iwdl_obj.write(cr, uid, ids[0],{'amount':wh_concept,
2852+ 'subtract':sb_concept, 'base_amount': base},context=context)
2853+ return True
2854+
2855+
2856+ def load_taxes(self, cr, uid, ids, context=None):
2857+ context = context or {}
2858+ ids = isinstance(ids, (int, long)) and [ids] or ids
2859+ ixwl_obj = self.pool.get('islr.xml.wh.line')
2860+ iwdl_obj = self.pool.get('islr.wh.doc.line')
2861+ ret_line = self.browse(cr, uid, ids[0], context=context)
2862+ lines = []
2863+ rates = {}
2864+ wh_perc= {}
2865+ xmls = {}
2866+ if ret_line.invoice_id:
2867+ #~ Searching & Unlinking for xml lines from the current invoice
2868+ xml_lines = ixwl_obj.search(cr, uid, [('islr_wh_doc_inv_id', '=', ret_line.id)],context=context)
2869+ if xml_lines:
2870+ ixwl_obj.unlink(cr, uid, xml_lines)
2871+
2872+ #~ Creating xml lines from the current invoices again
2873+ ail_brws= [i for i in ret_line.invoice_id.invoice_line if i.concept_id and i.concept_id.withholdable]
2874+ for i in ail_brws:
2875+ values = self._get_xml_lines(cr, uid, i, context=context)
2876+ values.update({'islr_wh_doc_inv_id':ret_line.id,})
2877+ #~ Vuelve a crear las lineas
2878+ xml_id = ixwl_obj.create(cr, uid, values, context=context)
2879+ #~ Write back the new xml_id into the account_invoice_line
2880+ i.write({'wh_xml_id':xml_id},context=context)
2881+ lines.append(xml_id)
2882+ #~ Keeps a log of the rate & percentage for a concept
2883+ rates[i.concept_id.id]=values['rate_id']
2884+ wh_perc[i.concept_id.id]=values['porcent_rete']
2885+ if xmls.get(i.concept_id.id):
2886+ xmls[i.concept_id.id]+=[xml_id]
2887+ else:
2888+ xmls[i.concept_id.id]=[xml_id]
2889+
2890+ #~ Searching & Unlinking for concept lines from the current invoice
2891+ iwdl_ids = iwdl_obj.search(cr, uid, [('invoice_id', '=', ret_line.invoice_id.id)],context=context)
2892+ if iwdl_ids:
2893+ iwdl_obj.unlink(cr, uid, iwdl_ids)
2894+ iwdl_ids=[]
2895+ #~ Creating concept lines for the current invoice
2896+ concept_list = self._get_concepts(cr, uid, ret_line.invoice_id.id, context=context)
2897+ for concept_id in concept_list:
2898+ iwdl_id=iwdl_obj.create(cr,uid,
2899+ {'islr_wh_doc_id':ret_line.islr_wh_doc_id.id,
2900+ 'concept_id':concept_id,
2901+ 'islr_rates_id':rates[concept_id],
2902+ 'invoice_id': ret_line.invoice_id.id,
2903+ 'retencion_islr':wh_perc[concept_id],
2904+ 'xml_ids': [(6,0,xmls[concept_id])],
2905+ }, context=context)
2906+ self._get_wh(cr, uid, iwdl_id, concept_id, context=context)
2907+ return True
2908+
2909+ def _get_partners(self, cr, uid, invoice):
2910+ '''
2911+ 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.
2912+ '''
2913+ if invoice.type == 'in_invoice' or invoice.type == 'in_refund':
2914+ vendor = invoice.partner_id
2915+ buyer = invoice.company_id.partner_id
2916+ ret_code = invoice
2917+ else:
2918+ buyer = invoice.partner_id
2919+ vendor = invoice.company_id.partner_id
2920+ return (vendor, buyer, buyer.islr_withholding_agent)
2921+
2922+ def _get_residence(self, cr, uid, vendor, buyer):
2923+ '''
2924+ Se determina si la direccion fiscal del comprador es la misma que la del vendedor, con el fin de luego obtener la tasa asociada.
2925+ Retorna True si es una persona domiciliada o residente. Retorna False si es, no Residente o No Domicialiado.
2926+ '''
2927+ vendor_address = self._get_country_fiscal(cr, uid, vendor)
2928+ buyer_address = self._get_country_fiscal(cr, uid, buyer)
2929+ if vendor_address and buyer_address:
2930+ if vendor_address == buyer_address:
2931+ return True
2932+ else:
2933+ return False
2934+ return False
2935+
2936+ def _get_nature(self, cr, uid, partner_id):
2937+ '''
2938+ Se obtiene la naturaleza del vendedor a partir del RIF, retorna True si es persona de tipo natural, y False si es juridica.
2939+ '''
2940+ if not partner_id.vat:
2941+ raise osv.except_osv(_('Invalid action !'),_("Impossible income withholding, because the partner '%s' has not vat associated!") % (partner_id.name))
2942+ return False
2943+ else:
2944+ if partner_id.vat[2:3] in 'VvEe' or partner_id.spn:
2945+ return True
2946+ else:
2947+ return False
2948+
2949+ def _get_rate(self, cr, uid, concept_id, residence, nature,context):
2950+ '''
2951+ Se obtiene la tasa del concepto de retencion, siempre y cuando exista uno asociado a las especificaciones:
2952+ La naturaleza del vendedor coincida con una tasa.
2953+ La residencia del vendedor coindica con una tasa.
2954+ '''
2955+ ut_obj = self.pool.get('l10n.ut')
2956+ rate_brw_lst = self.pool.get('islr.wh.concept').browse(cr, uid, concept_id).rate_ids
2957+ for rate_brw in rate_brw_lst:
2958+ if rate_brw.nature == nature and rate_brw.residence == residence:
2959+ #~ (base,min,porc,sust,codigo,id_rate,name_rate)
2960+ rate_brw_minimum = ut_obj.compute_ut_to_money(cr, uid, rate_brw.minimum, False, context)#metodo que transforma los UVT en pesos
2961+ rate_brw_subtract = ut_obj.compute_ut_to_money(cr, uid, rate_brw.subtract, False, context)#metodo que transforma los UVT en pesos
2962+ return (rate_brw.base, rate_brw_minimum, rate_brw.wh_perc, rate_brw_subtract,rate_brw.code,rate_brw.id,rate_brw.name)
2963+ return ()
2964+
2965+ def _get_country_fiscal(self,cr, uid, partner_id,context=None):
2966+ '''
2967+ Get the country of the partner
2968+ '''
2969+ #TODO: THIS METHOD SHOULD BE IMPROVED
2970+ #DUE TO OPENER HAS CHANGED THE WAY PARTNER
2971+ #ARE USED FOR ACCOUNT_MOVE
2972+ context = context or {}
2973+ if not partner_id.country_id:
2974+ raise osv.except_osv(_('Invalid action !'),_("Impossible income withholding, because the partner '%s' country has not been defined in the address!") % (partner_id.name))
2975+ else:
2976+ return partner_id.country_id.id
2977+
2978+ def _get_xml_lines(self, cr, uid, ail_brw, context=None):
2979+ context = context or {}
2980+ vendor, buyer, wh_agent = self._get_partners(cr, uid, ail_brw.invoice_id)
2981+ residence = self._get_residence(cr, uid, vendor, buyer)
2982+ nature = self._get_nature(cr, uid, vendor)
2983+ 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)
2984+
2985+ wh = ((rate_base * ail_brw.price_subtotal /100) * rate_wh_perc)/100.0
2986+
2987+ return {
2988+ 'account_invoice_id':ail_brw.invoice_id.id,
2989+ 'islr_wh_doc_line_id':False,
2990+ 'islr_xml_wh_doc':False,
2991+ 'wh':wh, # Debo buscarlo
2992+ 'base':ail_brw.price_subtotal, # La consigo tambien pero desde el rate
2993+ 'period_id':False, # Debemos revisar la definicion porque esta en NOT NULL
2994+ 'invoice_number':ail_brw.invoice_id.reference,
2995+ 'rate_id':rate_id, # La consigo tambien pero desde el rate
2996+ 'partner_id':ail_brw.invoice_id.partner_id.id, #Warning Depende de si es cliente o proveedor
2997+ 'concept_id':ail_brw.concept_id.id,
2998+ 'partner_vat':vendor.vat[2:12], #Warning Depende si es cliente o proveedor
2999+ 'porcent_rete':rate_wh_perc, # La consigo tambien pero desde el rate
3000+ 'control_number':ail_brw.invoice_id.nro_ctrl,
3001+ 'sustract':rate_subtract,# La consigo tambien pero desde el rate
3002+ 'account_invoice_line_id':ail_brw.id,
3003+ 'concept_code':rate_code,# La consigo tambien pero desde el rate
3004+ }
3005+
3006 islr_wh_doc_invoices()
3007
3008
3009 class islr_wh_doc_line(osv.osv):
3010 _name = "islr.wh.doc.line"
3011- _description = 'Lines of Document Withholding Income'
3012+ _description = 'Lines of Document Income Withholding'
3013
3014 def _retention_rate(self, cr, uid, ids, name, args, context=None):
3015 res = {}
3016@@ -515,10 +686,12 @@
3017 _columns= {
3018 'name': fields.char('Description', size=64, help="Description of the voucher line"),
3019 'invoice_id': fields.many2one('account.invoice', 'Invoice', ondelete='set null', help="Invoice to withhold"),
3020- 'amount':fields.float('Amount', digits_compute= dp.get_precision('Withhold ISLR'), help="Withheld amount"),
3021+ 'amount':fields.float('Withheld Amount', digits_compute= dp.get_precision('Withhold ISLR'), help="Withheld amount"),
3022+ 'base_amount':fields.float('Base Amount', digits_compute= dp.get_precision('Withhold ISLR'), help="Base amount"),
3023+ 'subtract':fields.float('Subtract', digits_compute= dp.get_precision('Withhold ISLR'), help="Subtract"),
3024 'islr_wh_doc_id': fields.many2one('islr.wh.doc','Withhold Document', ondelete='cascade', help="Document Retention income tax generated from this bill"),
3025- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept', help="Withhold concept associated with this rate"),
3026- 'retencion_islr':fields.float('Percentage', digits_compute= dp.get_precision('Withhold ISLR'), help="Withholding percentage"),
3027+ 'concept_id': fields.many2one('islr.wh.concept','Withholding Concept', help="Withholding concept associated with this rate"),
3028+ 'retencion_islr':fields.float('Withholding Rate', digits_compute= dp.get_precision('Withhold ISLR'), help="Withholding Rate"),
3029 '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')),
3030 'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, help="Accounting voucher"),
3031 'islr_rates_id': fields.many2one('islr.rates','Rates', help="Withhold rates"),
3032
3033=== modified file 'l10n_ve_withholding_islr/model/islr_xml_wh.py'
3034--- l10n_ve_withholding_islr/model/islr_xml_wh.py 2012-12-09 23:55:45 +0000
3035+++ l10n_ve_withholding_islr/model/islr_xml_wh.py 2013-01-14 19:15:27 +0000
3036@@ -57,7 +57,7 @@
3037 return res
3038
3039 _columns = {
3040- 'name':fields.char('Description',128, required=True, select=True, help = "Description about statement of withholding income"),
3041+ 'name':fields.char('Description',128, required=True, select=True, help = "Description about statement of income withholding"),
3042 'company_id': fields.many2one('res.company', 'Company', required=True, help="Company"),
3043 'state': fields.selection([
3044 ('draft','Draft'),
3045@@ -66,7 +66,7 @@
3046 ('cancel','Cancelled')
3047 ],'State', readonly=True, help="Voucher state"),
3048 'period_id':fields.many2one('account.period','Period',required=True, help="Period when the accounts entries were done"),
3049- '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"),
3050+ '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"),
3051 '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"),
3052 'xml_ids':fields.one2many('islr.xml.wh.line','islr_xml_wh_doc','XML Document Lines', readonly=True ,states={'draft':[('readonly',False)]}),
3053 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),
3054@@ -79,7 +79,7 @@
3055 'user_id': lambda s, cr, u, c: u,
3056
3057 'period_id': lambda self,cr,uid,context: self.period_return(cr,uid,context),
3058- 'name':lambda self,cr,uid,context : 'Withholding Income '+time.strftime('%m/%Y')
3059+ 'name':lambda self,cr,uid,context : 'Income Withholding '+time.strftime('%m/%Y')
3060 }
3061
3062 def period_return(self,cr,uid,context=None):
3063@@ -193,17 +193,17 @@
3064 _description = 'Generate XML Lines'
3065
3066 _columns = {
3067- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Withhold concept associated with this rate",required=True, ondelete='cascade'),
3068- 'period_id':fields.many2one('account.period','Period',required=False, help="Period when the accounts entries were done"),
3069+ 'concept_id': fields.many2one('islr.wh.concept','Withholding Concept',help="Withholding concept associated with this rate",required=True, ondelete='cascade'),
3070+ 'period_id':fields.many2one('account.period','Period',required=False, help="Period when the journal entries were done"),
3071 'partner_vat': fields.char('VAT', size=10, required=True, help="Partner VAT"),
3072 'invoice_number': fields.char('Invoice Number',size=10,required=True, help="Number of invoice"),
3073 'control_number': fields.char('Control Number',size=8,required=True, help="Reference"),
3074 'concept_code': fields.char('Concept Code', size=10, required=True, help="Concept code"),
3075- 'base': fields.float('Without Tax Amount', required=True, help="Taxable", digits_compute= dp.get_precision('Withhold ISLR')),
3076- 'porcent_rete': fields.float('% Withhold', required=True, help="Percentage of Withhold", digits_compute= dp.get_precision('Withhold ISLR')),
3077+ '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')),
3078+ 'porcent_rete': fields.float('Withholding Rate', required=True, help="Withholding Rate", digits_compute= dp.get_precision('Withhold ISLR')),
3079 'wh':fields.float('Withheld Amount',required=True, help="Withheld amount to partner", digits_compute= dp.get_precision('Withhold ISLR')),
3080 'rate_id':fields.many2one('islr.rates', 'Person Type',domain="[('concept_id','=',concept_id)]",required=True, help="Person type"),
3081- 'islr_wh_doc_line_id':fields.many2one('islr.wh.doc.line','Withholding Income Document', help="Withhold income document"),
3082+ 'islr_wh_doc_line_id':fields.many2one('islr.wh.doc.line','Income Withholding Document', help="Income Withholding Document"),
3083 'account_invoice_line_id':fields.many2one('account.invoice.line','Invoice Line', help="Invoice line to Withhold"),
3084 'account_invoice_id':fields.many2one('account.invoice','Invoice', help="Invoice to Withhold"),
3085 'islr_xml_wh_doc': fields.many2one('islr.xml.wh.doc','ISLR XML Document', help="Income tax XML Doc"),
3086
3087=== modified file 'l10n_ve_withholding_islr/model/partner.py'
3088--- l10n_ve_withholding_islr/model/partner.py 2012-12-09 23:55:45 +0000
3089+++ l10n_ve_withholding_islr/model/partner.py 2013-01-14 19:15:27 +0000
3090@@ -42,6 +42,9 @@
3091 'islr_exempt': fields.boolean('Is it exempt from income withholding?'),
3092 }
3093
3094+ _defaults = {
3095+ 'islr_withholding_agent': lambda *a: True,
3096+ }
3097 res_partner()
3098
3099
3100
3101=== modified file 'l10n_ve_withholding_islr/model/product.py'
3102--- l10n_ve_withholding_islr/model/product.py 2012-12-09 23:55:45 +0000
3103+++ l10n_ve_withholding_islr/model/product.py 2013-01-14 19:15:27 +0000
3104@@ -37,7 +37,7 @@
3105 _inherit = "product.template"
3106
3107 _columns = {
3108- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Concept Withholding Income to apply to the service", required=False),
3109+ 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Concept Income Withholding to apply to the service", required=False),
3110 }
3111
3112 product_template()
3113@@ -59,7 +59,7 @@
3114 if concept_id:
3115 concept_id = concept_obj.search(cr, uid, [('name','ilike','NO APLICA RETENCION')])[0]
3116 else:
3117- raise osv.except_osv(_('Invalid action !'),_("Must create the concept of withholding income"))
3118+ raise osv.except_osv(_('Invalid action !'),_("Must create the concept of income withholding"))
3119
3120 return {'value' : {'concept_id':concept_id or False}}
3121
3122
3123=== modified file 'l10n_ve_withholding_islr/report/islr_wh_report.xml'
3124--- l10n_ve_withholding_islr/report/islr_wh_report.xml 2012-12-19 18:17:09 +0000
3125+++ l10n_ve_withholding_islr/report/islr_wh_report.xml 2013-01-14 19:15:27 +0000
3126@@ -6,7 +6,7 @@
3127 model="islr.wh.doc"
3128 name="islr.wh.doc"
3129 rml="addons/l10n_ve_withholding_islr/report/wh_islr_report.rml"
3130- string="Voucher Withholding Income"
3131+ string="Voucher Income Withholding"
3132 auto="False"
3133 header="False"
3134 menu="False"
3135@@ -18,7 +18,7 @@
3136 model="islr.xml.wh.doc"
3137 name="list.wh.islr"
3138 rml="addons/l10n_ve_withholding_islr/report/list_wh_islr_report.rml"
3139- string="Withholding Income"
3140+ string="Income Withholding"
3141 auto = "True"
3142 header="False"/>
3143
3144
3145=== modified file 'l10n_ve_withholding_islr/view/installer.xml'
3146--- l10n_ve_withholding_islr/view/installer.xml 2012-12-12 01:44:29 +0000
3147+++ l10n_ve_withholding_islr/view/installer.xml 2013-01-14 19:15:27 +0000
3148@@ -4,18 +4,17 @@
3149 <record id="wh_islr_config_view" model="ir.ui.view">
3150 <field name="name">Configure your ISLR Withholdings</field>
3151 <field name="model">wh.islr.config</field>
3152- <field name="type">form</field>
3153 <field name="inherit_id" ref="base.res_config_view_base"/>
3154 <field name="arch" type="xml">
3155 <data>
3156 <form position="attributes">
3157- <attribute name="string">Withholding income Configuration</attribute>
3158+ <attribute name="string">Income withholding Configuration</attribute>
3159 </form>
3160
3161 <xpath expr='//group[@string="res_config_contents"]' position='before'>
3162 <group colspan="4" col="8">
3163 <group colspan="1" width="220">
3164- <label align="0.0" string="Configure your company's withholding income" width="200" colspan="2"/>
3165+ <label align="0.0" string="Configure your company's income withholding" width="200" colspan="2"/>
3166 </group>
3167 <separator orientation="vertical" colspan="1" rowspan="15"/>
3168 <group colspan="6">
3169
3170=== modified file 'l10n_ve_withholding_islr/view/invoice_view.xml'
3171--- l10n_ve_withholding_islr/view/invoice_view.xml 2012-12-14 19:49:40 +0000
3172+++ l10n_ve_withholding_islr/view/invoice_view.xml 2013-01-14 19:15:27 +0000
3173@@ -11,7 +11,6 @@
3174 <record id="account_invoice_wh_islr_customer" model="ir.ui.view">
3175 <field name="name">account.invoice.wh.islr.customer</field>
3176 <field name="model">account.invoice</field>
3177- <field name="type">form</field>
3178 <field name="inherit_id" ref="l10n_ve_withholding.wh_inv_customer"/>
3179 <field name="arch" type="xml">
3180 <xpath expr="//separator[@string='vsep']" position="after">
3181@@ -31,7 +30,6 @@
3182 <record id="account_invoice_wh_islr_supplier" model="ir.ui.view">
3183 <field name="name">account.invoice.wh.islr.supplier</field>
3184 <field name="model">account.invoice</field>
3185- <field name="type">form</field>
3186 <field name="inherit_id" ref="l10n_ve_withholding.wh_inv_supplier"/>
3187 <field name="arch" type="xml">
3188 <xpath expr="//separator[@string='vsep']" position="after">
3189@@ -51,7 +49,6 @@
3190 <record model="ir.ui.view" id="view_account_invoice_form_concept_islr">
3191 <field name="name">account_invoice_concept_islr</field>
3192 <field name="model">account.invoice</field>
3193- <field name="type">form</field>
3194 <field name="inherit_id" ref="account.invoice_supplier_form"/>
3195 <field name="arch" type="xml">
3196 <xpath expr="//field[@name='quantity']" position="before">
3197@@ -60,10 +57,20 @@
3198 </field>
3199 </record>
3200
3201+ <record model="ir.ui.view" id="view_account_invoice_form_concept_islr_customer">
3202+ <field name="name">account.invoice.concept.islr.customer</field>
3203+ <field name="model">account.invoice</field>
3204+ <field name="inherit_id" ref="account.invoice_form"/>
3205+ <field name="arch" type="xml">
3206+ <xpath expr="//field[@name='quantity']" position="before">
3207+ <field name="concept_id" required="1"/>
3208+ </xpath>
3209+ </field>
3210+ </record>
3211+
3212 <record model="ir.ui.view" id="view_invoice_line_form_islr">
3213 <field name="name">account_invoice_line_concept_islr</field>
3214 <field name="model">account.invoice.line</field>
3215- <field name="type">form</field>
3216 <field name="inherit_id" ref="account.view_invoice_line_form"/>
3217 <field name="arch" type="xml">
3218 <xpath expr="//field[@name='product_id']" position="before">
3219@@ -75,7 +82,6 @@
3220 <record model="ir.ui.view" id="view_invoice_line_tree_islr">
3221 <field name="name">account_invoice_line_tree_concept_islr</field>
3222 <field name="model">account.invoice.line</field>
3223- <field name="type">tree</field>
3224 <field name="inherit_id" ref="account.view_invoice_line_tree"/>
3225 <field name="arch" type="xml">
3226 <xpath expr="//field[@name='name']" position="after">
3227@@ -86,9 +92,3 @@
3228
3229 </data>
3230 </openerp>
3231-
3232-
3233-
3234-
3235-
3236-
3237
3238=== modified file 'l10n_ve_withholding_islr/view/islr_wh_concept_view.xml'
3239--- l10n_ve_withholding_islr/view/islr_wh_concept_view.xml 2012-12-17 19:11:02 +0000
3240+++ l10n_ve_withholding_islr/view/islr_wh_concept_view.xml 2013-01-14 19:15:27 +0000
3241@@ -9,12 +9,11 @@
3242 <record id="view_wh_concept_filter" model="ir.ui.view">
3243 <field name="name">islr.wh.concept.search</field>
3244 <field name="model">islr.wh.concept</field>
3245- <field name="type">search</field>
3246 <field name="arch" type="xml">
3247- <search string="Search Concept of Withholding Income">
3248+ <search string="Search Concept of Income Withholding">
3249 <group col="10" colspan="4">
3250 <filter name="withholdable" string="Withhold" domain="[('withholdable','=','True')]" help="Concept withholding withheld"/>
3251- <filter domain="[('user_id','=',uid)]" help="My Withholding Income" separator="1"/>
3252+ <filter domain="[('user_id','=',uid)]" help="My Income Withholding" separator="1"/>
3253 </group>
3254 </search>
3255 </field>
3256@@ -23,7 +22,6 @@
3257 <record id="view_wh_islr_rate_form" model="ir.ui.view">
3258 <field name="name">tasas_form</field>
3259 <field name="model">islr.rates</field>
3260- <field name="type">form</field>
3261 <field name="arch" type="xml">
3262 <form string="Rates">
3263 <field name="name" colspan="4"/>
3264@@ -43,7 +41,6 @@
3265 <record id="view_wh_islr_rate_tree" model="ir.ui.view">
3266 <field name="name">tasas_tree</field>
3267 <field name="model">islr.rates</field>
3268- <field name="type">tree</field>
3269 <field name="arch" type="xml">
3270 <tree string="Rates">
3271 <field name="name"/>
3272@@ -61,9 +58,8 @@
3273 <record id="view_wh_concept_islr_tree" model="ir.ui.view">
3274 <field name="name">islr.wh.concept_tree</field>
3275 <field name="model">islr.wh.concept</field>
3276- <field name="type">tree</field>
3277 <field name="arch" type="xml">
3278- <tree string="Concept of Withholding Income">
3279+ <tree string="Concept of Income Withholding">
3280 <field name="name"/>
3281 <field name="withholdable"/>
3282 </tree>
3283@@ -73,9 +69,8 @@
3284 <record id="view_wh_concept_islr_form" model="ir.ui.view">
3285 <field name="name">islr.wh.concept_form</field>
3286 <field name="model">islr.wh.concept</field>
3287- <field name="type">form</field>
3288 <field name="arch" type="xml">
3289- <form string="Concept of Withholding Income">
3290+ <form string="Concept of Income Withholding">
3291 <group colspan="4" col="4">
3292 <field name="name"/>
3293 <field name="withholdable"/>
3294@@ -92,13 +87,13 @@
3295 </record>
3296
3297 <record model="ir.actions.act_window" id="action_wh_islr_concept">
3298- <field name="name">Concept of Withholding Income</field>
3299+ <field name="name">Concept of Income Withholding</field>
3300 <field name="res_model">islr.wh.concept</field>
3301 <field name="type">ir.actions.act_window</field>
3302 <field name="view_type">form</field>
3303 <field name="view_mode">tree,form</field>
3304 <field name="search_view_id" ref="view_wh_concept_filter"/>
3305- <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>
3306+ <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>
3307 </record>
3308
3309 <record model="ir.actions.act_window.view" id="action_wh_islr_concept_tree">
3310@@ -114,7 +109,7 @@
3311 <field name="act_window_id" ref="action_wh_islr_concept"/>
3312 </record>
3313
3314- <menuitem name="Concept of Withholding Income"
3315+ <menuitem name="Concept of Income Withholding"
3316 id="menu_action_concept_retention"
3317 parent="menu_wh_configuration_islr"
3318 action="action_wh_islr_concept"/>
3319
3320=== modified file 'l10n_ve_withholding_islr/view/islr_wh_doc_view.xml'
3321--- l10n_ve_withholding_islr/view/islr_wh_doc_view.xml 2012-12-18 13:23:28 +0000
3322+++ l10n_ve_withholding_islr/view/islr_wh_doc_view.xml 2013-01-14 19:15:27 +0000
3323@@ -8,19 +8,32 @@
3324 =====================================================
3325 -->
3326
3327+ <record id="view_islr_wh_doc_invoices_tree_" model="ir.ui.view">
3328+ <field name="name">islr.wh.doc.invoices_tree</field>
3329+ <field name="model">islr.wh.doc.invoices</field>
3330+ <field name="arch" type="xml">
3331+ <tree string="Withheld Invoices">
3332+ <field name="invoice_id"/>
3333+ <field name="islr_xml_id"/>
3334+ <field name="amount_islr_ret"/>
3335+ <field name="base_ret"/>
3336+ </tree>
3337+ </field>
3338+ </record>
3339+
3340 <record id="view_islr_wh_doc_invoices_form_" model="ir.ui.view">
3341 <field name="name">islr.wh.doc.invoices_form</field>
3342 <field name="model">islr.wh.doc.invoices</field>
3343- <field name="type">form</field>
3344 <field name="arch" type="xml">
3345 <form string="Invoices">
3346 <field
3347 name="invoice_id"
3348- domain="[('partner_id','=',parent.partner_id),('islr_wh_doc_id', '=', False),('state', '=', 'open'),('invoice_line.concept_id.withholdable', '=', True)]"
3349+ domain="[('partner_id','=',parent.partner_id),('islr_wh_doc_id', '=', False),('state', '=', 'open')]"
3350 colspan='6'/>
3351 <newline/>
3352 <field name="islr_xml_id" nolabel="1" colspan='4'>
3353- <tree string="Detail of the Concept of Withholding Income">
3354+ <tree string="Detail of the Concept of Income Withholding">
3355+ <field name="concept_code"/>
3356 <field name="rate_id"/>
3357 <field name="wh"/>
3358 <field name="porcent_rete"/>
3359@@ -43,15 +56,14 @@
3360 <record id="view_wh_islr_filter_customer" model="ir.ui.view">
3361 <field name="name">islr.wh.doc.search</field>
3362 <field name="model">islr.wh.doc</field>
3363- <field name="type">search</field>
3364 <field name="arch" type="xml">
3365- <search string="Search Withholding Income">
3366+ <search string="Search Income Withholding">
3367 <group col="10" colspan="4">
3368- <filter name="to_process" string="To Process" domain="[('state','=','to_process')]" help="To Process Withholding Income"/>
3369- <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Withholding Income"/>
3370- <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Withholding Income"/>
3371- <filter name="done" string="Done" domain="[('state','=','done')]" help="Done Withholding Income"/>
3372- <filter name="cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Withholding Income"/>
3373+ <filter name="to_process" string="To Process" domain="[('state','=','to_process')]" help="To Process Income Withholding"/>
3374+ <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Income Withholding"/>
3375+ <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Income Withholding"/>
3376+ <filter name="done" string="Done" domain="[('state','=','done')]" help="Done Income Withholding"/>
3377+ <filter name="cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Income Withholding"/>
3378 </group>
3379 <group expand="1" string="Group By...">
3380 <filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
3381@@ -67,9 +79,8 @@
3382 <record id="view_islr_line_tree" model="ir.ui.view">
3383 <field name="name">islr.wh.doc_line_tree</field>
3384 <field name="model">islr.wh.doc.line</field>
3385- <field name="type">tree</field>
3386 <field name="arch" type="xml">
3387- <tree string="Lines Withholding Income" editable="bottom" >
3388+ <tree string="Lines Income Withholding" editable="bottom" >
3389 <field name="name"/>
3390 <field name="concept_id"/>
3391 <field name="retencion_islr"/>
3392@@ -82,14 +93,13 @@
3393 <record id="view_islr_line_form" model="ir.ui.view">
3394 <field name="name">islr.wh.doc.line_form</field>
3395 <field name="model">islr.wh.doc.line</field>
3396- <field name="type">form</field>
3397 <field name="arch" type="xml">
3398- <form string="Lines Withholding Income">
3399+ <form string="Lines Income Withholding">
3400 <field name="concept_id" colspan='6'/>
3401 <field name="move_id" colspan='6'/>
3402 <newline/>
3403 <field name="xml_ids" nolabel="1" colspan='4'>
3404- <tree string="Detail of the Concept of Withholding Income">
3405+ <tree string="Detail of the Concept of Income Withholding">
3406 <field name="rate_id"/>
3407 <field name="wh"/>
3408 <field name="porcent_rete"/>
3409@@ -103,9 +113,8 @@
3410 <record id="view_islr_tree_customers" model="ir.ui.view">
3411 <field name="name">islr.wh.doc_tree_customers</field>
3412 <field name="model">islr.wh.doc</field>
3413- <field name="type">tree</field>
3414 <field name="arch" type="xml">
3415- <tree colors="blue:state=='draft'" string="Customer Withholding Income">
3416+ <tree colors="blue:state=='draft'" string="Customer Income Withholding">
3417 <field name="partner_id"/>
3418 <field name="date_ret"/>
3419 <field name="period_id"/>
3420@@ -122,9 +131,8 @@
3421 <record id="view_islr_form_customers" model="ir.ui.view">
3422 <field name="name">islr.wh.doc_form_customers</field>
3423 <field name="model">islr.wh.doc</field>
3424- <field name="type">form</field>
3425 <field name="arch" type="xml">
3426- <form string="Customer Withholding Income">
3427+ <form string="Customer Income Withholding">
3428 <group colspan="4" col="6">
3429 <field name="journal_id" domain="[('type','=','islr_sale')]"/>
3430 <field name="type"/>
3431@@ -138,10 +146,13 @@
3432 <field name="date_uid"/>
3433 </group>
3434 <notebook colspan="6">
3435+ <page string="Invoices to Be Withheld">
3436+ <field name='invoice_ids' nolabel='1'/>
3437+ </page>
3438 <page string="Invoices">
3439 <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"/>
3440 </page>
3441- <page string="Concept of Withholding Income">
3442+ <page string="Concept of Income Withholding">
3443 <field colspan="6" name="concept_ids" nolabel="1" widget="one2many_list"/>
3444 <group col="4" colspan="2">
3445 <field name="amount_total_ret"/>
3446@@ -154,10 +165,9 @@
3447 <group colspan="6" col="2">
3448 <group col="1">
3449 <field name="state"/>
3450- <button name="act_progress" string="Progress" states="draft" icon="gtk-go-forward"/>
3451- <button name="act_confirmed" string="Confirmed" states="progress" icon="gtk-go-forward"/>
3452+ <button name="act_confirm" string="Confirmed" states="draft" icon="gtk-go-forward"/>
3453 <button name="act_done" string="Done" states="confirmed" icon="gtk-execute" />
3454- <button name="%(voucher_report_withholding_islr)d" string="Print Withholding Income" states="done" colspan="3" type="action" icon="gtk-execute"/>
3455+ <button name="%(voucher_report_withholding_islr)d" string="Print Income Withholding" states="done" colspan="3" type="action" icon="gtk-execute"/>
3456 <button name="act_cancel" string="Cancel" states="draft,progress,confirmed,done" icon="gtk-cancel" />
3457 <button name="act_draft" colspan="2" string="Set to draft" states="cancel" icon="gtk-go-forward"/>
3458 </group>
3459@@ -175,14 +185,13 @@
3460 <record id="view_wh_islr_filter_suppliers" model="ir.ui.view">
3461 <field name="name">islr.wh.doc.search</field>
3462 <field name="model">islr.wh.doc</field>
3463- <field name="type">search</field>
3464 <field name="arch" type="xml">
3465- <search string="Search Withholding Income">
3466+ <search string="Search Income Withholding">
3467 <group col="10" colspan="4">
3468- <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Withholding Income"/>
3469- <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Withholding Income"/>
3470- <filter name="done" string="Done" domain="[('state','=','done')]" help="Done Withholding Income"/>
3471- <filter name="cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Withholding Income"/>
3472+ <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Income Withholding"/>
3473+ <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Income Withholding"/>
3474+ <filter name="done" string="Done" domain="[('state','=','done')]" help="Done Income Withholding"/>
3475+ <filter name="cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Income Withholding"/>
3476 </group>
3477 <newline/>
3478 <group expand="1" string="Group By...">
3479@@ -199,9 +208,8 @@
3480 <record id="view_wh_islr_tree_suppliers" model="ir.ui.view">
3481 <field name="name">islr.wh.doc_tree_suppliers</field>
3482 <field name="model">islr.wh.doc</field>
3483- <field name="type">tree</field>
3484 <field name="arch" type="xml">
3485- <tree colors="blue:state=='draft'" string="Supplier Withholding Income">
3486+ <tree colors="blue:state=='draft'" string="Supplier Income Withholding">
3487 <field name="partner_id"/>
3488 <field name="date_ret"/>
3489 <field name="period_id"/>
3490@@ -215,49 +223,11 @@
3491 </field>
3492 </record>
3493
3494- <record id="view_islr_line_tree" model="ir.ui.view">
3495- <field name="name">islr.wh.doc_line_tree2</field>
3496- <field name="model">islr.wh.doc.line</field>
3497- <field name="type">tree</field>
3498- <field name="arch" type="xml">
3499- <tree string="Lines Withholding Income" editable="bottom" >
3500- <field name="name"/>
3501- <field name="concept_id"/>
3502- <field name="retencion_islr"/>
3503- <field name="amount"/>
3504- <field name="move_id"/>
3505- </tree>
3506- </field>
3507- </record>
3508-
3509- <record id="view_islr_line_form" model="ir.ui.view">
3510- <field name="name">islr.wh.doc.line_form2</field>
3511- <field name="model">islr.wh.doc.line</field>
3512- <field name="type">form</field>
3513- <field name="arch" type="xml">
3514- <form string="Lines Withholding Income">
3515- <field name="concept_id" colspan='6'/>
3516- <field name="move_id" colspan='6'/>
3517- <newline/>
3518- <field name="xml_ids" nolabel="1" colspan='4'>
3519- <tree string="Detail of the Concept of Withholding Income">
3520- <field name="rate_id"/>
3521- <field name="wh"/>
3522- <field name="porcent_rete"/>
3523- <field name="base"/>
3524- </tree>
3525- </field>
3526- </form>
3527- </field>
3528- </record>
3529-
3530-
3531 <record id="view_wh_islr_form_suppliers" model="ir.ui.view">
3532 <field name="name">islr.wh.doc_form_suppliers</field>
3533 <field name="model">islr.wh.doc</field>
3534- <field name="type">form</field>
3535 <field name="arch" type="xml">
3536- <form string="Supplier Withholding Income">
3537+ <form string="Supplier Income Withholding">
3538 <group colspan="4" col="6">
3539 <field name="journal_id" domain="[('type','=','islr_purchase')]"/>
3540 <field name="type"/>
3541@@ -273,36 +243,60 @@
3542 <field name="invoice_id" />
3543 </group>
3544 <notebook colspan="6">
3545- <page string="Invoices">
3546+ <page string="Invoices to Be Withheld">
3547+ <field name="invoice_ids" nolabel='1'/>
3548+ </page>
3549+ <page string="Invoices" invisible='1'>
3550 <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"/>
3551 </page>
3552- <page string="Concept of Withholding Income">
3553- <field colspan="6" name="concept_ids" nolabel="1" widget="one2many_list"/>
3554- <group col="4" colspan="2">
3555- <field name="amount_total_ret"/>
3556- </group>
3557- </page>
3558- <page string="Invoices" invisible="1">
3559- <field name="invoice_ids" nolabel="1">
3560- <tree string="Invoices Withhelds">
3561+ <page string="Income Withholding Concepts">
3562+ <field colspan="6" name="concept_ids" nolabel="1">
3563+ <tree string="Income Withholding Concepts">
3564+ <field name="name" invisible='1'/>
3565 <field name="invoice_id"/>
3566- <field name="islr_xml_id"/>
3567- <field name="amount_islr_ret"/>
3568- <field name="base_ret"/>
3569+ <field name="concept_id"/>
3570+ <field name="base_amount"/>
3571+ <field name="retencion_islr"/>
3572+ <field name="subtract"/>
3573+ <field name="amount"/>
3574+ <field name="move_id"/>
3575 </tree>
3576+ <form string="Income Withholding Concepts">
3577+ <field name="invoice_id"/>
3578+ <newline/>
3579+ <field name="concept_id" colspan='6'/>
3580+ <newline/>
3581+ <field name="xml_ids" nolabel="1" colspan='4'>
3582+ <tree string="Detail of the Concept of Income Withholding">
3583+ <field name="concept_code"/>
3584+ <field name="rate_id"/>
3585+ <field name="wh"/>
3586+ <field name="porcent_rete"/>
3587+ <field name="base"/>
3588+ </tree>
3589+ </field>
3590+ <field name="base_amount"/>
3591+ <field name="subtract"/>
3592+ <field name="retencion_islr"/>
3593+ <field name="amount"/>
3594+ <field name="move_id" colspan='6'/>
3595+ </form>
3596 </field>
3597 </page>
3598 <page string="Other Information">
3599 <field name="company_id"/>
3600 </page>
3601 </notebook>
3602+ <group col="4" colspan="2">
3603+ <field name="amount_total_ret"/>
3604+ <button colspan="2" name="compute_amount_wh" string="Compute Income Withholding" type="object" icon="terp-stock_format-scientific"/>
3605+ </group>
3606 <group colspan="6" col="2">
3607 <group col="1">
3608 <field name="state"/>
3609- <button name="act_progress" string="Progress" states="draft" type="workflow" icon="gtk-go-forward"/>
3610- <button name="act_confirmed" string="Confirmed" states="progress" type="workflow" icon="gtk-go-forward"/>
3611+ <button name="act_confirm" string="Confirm" states="draft" type="workflow" icon="gtk-go-forward"/>
3612 <button name="act_done" string="Done" states="confirmed" type="workflow" icon="gtk-go-forward"/>
3613- <button name="%(voucher_report_withholding_islr)d" string="Print Withholding Income" colspan="3" states="done" type="action" icon="gtk-execute"/>
3614+ <button name="%(voucher_report_withholding_islr)d" string="Print Income Withholding" colspan="3" states="done" type="action" icon="gtk-execute"/>
3615 <button name="act_cancel" string="Cancel" states="draft,progress,confirmed,done" type="workflow" icon="gtk-go-forward"/>
3616 <button name="act_draft" colspan="2" string="Set to draft" states="cancel" type="workflow" icon="gtk-go-forward"/>
3617 </group>
3618@@ -313,7 +307,7 @@
3619
3620
3621 <record model="ir.actions.act_window" id="action_wh_islr_customer">
3622- <field name="name">Customer Withholding Income</field>
3623+ <field name="name">Customer Income Withholding</field>
3624 <field name="res_model">islr.wh.doc</field>
3625 <field name="type">ir.actions.act_window</field>
3626 <field name="view_type">form</field>
3627@@ -338,12 +332,12 @@
3628
3629 <menuitem
3630 id="menu_action_wh_islr_customer"
3631- name="Customer Withholding Income"
3632+ name="Customer Income Withholding"
3633 parent="account.menu_finance_receivables"
3634 action="action_wh_islr_customer"/>
3635
3636 <record model="ir.actions.act_window" id="action_wh_islr_supplier">
3637- <field name="name">Supplier Withholding Income</field>
3638+ <field name="name">Supplier Income Withholding</field>
3639 <field name="res_model">islr.wh.doc</field>
3640 <field name="type">ir.actions.act_window</field>
3641 <field name="view_type">form</field>
3642@@ -351,7 +345,7 @@
3643 <field name="domain">[('type','=','in_invoice')]</field>
3644 <field name="context">{'type':'in_invoice', 'search_default_draft': 1}</field>
3645 <field name="search_view_id" ref="view_wh_islr_filter_suppliers"/>
3646- <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>
3647+ <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>
3648
3649 </record>
3650 <record model="ir.actions.act_window.view" id="action_wh_islr_tree">
3651@@ -369,7 +363,7 @@
3652
3653 <menuitem
3654 id="menu_action_wh_islr_supplier"
3655- name="Supplier Withholding Income"
3656+ name="Supplier Income Withholding"
3657 parent="account.menu_finance_payables"
3658 action="action_wh_islr_supplier"/>
3659
3660
3661=== modified file 'l10n_ve_withholding_islr/view/islr_xml_wh.xml'
3662--- l10n_ve_withholding_islr/view/islr_xml_wh.xml 2012-12-17 23:45:56 +0000
3663+++ l10n_ve_withholding_islr/view/islr_xml_wh.xml 2013-01-14 19:15:27 +0000
3664@@ -11,7 +11,6 @@
3665 <record id="view_xml_islr_line_form" model="ir.ui.view">
3666 <field name="name">islr.xml.wh.line_form</field>
3667 <field name="model">islr.xml.wh.line</field>
3668- <field name="type">form</field>
3669 <field name="arch" type="xml">
3670 <form string="Export in XML data">
3671 <newline/>
3672@@ -22,7 +21,7 @@
3673 <field name="partner_vat"/>
3674 </group>
3675 <newline/>
3676- <separator string="Concept of Withholding Income" colspan="6"/>
3677+ <separator string="Concept of Income Withholding" colspan="6"/>
3678 <newline/>
3679 <group col="4" colspan="4">
3680 <field name="concept_id" colspan="4" />
3681@@ -54,7 +53,6 @@
3682 <record id="view_xml_islr_tree" model="ir.ui.view">
3683 <field name="name">islr.xml.wh.doc_tree</field>
3684 <field name="model">islr.xml.wh.doc</field>
3685- <field name="type">tree</field>
3686 <field name="arch" type="xml">
3687 <tree string="Lines Withholding for XML" >
3688 <field name="name"/>
3689@@ -67,7 +65,6 @@
3690 <record id="view_xml_islr_form" model="ir.ui.view">
3691 <field name="name">islr.xml.wh.doc_form</field>
3692 <field name="model">islr.xml.wh.doc</field>
3693- <field name="type">form</field>
3694 <field name="arch" type="xml">
3695 <form string="Lines Withholding for XML">
3696 <field name="name"/>
3697@@ -107,7 +104,6 @@
3698 <record id="view_generate_xml_filter" model="ir.ui.view">
3699 <field name="name">islr.xml.wh.doc.search</field>
3700 <field name="model">islr.xml.wh.doc</field>
3701- <field name="type">search</field>
3702 <field name="arch" type="xml">
3703 <search string="Search File XML">
3704 <group col="10" colspan="4">
3705@@ -118,7 +114,7 @@
3706 <separator orientation="vertical"/>
3707 <field name="company_id"/>
3708 <field name="user_id" select="1" widget="selection" string="Salesman">
3709- <filter domain="[('user_id','=',uid)]" help="My Withholding Income" icon="terp-personal" separator="1"/>
3710+ <filter domain="[('user_id','=',uid)]" help="My Income Withholding" icon="terp-personal" separator="1"/>
3711 </field>
3712 </group>
3713 <newline/>
3714
3715=== modified file 'l10n_ve_withholding_islr/view/partner_view.xml'
3716--- l10n_ve_withholding_islr/view/partner_view.xml 2012-10-02 18:30:33 +0000
3717+++ l10n_ve_withholding_islr/view/partner_view.xml 2013-01-14 19:15:27 +0000
3718@@ -11,7 +11,6 @@
3719 <record id="res_partner_wh_islr" model="ir.ui.view">
3720 <field name="name">res.partner.wh.islr</field>
3721 <field name="model">res.partner</field>
3722- <field name="type">form</field>
3723 <field name="inherit_id" ref="l10n_ve_withholding.wh_partner"/>
3724 <field name="arch" type="xml">
3725 <xpath expr="//separator[@string='vsep']" position="after">
3726
3727=== modified file 'l10n_ve_withholding_islr/view/product_view.xml'
3728--- l10n_ve_withholding_islr/view/product_view.xml 2012-11-07 21:33:58 +0000
3729+++ l10n_ve_withholding_islr/view/product_view.xml 2013-01-14 19:15:27 +0000
3730@@ -5,12 +5,11 @@
3731 <record model="ir.ui.view" id="view_product_product_islr">
3732 <field name="name">product.product.form.islr</field>
3733 <field name="model">product.product</field>
3734- <field name="type">form</field>
3735 <field name="inherit_id" ref="account.product_normal_form_view"/>
3736 <field name="arch" type="xml">
3737 <xpath expr="//group[@name='properties']" position="after">
3738 <newline/>
3739- <separator string="Concept of Withholding Income"/>
3740+ <separator string="Concept of Income Withholding"/>
3741 <newline/>
3742 <group col='6' colspan='6' >
3743 <field name="concept_id"/>
3744@@ -30,7 +29,6 @@
3745 <record id="product_normal_form_view_type" model="ir.ui.view">
3746 <field name="name">product.normal.form.type</field>
3747 <field name="model">product.product</field>
3748- <field name="type">form</field>
3749 <field name="inherit_id" ref="product.product_normal_form_view"/>
3750 <field name="arch" type="xml">
3751 <xpath expr="//field[@name='type']" position="replace">
3752
3753=== modified file 'l10n_ve_withholding_islr/view/wh_islr_view.xml'
3754--- l10n_ve_withholding_islr/view/wh_islr_view.xml 2011-10-25 20:33:16 +0000
3755+++ l10n_ve_withholding_islr/view/wh_islr_view.xml 2013-01-14 19:15:27 +0000
3756@@ -2,7 +2,7 @@
3757 <openerp>
3758 <data>
3759
3760- <menuitem id="menu_wh_configuration_islr" name="Withholding Income" parent="l10n_ve_withholding.menu_wh_configuration"/>
3761+ <menuitem id="menu_wh_configuration_islr" name="Income Withholding" parent="l10n_ve_withholding.menu_wh_configuration"/>
3762
3763 </data>
3764 </openerp>
3765
3766=== modified file 'l10n_ve_withholding_islr/workflow/account_workflow.xml'
3767--- l10n_ve_withholding_islr/workflow/account_workflow.xml 2012-12-18 13:37:25 +0000
3768+++ l10n_ve_withholding_islr/workflow/account_workflow.xml 2013-01-14 19:15:27 +0000
3769@@ -15,7 +15,7 @@
3770 <field name="name">Withholding Islr</field>
3771 <field name="kind">subflow</field>
3772 <field name="subflow_id" ref="wh_islr_order"/>
3773- <field name="action">action_ret_islr()</field>
3774+ <field name="action">_create_islr_wh_doc()</field>
3775 </record>
3776
3777 <record id="act_islr_router" model="workflow.activity">
3778@@ -39,8 +39,8 @@
3779 -->
3780 <record id="trans_wh_router_wh_islr" model="workflow.transition">
3781 <field name="act_from" ref="l10n_ve_withholding.act_wh_router"/>
3782- <field name="act_to" ref="act_islr_router"/>
3783- <field name="condition">check_invoice_type()</field>
3784+ <field name="act_to" ref="act_withold_islr"/>
3785+ <field name="condition">check_invoice_type() and check_withholdable_concept()</field>
3786 <field name="signal"></field>
3787 </record>
3788
3789
3790=== modified file 'l10n_ve_withholding_islr/workflow/islr_wh_workflow.xml'
3791--- l10n_ve_withholding_islr/workflow/islr_wh_workflow.xml 2012-05-04 14:44:55 +0000
3792+++ l10n_ve_withholding_islr/workflow/islr_wh_workflow.xml 2013-01-14 19:15:27 +0000
3793@@ -24,8 +24,7 @@
3794
3795 <record id="act_confirmed" model="workflow.activity">
3796 <field name="wkf_id" ref="wh_islr_order"/>
3797- <field name="action">action_number()
3798-write({'state':'confirmed'})</field>
3799+ <field name="action">action_confirm()</field>
3800 <field name="kind">function</field>
3801 <field name="name">confirmed</field>
3802 </record>
3803@@ -34,7 +33,8 @@
3804 <field name="wkf_id" ref="wh_islr_order"/>
3805 <field name="kind">function</field>
3806 <field name="name">done</field>
3807- <field name="action">action_move_create()
3808+ <field name="action">action_number()
3809+action_move_create()
3810 write({'state':'done'})</field>
3811 </record>
3812
3813@@ -63,7 +63,8 @@
3814 <record id="trans_draft_confirmed" model="workflow.transition">
3815 <field name="act_from" ref="act_draft"/>
3816 <field name="act_to" ref="act_confirmed"/>
3817- <field name="condition">validate(type,concept_ids,invoice_ids)</field>
3818+ <field name="condition">check_income_wh()</field>
3819+ <field name="signal">act_confirm</field>
3820 </record>
3821
3822 <record id="trans_draft_progress" model="workflow.transition">
3823@@ -82,7 +83,8 @@
3824 <record id="trans_progress_confirmed" model="workflow.transition">
3825 <field name="act_from" ref="act_progress"/>
3826 <field name="act_to" ref="act_confirmed"/>
3827- <field name="signal">act_confirmed</field>
3828+ <field name="condition">True</field>
3829+ <field name="signal"></field>
3830 </record>
3831
3832 <record id="trans_confirmed_cancel" model="workflow.transition">
3833
3834=== modified file 'l10n_ve_withholding_iva/model/__init__.py'
3835--- l10n_ve_withholding_iva/model/__init__.py 2012-11-07 21:33:58 +0000
3836+++ l10n_ve_withholding_iva/model/__init__.py 2013-01-14 19:15:27 +0000
3837@@ -29,6 +29,5 @@
3838 import generate_txt
3839 import report
3840 import installer
3841-import wizard
3842
3843 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3844
3845=== modified file 'l10n_ve_withholding_src/__init__.py'
3846--- l10n_ve_withholding_src/__init__.py 2012-02-20 20:11:16 +0000
3847+++ l10n_ve_withholding_src/__init__.py 2013-01-14 19:15:27 +0000
3848@@ -24,4 +24,6 @@
3849 ################################################################################
3850
3851 import model
3852+import wizard
3853 import report
3854+
3855
3856=== modified file 'l10n_ve_withholding_src/__openerp__.py'
3857--- l10n_ve_withholding_src/__openerp__.py 2012-08-22 22:56:20 +0000
3858+++ l10n_ve_withholding_src/__openerp__.py 2013-01-14 19:15:27 +0000
3859@@ -54,12 +54,15 @@
3860 "update_xml" : [
3861 'security/wh_src_security.xml',
3862 'security/ir.model.access.csv',
3863+ 'wizard/wizard_retention_view.xml',
3864 'view/wh_src_view.xml',
3865 'view/account_invoice_view.xml',
3866 'view/company_view.xml',
3867+ 'view/partner_view.xml',
3868 'workflow/l10n_ve_wh_src_wf.xml',
3869 'data/data.xml',
3870- 'wh_src_report.xml',
3871+ 'report/wh_src_report.xml',
3872+
3873 ],
3874 "active": False,
3875 "installable": True
3876
3877=== modified file 'l10n_ve_withholding_src/data/data.xml'
3878--- l10n_ve_withholding_src/data/data.xml 2012-09-11 00:38:30 +0000
3879+++ l10n_ve_withholding_src/data/data.xml 2013-01-14 19:15:27 +0000
3880@@ -2,17 +2,32 @@
3881 <openerp>
3882 <data noupdate="1">
3883
3884+ <!-- Sequence types for account.wh.src -->
3885 <record id="seq_type_account_wh_iva" model="ir.sequence.type">
3886 <field name="name">Withholding src costumer</field>
3887 <field name="code">wh.src.out</field>
3888 </record>
3889
3890 <record id="seq_type_account_wh_iva_purchase" model="ir.sequence.type">
3891- <field name="name">Withholding src supplier</field>
3892+ <field name="name">Withholding src supplier</field>
3893 <field name="code">wh.src.in</field>
3894 </record>
3895-
3896- <record id="seq_type_account_wh_src_supplier" model="ir.sequence">
3897+
3898+ <record id="seq_type_account_wh_src_supplier" model="ir.sequence.type">
3899+ <field name="name">Withholding local.supplier</field>
3900+ <field name="code">account.wh.src.in_invoice</field>
3901+ </record>
3902+
3903+ <!-- Sequences for account.wh.src -->
3904+ <record id="seq_account_retencion_src_customer" model="ir.sequence">
3905+ <field name="name">Withholding local customer</field>
3906+ <field name="code">account.wh.src.in_invoice</field>
3907+ <field name="prefix">RET-SRC</field>
3908+ <field name="padding">8</field>
3909+ <field name="number_increment">1</field>
3910+ </record>
3911+
3912+ <record id="seq_account_wh_src_supplier" model="ir.sequence">
3913 <field name="name">Withholding src</field>
3914 <field name="code">wh.src.out</field>
3915 <field name="prefix">src:</field>
3916@@ -20,48 +35,28 @@
3917 <field name="number_increment">1</field>
3918 </record>
3919
3920- <record id="seq_account_retencion_src_customer" model="ir.sequence">
3921+ <record id="seq_account_retencion_src_purchase" model="ir.sequence">
3922 <field name="name">Withholding src purchase</field>
3923 <field name="code">wh.src.in</field>
3924 <field name="prefix">%(year)s-%(month)s-</field>
3925 <field name="padding">8</field>
3926 <field name="number_increment">1</field>
3927 </record>
3928+
3929+ <!-- Journals for account.wh.src -->
3930 <record id="withholding_scr_purchase_journal" model="account.journal">
3931 <field name="name">DIARIO DE SRC PARA PROVEEDORES</field>
3932 <field name="code">srcP</field>
3933 <field name="type">src_purchase</field>
3934- <field name="view_id" ref="account.account_journal_view"/>
3935- <field name="sequence_id" ref="seq_type_account_wh_src_supplier"/>
3936+ <field name="sequence_id" ref="seq_account_wh_src_supplier"/>
3937 </record>
3938
3939 <record id="withholding_src_sale_journal" model="account.journal">
3940 <field name="name">DIARIO DE SRC PARA CLIENTES</field>
3941 <field name="code">srcC</field>
3942 <field name="type">src_sale</field>
3943- <field name="view_id" ref="account.account_journal_view"/>
3944 <field name="sequence_id" ref="seq_account_retencion_src_customer"/>
3945 </record>
3946-
3947- <!-- Sequences type for account.wh.src -->
3948-
3949-
3950- <record id="seq_type_account_wh_src_supplier" model="ir.sequence.type">
3951- <field name="name">Withholding local.supplier</field>
3952- <field name="code">account.wh.src.in_invoice</field>
3953- </record>
3954-
3955- <!-- Sequences for account.wh.src -->
3956-
3957-
3958- <record id="seq_account_retencion_src_customer" model="ir.sequence">
3959- <field name="name">Withholding local customer</field>
3960- <field name="code">account.wh.src.in_invoice</field>
3961- <field name="prefix">RET-SRC</field>
3962- <field name="padding">8</field>
3963- <field name="number_increment">1</field>
3964- </record>
3965-
3966
3967 </data>
3968 </openerp>
3969
3970=== modified file 'l10n_ve_withholding_src/model/__init__.py'
3971--- l10n_ve_withholding_src/model/__init__.py 2012-01-27 05:37:46 +0000
3972+++ l10n_ve_withholding_src/model/__init__.py 2013-01-14 19:15:27 +0000
3973@@ -26,4 +26,5 @@
3974 import wh_src
3975 import invoice
3976 import res_company
3977+import partner
3978
3979
3980=== modified file 'l10n_ve_withholding_src/model/invoice.py'
3981--- l10n_ve_withholding_src/model/invoice.py 2012-01-27 05:37:46 +0000
3982+++ l10n_ve_withholding_src/model/invoice.py 2013-01-14 19:15:27 +0000
3983@@ -30,6 +30,23 @@
3984
3985 class account_invoice(osv.osv):
3986 _inherit = 'account.invoice'
3987+
3988+ def onchange_partner_id(self, cr, uid, ids, type, partner_id,\
3989+ date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
3990+
3991+ p = self.pool.get('res.partner').browse(cr, uid, partner_id)
3992+ c = self.pool.get('res.partner').browse(cr, uid, uid)
3993+ res = super(account_invoice,self).onchange_partner_id(cr, uid, ids, type, \
3994+ partner_id, date_invoice,payment_term,partner_bank_id,company_id)
3995+
3996+ if p.wh_src_agent and type in ('out_invoice') and not p.supplier:
3997+ res['value']['wh_src_rate'] = p.wh_src_rate
3998+ elif c.wh_src_agent and type in ('in_invoice') and p.supplier:
3999+ res['value']['wh_src_rate'] = c.wh_src_rate
4000+ else:
4001+ res['value']['wh_src_rate'] = 0
4002+
4003+ return res
4004
4005 def _retenida(self, cr, uid, ids, name, args, context):
4006 res = {}
4007@@ -66,6 +83,20 @@
4008 invoice_ids = self.pool.get('account.invoice').search(cr, uid, [('move_id','in',move.keys())], context=context)
4009 return invoice_ids
4010
4011+ def _check_retention(self, cr, uid, ids, context=None):
4012+ '''This method will check the retention value will be maximum 5%
4013+ '''
4014+ if context is None: context = {}
4015+
4016+ invoice_brw = self.browse(cr, uid,ids)
4017+
4018+ ret = invoice_brw[0].wh_src_rate
4019+
4020+ if ret and ret > 5:
4021+ return False
4022+
4023+ return True
4024+
4025 _columns = {
4026 'wh_src': fields.boolean('Social Responsibility Commitment Withheld'),
4027 'wh_src_rate': fields.float('SRC Wh rate', digits_compute= dp.get_precision('Withhold'), readonly=True, states={'draft':[('readonly',False)]}, help="Social Responsibility Commitment Withholding Rate"),
4028@@ -75,6 +106,10 @@
4029 'wh_src': False,
4030 }
4031
4032+ _constraints = [
4033+ (_check_retention, _("Error ! Maximum retention is 5%"), []),
4034+ ]
4035+
4036 def _get_move_lines(self, cr, uid, ids, to_wh, period_id,
4037 pay_journal_id, writeoff_acc_id,
4038 writeoff_period_id, writeoff_journal_id, date,
4039@@ -84,7 +119,7 @@
4040 pay_journal_id, writeoff_acc_id,
4041 writeoff_period_id, writeoff_journal_id, date,
4042 name, context=context)
4043- if context.get('src_wh',False):
4044+ if context.get('wh_src',False):
4045 invoice = self.browse(cr, uid, ids[0])
4046
4047 types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1}
4048
4049=== modified file 'l10n_ve_withholding_src/model/partner.py'
4050--- l10n_ve_withholding_src/model/partner.py 2012-01-26 22:29:50 +0000
4051+++ l10n_ve_withholding_src/model/partner.py 2013-01-14 19:15:27 +0000
4052@@ -31,14 +31,12 @@
4053
4054 class res_partner(osv.osv):
4055 _inherit = 'res.partner'
4056- #~ logger = netsvc.Logger()
4057- #~ _columns = {
4058- #~ 'wh_src_agent': fields.boolean('Wh. Agent', help="Indicate if the partner is a withholding vat agent"),
4059- #~ 'wh_src_rate': fields.float(string='Rate', digits_compute= dp.get_precision('Withhold'), help="Withholding vat rate"),
4060- #~ }
4061- #~ _defaults = {
4062- #~ 'wh_src_rate': lambda *a: 0,
4063- #~ }
4064-
4065-
4066+ logger = netsvc.Logger()
4067+ _columns = {
4068+ 'wh_src_agent': fields.boolean('Wh. Agent', help="Indicate if the partner is a withholding vat agent"),
4069+ 'wh_src_rate': fields.float(string='Rate', digits_compute= dp.get_precision('Withhold'), help="Withholding vat rate"),
4070+ }
4071+ _defaults = {
4072+ 'wh_src_rate': lambda *a: 0,
4073+ }
4074 res_partner()
4075
4076=== modified file 'l10n_ve_withholding_src/model/wh_src.py'
4077--- l10n_ve_withholding_src/model/wh_src.py 2012-09-26 22:10:42 +0000
4078+++ l10n_ve_withholding_src/model/wh_src.py 2013-01-14 19:15:27 +0000
4079@@ -51,6 +51,45 @@
4080 res.append((move.id, name))
4081 return res
4082
4083+ def _get_uid_wh_agent(self, cr, uid, context=None):
4084+ context = context or {}
4085+ user_wh_agent = self.pool.get('res.partner').browse(cr, uid, uid, context=context).wh_src_agent
4086+ return user_wh_agent
4087+
4088+ def _get_partner_agent(self, cr, uid, context=None):
4089+ context = context or {}
4090+
4091+ obj_partner = self.pool.get('res.partner')
4092+
4093+ if context.get('type') in ('out_invoice'):
4094+ partner_ids = obj_partner.search(cr, uid, [('wh_src_agent','=',True)])
4095+ partner_brw = self.pool.get('res.partner').browse(cr, uid, partner_ids, context=context)
4096+ else:
4097+ partner_ids = obj_partner.search(cr, uid, [])
4098+ partner_brw = self.pool.get('res.partner').browse(cr, uid, partner_ids, context=context)
4099+
4100+ l = map(lambda x: x.id, partner_brw)
4101+
4102+ return l
4103+
4104+ def default_get(self, cr, uid, fields, context=None):
4105+ context = context or {}
4106+ res = super(account_wh_src, self).default_get(cr, uid, fields, context=context)
4107+ res.update({'uid_wh_agent': self._get_uid_wh_agent(cr,uid,context=context) })
4108+ res.update({'partner_list': self._get_partner_agent(cr,uid,context=context) })
4109+
4110+ return res
4111+
4112+ def _get_p_agent(self, cr, uid, ids, field_name, args, context=None):
4113+ context = context or {}
4114+ res= {}.fromkeys(ids,self._get_partner_agent(cr,uid,context=context))
4115+ return res
4116+
4117+ def _get_wh_agent(self, cr, uid, ids, field_name, args, context=None):
4118+ context = context or {}
4119+ res= {}.fromkeys(ids,self._get_uid_wh_agent(cr,uid,context=context))
4120+ return res
4121+
4122 _name = "account.wh.src"
4123 _description = "Social Responsibility Commitment Withholding"
4124 _columns = {
4125@@ -77,7 +116,9 @@
4126 'company_id': fields.many2one('res.company', 'Company', required=True, help="Company"),
4127 'line_ids': fields.one2many('account.wh.src.line', 'wh_id', 'Local withholding lines', readonly=True, states={'draft':[('readonly',False)]}, help="Facturas a la cual se realizarán las retenciones"),
4128 'wh_amount': fields.float('Amount', required=False, digits_compute= dp.get_precision('Withhold'), help="Amount withheld"),
4129-
4130+
4131+ 'uid_wh_agent': fields.function(_get_wh_agent, type='boolean', string="uid_wh_agent", store=False),
4132+ 'partner_list' : fields.function(_get_p_agent, type='char', string='Lista', store=False, method=False),
4133
4134 }
4135
4136@@ -208,7 +249,7 @@
4137 inv_obj = self.pool.get('account.invoice')
4138 if context is None: context = {}
4139
4140- context.update({'src_wh':True})
4141+ context.update({'wh_src':True})
4142
4143 ret = self.browse(cr, uid, ids[0], context)
4144
4145
4146=== renamed file 'l10n_ve_withholding_src/wh_src_report.xml' => 'l10n_ve_withholding_src/report/wh_src_report.xml'
4147=== modified file 'l10n_ve_withholding_src/security/ir.model.access.csv'
4148--- l10n_ve_withholding_src/security/ir.model.access.csv 2012-04-03 19:54:22 +0000
4149+++ l10n_ve_withholding_src/security/ir.model.access.csv 2013-01-14 19:15:27 +0000
4150@@ -3,3 +3,4 @@
4151 "access_account_wh_src_line_user","account.wh.src.line.user","model_account_wh_src_line","l10n_ve_withholding_src.group_account_wh_src_user",1,0,0,0
4152 "access_account_wh_src_manager","account.wh.src.manager","model_account_wh_src","l10n_ve_withholding_src.group_account_wh_src_manager",1,1,1,1
4153 "access_account_wh_src_line_manager","account.wh.src.line.manager","model_account_wh_src_line","l10n_ve_withholding_src.group_account_wh_src_manager",1,1,1,1
4154+"access_wiz_retention","wiz.retention.manager","model_wiz_retention","l10n_ve_withholding_src.group_account_wh_src_manager",1,1,1,1
4155
4156=== modified file 'l10n_ve_withholding_src/view/account_invoice_view.xml'
4157--- l10n_ve_withholding_src/view/account_invoice_view.xml 2012-11-07 21:33:58 +0000
4158+++ l10n_ve_withholding_src/view/account_invoice_view.xml 2013-01-14 19:15:27 +0000
4159@@ -8,14 +8,20 @@
4160 <field name="type">form</field>
4161 <field name="inherit_id" ref="l10n_ve_withholding.wh_inv_customer"/>
4162 <field name="arch" type="xml">
4163- <xpath expr="//field[@name='currency_id']" position="after">
4164+ <xpath expr="//separator[@string='rsep']" position="after">
4165 <newline/>
4166 <group col="6" colspan="4">
4167 <field name="wh_src_rate"/>
4168 <field name="wh_src_id"/>
4169 </group>
4170+ <button name="%(action_wiz_retention)d"
4171+ type='action'
4172+ string='Change retention'
4173+ icon="gtk-execute"
4174+ colspan="6"
4175+ attrs="{'invisible': ['|',('state','=', 'draft'),('state','=', 'paid')]}"/>
4176 </xpath>
4177- <xpath expr="//field[@name='account_id']" position='attributes'>
4178+ <xpath expr="//separator[@string='rsep']" position='attributes'>
4179 <attribute name="string">SRC Withholdings</attribute>
4180 </xpath>
4181 </field>
4182@@ -33,7 +39,14 @@
4183 <field name="wh_src_rate"/>
4184 <field name="wh_src_id"/>
4185 </group>
4186+ <button name="%(action_wiz_retention)d"
4187+ type='action'
4188+ string='Change retention'
4189+ icon="gtk-execute"
4190+ colspan="6"
4191+ attrs="{'invisible': ['|',('state','=', 'draft'),('state','=', 'paid')]}"/>
4192 </xpath>
4193+
4194 <xpath expr='//separator[@string="rsep"]' position='attributes'>
4195 <attribute name="string">SRC Withholdings</attribute>
4196 </xpath>
4197
4198=== modified file 'l10n_ve_withholding_src/view/company_view.xml'
4199--- l10n_ve_withholding_src/view/company_view.xml 2012-01-27 05:37:46 +0000
4200+++ l10n_ve_withholding_src/view/company_view.xml 2013-01-14 19:15:27 +0000
4201@@ -8,12 +8,12 @@
4202 <field name="type">form</field>
4203 <field name="inherit_id" ref="base.view_company_form"/>
4204 <field name="arch" type="xml">
4205- <page string="Configuration" position="inside">
4206- <separator string="Social Responsability Commitment Accounts" colspan="4"/>
4207+ <xpath expr='//page[@string="Configuration"]/group/group[@name="account_grp"]' position="after">
4208+ <separator string="Social Responsability Commitment Accounts" colspan="2"/>
4209 <field name="wh_src_collected_account_id" required='1'/>
4210 <field name="wh_src_paid_account_id" required='1'/>
4211 <newline/>
4212- </page>
4213+ </xpath>
4214 </field>
4215 </record>
4216
4217
4218=== modified file 'l10n_ve_withholding_src/view/partner_view.xml'
4219--- l10n_ve_withholding_src/view/partner_view.xml 2012-01-26 04:52:17 +0000
4220+++ l10n_ve_withholding_src/view/partner_view.xml 2013-01-14 19:15:27 +0000
4221@@ -1,33 +1,25 @@
4222 <?xml version="1.0" encoding="utf-8"?>
4223 <openerp>
4224 <data>
4225-
4226-
4227-
4228- <!--
4229+<!--
4230 =====================================================
4231 Partners Extension
4232 =====================================================
4233- -->
4234-
4235- <record id="partner_ext_munici_view_form_loc_ve" model="ir.ui.view">
4236- <field name="name">partner_extended_munici.partner.form.view.loc_ve</field>
4237+-->
4238+ <record id="partner_wh_src" model="ir.ui.view">
4239+ <field name="name">res.partner.form.wh.src</field>
4240 <field name="model">res.partner</field>
4241- <field name="type">form</field>
4242 <field name="inherit_id" ref="l10n_ve_withholding.wh_partner"/>
4243 <field name="arch" type="xml">
4244- <page string="Withholdings" position="inside">
4245- <notebook>
4246- <page string="Local Withholdings">
4247- <group col="4" colspan="2">
4248- <field name="property_wh_munici_payable"/>
4249- <field name="property_wh_munici_receivable"/>
4250- </group>
4251- </page>
4252- </notebook>
4253- </page>
4254+ <xpath expr="//page[@string='Withholdings']" position="after">
4255+ <page string="Local Withholdings">
4256+ <group col="4" colspan="2">
4257+ <field name="wh_src_agent"/>
4258+ <field name="wh_src_rate"/>
4259+ </group>
4260+ </page>
4261+ </xpath>
4262 </field>
4263 </record>
4264-
4265 </data>
4266 </openerp>
4267
4268=== modified file 'l10n_ve_withholding_src/view/wh_src_view.xml'
4269--- l10n_ve_withholding_src/view/wh_src_view.xml 2012-01-30 20:48:44 +0000
4270+++ l10n_ve_withholding_src/view/wh_src_view.xml 2013-01-14 19:15:27 +0000
4271@@ -57,10 +57,10 @@
4272 <field name="arch" type="xml">
4273 <search string="Search Withholding Local">
4274 <group col="10" colspan="4">
4275- <filter name="wh_src_draft" icon="terp-gtk-media-pause" string="Draft" domain="[('state','=','draft')]" help="Draft Withholding Local"/>
4276- <filter name="wh_src_confirmed" icon="terp-gtk-media-pause" string="Confirmed" domain="[('state','=','confirmed')]" help="Draft Withholding Local"/>
4277- <filter name="wh_src_done" icon="terp-check" string="Done" domain="[('state','=','done')]" help="Done Withholding Local"/>
4278- <filter name="wh_src_cancel" icon="terp-dialog-close" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Withholding Local"/>
4279+ <filter name="wh_src_draft" string="Draft" domain="[('state','=','draft')]" help="Draft Withholding Local"/>
4280+ <filter name="wh_src_confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Draft Withholding Local"/>
4281+ <filter name="wh_src_done" string="Done" domain="[('state','=','done')]" help="Done Withholding Local"/>
4282+ <filter name="wh_src_cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Withholding Local"/>
4283 <separator orientation="vertical"/>
4284 <field name="code"/>
4285 <field name="number"/>
4286@@ -70,11 +70,11 @@
4287 </group>
4288 <newline/>
4289 <group expand="1" string="Group By...">
4290- <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
4291- <separator orientation="vertical"/>
4292- <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
4293- <separator orientation="vertical"/>
4294- <filter string="Accounting Date of Withhold" icon="terp-go-month" domain="[]" context="{'group_by':'date_ret'}"/>
4295+ <filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
4296+ <separator orientation="vertical"/>
4297+ <filter string="State" domain="[]" context="{'group_by':'state'}"/>
4298+ <separator orientation="vertical"/>
4299+ <filter string="Accounting Date of Withhold" domain="[]" context="{'group_by':'date_ret'}"/>
4300 </group>
4301 </search>
4302 </field>
4303@@ -87,7 +87,7 @@
4304 <field name="arch" type="xml">
4305 <tree colors="blue:state=='draft'" string="Social Responsibility Commitment Withholding">
4306 <field name="name"/>
4307- <field name="type"/>
4308+ <field name="type" readonly="1"/>
4309 <field name="code"/>
4310 <field name="number"/>
4311 <field name="partner_id"/>
4312@@ -107,11 +107,16 @@
4313 <field name="type">form</field>
4314 <field name="arch" type="xml">
4315 <form string="Social Responsibility Commitment Withholding">
4316+ <field name="uid_wh_agent" invisible="1"/>
4317+ <field name="partner_list" string="Partners List"
4318+ context="{'partner_list': partner_list} " invisible="1"/>
4319 <group colspan="4" col="6">
4320 <field name="journal_id"/>
4321- <field name="type"/>
4322+ <field name="type" readonly="1"/>
4323 <field name="code"/>
4324- <field name="partner_id" on_change="onchange_partner_id(type,partner_id)"/>
4325+ <field name="partner_id" on_change="onchange_partner_id(type,partner_id)"
4326+ attrs="{'readonly':['&amp;',('uid_wh_agent','=',False),('type','=','in_invoice')]}"
4327+ domain="[('id','in',context.get('partner_list' , False))]" />
4328 <field name="currency_id"/>
4329 <field name="date_ret"/>
4330 <field name="account_id"/>
4331@@ -132,10 +137,10 @@
4332 <field name="state"/>
4333 </group>
4334 <group col="4" colspan="2">
4335- <button name="wh_src_confirmed" states="draft" string="Confirm" icon="gtk-ok"/>
4336- <button name="wh_src_done" states="confirmed" string="Done" icon="gtk-execute"/>
4337- <button name="wh_src_cancel" states="done" string="Cancel" icon="gtk-cancel"/>
4338- <button name="wh_src_draft" states="cancel,confirmed" string="Set to draft" icon="gtk-refresh"/>
4339+ <button name="wh_src_confirmed" states="draft" string="Confirm" />
4340+ <button name="wh_src_done" states="confirmed" string="Done" />
4341+ <button name="wh_src_cancel" states="done" string="Cancel" />
4342+ <button name="wh_src_draft" states="cancel,confirmed" string="Set to draft" />
4343 </group>
4344 </page>
4345 <page string="Other Information">
4346@@ -153,7 +158,7 @@
4347 <field name="view_type">form</field>
4348 <field name="view_mode">tree,form</field>
4349 <field name="domain">[('type','=','out_invoice')]</field>
4350- <field name="context">{'type':'out_invoice'}</field>
4351+ <field name="context">{'default_type':'out_invoice', 'type':'out_invoice' }</field>
4352 <field name="search_view_id" ref="view_wh_src_filter"/>
4353 <field name="help">With Social Responsibility Commitment Withholding Customer you can create and manage document withholding issued to your customers. OpenERP can also generate document withholding automatically from invoices. For retention must add the invoices, process them and then validate the document.</field>
4354 </record>
4355@@ -185,7 +190,7 @@
4356 <field name="view_type">form</field>
4357 <field name="view_mode">tree,form</field>
4358 <field name="domain">[('type','=','in_invoice')]</field>
4359- <field name="context">{'type':'in_invoice'}</field>
4360+ <field name="context">{'default_type':'in_invoice','type':'in_invoice'}</field>
4361 <field name="search_view_id" ref="view_wh_src_filter"/>
4362 <field name="help">With Social Responsibility Commitment Withholding Supplier you can create and manage document withholding issued to your customers. OpenERP can also generate document withholding automatically from invoices. For retention must add the invoices, process them and then validate the document.</field>
4363 </record>
4364
4365=== modified file 'l10n_ve_withholding_src/wizard/__init__.py'
4366--- l10n_ve_withholding_src/wizard/__init__.py 2012-01-26 04:52:17 +0000
4367+++ l10n_ve_withholding_src/wizard/__init__.py 2013-01-14 19:15:27 +0000
4368@@ -23,7 +23,8 @@
4369 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4370 ################################################################################
4371
4372-import wizard_ret_munici_xml
4373+#~ import wizard_ret_munici_xml
4374+import wizard_retention
4375
4376
4377 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4378
4379=== added file 'l10n_ve_withholding_src/wizard/wizard_retention.py'
4380--- l10n_ve_withholding_src/wizard/wizard_retention.py 1970-01-01 00:00:00 +0000
4381+++ l10n_ve_withholding_src/wizard/wizard_retention.py 2013-01-14 19:15:27 +0000
4382@@ -0,0 +1,59 @@
4383+#!/usr/bin/python
4384+# -*- encoding: utf-8 -*-
4385+###########################################################################
4386+# Module Writen to OpenERP, Open Source Management Solution
4387+# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
4388+# All Rights Reserved
4389+###############Credits######################################################
4390+# Coded by: Vauxoo C.A.
4391+# Planified by: Humberto Arocha
4392+# Audited by: Vauxoo C.A.
4393+#############################################################################
4394+# This program is free software: you can redistribute it and/or modify
4395+# it under the terms of the GNU Affero General Public License as published by
4396+# the Free Software Foundation, either version 3 of the License, or
4397+# (at your option) any later version.
4398+#
4399+# This program is distributed in the hope that it will be useful,
4400+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4401+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4402+# GNU Affero General Public License for more details.
4403+#
4404+# You should have received a copy of the GNU Affero General Public License
4405+# along with this program. If not, see <http://www.gnu.org/licenses/>.
4406+################################################################################
4407+
4408+import wizard
4409+from osv import osv
4410+from osv import fields
4411+from tools.translate import _
4412+
4413+class wiz_retention(osv.osv_memory):
4414+ _name = 'wiz.retention'
4415+ _description = "Wizard that changes the retention value"
4416+
4417+ def set_retention(self, cr, uid, ids, context=None):
4418+ if context is None:
4419+ context={}
4420+ data = self.pool.get('wiz.retention').read(cr, uid, ids)[0]
4421+ if not data['sure']:
4422+ raise osv.except_osv(_("Error!"), _("Please confirm that you want to do this by checking the option"))
4423+
4424+ inv_obj = self.pool.get('account.invoice')
4425+ n_retention = data['name']
4426+
4427+ if n_retention and n_retention > 5:
4428+ raise osv.except_osv(_("Error!"), _("Maximum retention is 5%"))
4429+ else:
4430+ invoice = inv_obj.browse(cr, uid, context['active_id'])
4431+ inv_obj.write(cr, uid, context.get('active_id'), {'wh_src_rate': n_retention}, context=context)
4432+
4433+ return {}
4434+
4435+ _columns = {
4436+ 'name': fields.float('Retention Value', required=True),
4437+ 'sure': fields.boolean('Are you sure?'),
4438+ }
4439+
4440+wiz_retention()
4441+
4442
4443=== added file 'l10n_ve_withholding_src/wizard/wizard_retention_view.xml'
4444--- l10n_ve_withholding_src/wizard/wizard_retention_view.xml 1970-01-01 00:00:00 +0000
4445+++ l10n_ve_withholding_src/wizard/wizard_retention_view.xml 2013-01-14 19:15:27 +0000
4446@@ -0,0 +1,36 @@
4447+<?xml version="1.0" encoding="utf-8"?>
4448+<openerp>
4449+ <data>
4450+
4451+
4452+ <record model="ir.ui.view" id="wizard_retention_form">
4453+ <field name="name">wizard.retention.form</field>
4454+ <field name="model">wiz.retention</field>
4455+ <field name="arch" type="xml">
4456+ <form string="Are you sure you want to do this?" version="7.0">
4457+ <label for="name" />
4458+ <field name="name" />
4459+ <newline/><newline/>
4460+ <label for="sure" />
4461+ <field name="sure" />
4462+
4463+ <footer>
4464+ <button name="set_retention" string="Confirm" type="object" icon="terp-check" class="oe_highlight"/>
4465+ or
4466+ <button special='cancel' string="Cancel" icon="terp-gtk-stop" class="oe_link" />
4467+ </footer>
4468+ </form>
4469+ </field>
4470+ </record>
4471+
4472+ <record id="action_wiz_retention" model="ir.actions.act_window">
4473+ <field name="name">Change retention</field>
4474+ <field name="type">ir.actions.act_window</field>
4475+ <field name="res_model">wiz.retention</field>
4476+ <field name="view_type">form</field>
4477+ <field name="view_mode">form</field>
4478+ <field name="target">new</field>
4479+ </record>
4480+
4481+ </data>
4482+</openerp>

Subscribers

People subscribed via source and target branches

to all changes: