Merge lp:~vauxoo/openerp-venezuela-localization/7.0-YAML-rev2-dev-hbto into lp:openerp-venezuela-localization

Proposed by hbto [Vauxoo] http://www.vauxoo.com
Status: Superseded
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/7.0-YAML-rev2-dev-hbto
Merge into: lp:openerp-venezuela-localization
Diff against target: 1200 lines (+307/-175)
42 files modified
l10n_ve_fiscal_requirements/__openerp__.py (+10/-9)
l10n_ve_fiscal_requirements/model/account.py (+0/-5)
l10n_ve_fiscal_requirements/model/invoice.py (+20/-17)
l10n_ve_fiscal_requirements/model/partner.py (+0/-1)
l10n_ve_fiscal_requirements/test/account_customer_invoice.yml (+29/-0)
l10n_ve_fiscal_requirements/test/account_supplier_invoice.yml (+35/-0)
l10n_ve_fiscal_requirements/test/fr_damaged.yml (+0/-2)
l10n_ve_imex/model/invoice.py (+1/-1)
l10n_ve_sale_purchase/__openerp__.py (+1/-1)
l10n_ve_split_invoice/__init__.py (+1/-4)
l10n_ve_split_invoice/__openerp__.py (+1/-1)
l10n_ve_split_invoice/model/__init__.py (+28/-0)
l10n_ve_withholding/__openerp__.py (+2/-1)
l10n_ve_withholding/model/invoice.py (+2/-16)
l10n_ve_withholding/test/account_supplier_invoice.yml (+76/-0)
l10n_ve_withholding_islr/__openerp__.py (+1/-1)
l10n_ve_withholding_islr/model/invoice.py (+4/-24)
l10n_ve_withholding_islr/model/partner.py (+0/-2)
l10n_ve_withholding_islr/model/product.py (+2/-7)
l10n_ve_withholding_islr/model/res_company.py (+2/-5)
l10n_ve_withholding_iva/demo/demo_invoices.xml (+8/-0)
l10n_ve_withholding_iva/model/account.py (+0/-2)
l10n_ve_withholding_iva/model/invoice.py (+0/-3)
l10n_ve_withholding_iva/model/wh_iva.py (+1/-11)
l10n_ve_withholding_iva/test/iva_purchase_nret1.yml (+1/-1)
l10n_ve_withholding_iva/test/iva_purchase_nret2.yml (+1/-1)
l10n_ve_withholding_iva/test/iva_purchase_nret3.yml (+1/-1)
l10n_ve_withholding_iva/test/iva_purchase_wh.yml (+19/-8)
l10n_ve_withholding_iva/test/iva_sale_wh.yml (+2/-0)
l10n_ve_withholding_iva/test/iva_test_wh_2.yml (+33/-6)
l10n_ve_withholding_iva/test/iva_test_wh_3.yml (+12/-6)
l10n_ve_withholding_iva/test/iva_test_wh_4.yml (+6/-2)
l10n_ve_withholding_muni/__openerp__.py (+2/-3)
l10n_ve_withholding_muni/model/invoice.py (+0/-2)
l10n_ve_withholding_muni/model/partner.py (+0/-4)
l10n_ve_withholding_muni/model/wh_muni.py (+2/-12)
l10n_ve_withholding_src/__openerp__.py (+1/-1)
l10n_ve_withholding_src/model/invoice.py (+1/-4)
l10n_ve_withholding_src/model/partner.py (+0/-1)
l10n_ve_withholding_src/model/res_company.py (+0/-3)
l10n_ve_withholding_src/model/wh_src.py (+1/-6)
ovl/__openerp__.py (+1/-1)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/7.0-YAML-rev2-dev-hbto
Reviewer Review Type Date Requested Status
Nhomar - Vauxoo Pending
Review via email: mp+195677@code.launchpad.net

This proposal supersedes a proposal from 2013-11-18.

This proposal has been superseded by a proposal from 2013-11-18.

To post a comment you must log in.
933. By hbto [Vauxoo] http://www.vauxoo.com

[FIX][l10n_ve_vat_write_off] Enabling Module

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

[FIX][ovl] Enabling Module

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

[MERGE][l10n_ve_sale_purchase] Enabling & Restructuring Module

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_fiscal_requirements/__openerp__.py'
2--- l10n_ve_fiscal_requirements/__openerp__.py 2013-11-16 17:50:57 +0000
3+++ l10n_ve_fiscal_requirements/__openerp__.py 2013-11-18 22:02:53 +0000
4@@ -94,17 +94,18 @@
5 'demo/demo_taxes.yml',
6 ],
7 'test': [
8- 'test/control_number.yml',
9- 'test/fr_sale_test.yml',
10- 'test/fr_purchase_test.yml',
11- 'test/fr_address.yml',
12- 'test/fr_vat_test.yml',
13- 'test/fr_damaged.yml',
14- 'test/fr_debit_note.yml',
15- 'test/fr_refund_note.yml',
16+ 'test/account_customer_invoice.yml',
17+ 'test/account_supplier_invoice.yml',
18+# 'test/control_number.yml',
19+# 'test/fr_sale_test.yml',
20+# 'test/fr_purchase_test.yml',
21+# 'test/fr_address.yml',
22+# 'test/fr_vat_test.yml',
23+# 'test/fr_damaged.yml',
24+# 'test/fr_debit_note.yml',
25+# 'test/fr_refund_note.yml',
26 ],
27 'installable': True,
28 'active': False,
29 }
30
31-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
32
33=== modified file 'l10n_ve_fiscal_requirements/model/account.py'
34--- l10n_ve_fiscal_requirements/model/account.py 2013-02-13 19:39:18 +0000
35+++ l10n_ve_fiscal_requirements/model/account.py 2013-11-18 22:02:53 +0000
36@@ -24,9 +24,6 @@
37 ################################################################################
38
39 from openerp.osv import fields, osv
40-__TYPES__ = [('sale_debit', 'Sale Debit'),('purchase_debit', 'Purchase Debit')]
41-
42-__HELP__= " Select 'Sale Debit' for customer debit note journals. Select 'Purchase Debit' for supplier debit note journals."
43
44 class account_journal(osv.osv):
45 _inherit = 'account.journal'
46@@ -45,5 +42,3 @@
47 " Select 'Sale Debit' for customer debit note journals."\
48 " Select 'Purchase Debit' for supplier debit note journals.")
49 }
50-
51-account_journal()
52
53=== modified file 'l10n_ve_fiscal_requirements/model/invoice.py'
54--- l10n_ve_fiscal_requirements/model/invoice.py 2013-06-01 18:58:59 +0000
55+++ l10n_ve_fiscal_requirements/model/invoice.py 2013-11-18 22:02:53 +0000
56@@ -33,21 +33,18 @@
57 it does not exist, return false
58 """
59
60- if context is None:
61- context = {}
62- journal_type_inv = context.get('journal_type', 'sale')
63-
64- if journal_type_inv in ('sale_debit', 'purchase_debit'):
65+ context = context or {}
66+ res = super(account_invoice, self)._get_journal(cr, uid, context=context)
67+ if res: return res
68+ type_inv = context.get('type', 'sale')
69+ if type_inv in ('sale_debit', 'purchase_debit'):
70 user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
71 company_id = context.get('company_id', user.company_id.id)
72 journal_obj = self.pool.get('account.journal')
73- res = journal_obj.search(cr, uid, [('type', '=',journal_type_inv),
74- ('company_id', '=', company_id)],
75- limit=1)
76- return res and res[0] or False
77- else:
78- return super(account_invoice, self)._get_journal(cr, uid, context=context)
79-
80+ domain = [('company_id', '=', company_id),('type', '=',type_inv)]
81+ res = journal_obj.search(cr, uid, domain, limit=1)
82+ return res and res[0] or False
83+
84 def _unique_invoice_per_partner(self, cr, uid, ids, context=None):
85 """ Return false when it is found
86 that the bill is not out_invoice or out_refund,
87@@ -118,6 +115,17 @@
88 'child_ids':[],
89 'nro_ctrl':None,
90 'supplier_invoice_number':None,
91+ 'sin_cred': False,
92+ # No cleaned in this copy because it is related to the previous
93+ # document, if previous document says so this too
94+ # 'parent_id':False,
95+ 'date_document': False,
96+ 'invoice_printer' : '',
97+ 'fiscal_printer' : '',
98+ # No cleaned in this copy because it is related to the previous
99+ # document, if previous document says so this too
100+ #'loc_req':False,
101+ 'z_report': '',
102 })
103 return super(account_invoice, self).copy(cr, uid, id, default, context)
104
105@@ -129,9 +137,6 @@
106 return super(account_invoice, self).write(cr, uid, ids, vals,
107 context=context)
108
109-account_invoice()
110-
111-
112 class account_invoice_tax(osv.osv):
113 _inherit = 'account.invoice.tax'
114 _columns = {
115@@ -139,6 +144,4 @@
116 help="Tax relation to original tax, to be able to take off all data from invoices."),
117 }
118
119-account_invoice_tax()
120-
121 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
122
123=== modified file 'l10n_ve_fiscal_requirements/model/partner.py'
124--- l10n_ve_fiscal_requirements/model/partner.py 2013-11-16 04:03:30 +0000
125+++ l10n_ve_fiscal_requirements/model/partner.py 2013-11-18 22:02:53 +0000
126@@ -308,5 +308,4 @@
127 # force full VIES online check
128 self.update_rif(cr, uid, ids, context=context)
129 return True
130-res_partner()
131 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
132
133=== added file 'l10n_ve_fiscal_requirements/test/account_customer_invoice.yml'
134--- l10n_ve_fiscal_requirements/test/account_customer_invoice.yml 1970-01-01 00:00:00 +0000
135+++ l10n_ve_fiscal_requirements/test/account_customer_invoice.yml 2013-11-18 22:02:53 +0000
136@@ -0,0 +1,29 @@
137+-
138+ In order to test account invoice I create a new customer invoice
139+-
140+ I set the context that will be used for the encoding of all the invoices of this file
141+-
142+ !context
143+ 'type': 'out_invoice'
144+-
145+ I create a customer invoice
146+-
147+ !record {model: account.invoice, id: account_invoice_customer0, view: account.invoice_form}:
148+ payment_term: account.account_payment_term_advance
149+ journal_id: account.sales_journal
150+ partner_id: base.res_partner_3
151+ reference_type: none
152+ name: 'Test Customer Invoice - l10n_ve_fiscal_requirements'
153+ invoice_line:
154+ - product_id: product.product_product_5
155+ quantity: 10.0
156+-
157+ I check that Initially customer invoice state is "Draft"
158+-
159+ !assert {model: account.invoice, id: account_invoice_customer0}:
160+ - state == 'draft'
161+-
162+ I check that the customer invoice is a "Customer Invoice"
163+-
164+ !assert {model: account.invoice, id: account_invoice_customer0, string: This is not a customer invoice}:
165+ - type == 'out_invoice'
166
167=== added file 'l10n_ve_fiscal_requirements/test/account_supplier_invoice.yml'
168--- l10n_ve_fiscal_requirements/test/account_supplier_invoice.yml 1970-01-01 00:00:00 +0000
169+++ l10n_ve_fiscal_requirements/test/account_supplier_invoice.yml 2013-11-18 22:02:53 +0000
170@@ -0,0 +1,35 @@
171+-
172+ In order to test account invoice I create a new supplier invoice
173+-
174+ I set the context that will be used for the encoding of all the invoices of this file
175+-
176+ !context
177+ 'type': 'in_invoice'
178+-
179+ I create a supplier invoice
180+-
181+ !record {model: account.invoice, id: account_invoice_supplier0, view: account.invoice_supplier_form }:
182+ account_id: account.a_pay
183+ company_id: base.main_company
184+ currency_id: base.EUR
185+ invoice_line:
186+ - account_id: account.a_expense
187+ name: '[PCSC234] PC Assemble SC234'
188+ price_unit: 300.0
189+ product_id: product.product_product_3
190+ quantity: 10.0
191+ uos_id: product.product_uom_unit
192+ journal_id: account.expenses_journal
193+ partner_id: base.res_partner_12
194+ reference_type: none
195+ type: 'in_invoice'
196+-
197+ I check that Initially supplier invoice state is "Draft"
198+-
199+ !assert {model: account.invoice, id: account_invoice_supplier0}:
200+ - state == 'draft'
201+-
202+ I check that the supplier invoice is a "Supplier Invoice"
203+-
204+ !assert {model: account.invoice, id: account_invoice_supplier0, string: This is not a supplier invoice}:
205+ - type == 'in_invoice'
206
207=== modified file 'l10n_ve_fiscal_requirements/test/fr_damaged.yml'
208--- l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-11-14 20:14:21 +0000
209+++ l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-11-18 22:02:53 +0000
210@@ -109,7 +109,6 @@
211 !python {model: account.journal}: |
212 aj_ids = self.search(cr, uid, [('type', '=','sale')])
213 assert aj_ids, 'There are no Journals'
214-
215 self.write(cr, uid, aj_ids, {'update_posted': True})
216 -
217 6.13 Verify that the journal was properly updated
218@@ -171,4 +170,3 @@
219 pass
220 finally:
221 cr.sql_log = l
222-
223
224=== modified file 'l10n_ve_imex/model/invoice.py'
225--- l10n_ve_imex/model/invoice.py 2013-09-23 14:18:19 +0000
226+++ l10n_ve_imex/model/invoice.py 2013-11-18 22:02:53 +0000
227@@ -75,7 +75,7 @@
228 % item.customs_form_id.name)
229 return super(account_invoice, self).test_open(cr, uid, ids, args)
230
231-class inheried_account_invoice_tax(osv.osv):
232+class account_invoice_tax(osv.osv):
233
234 _inherit = 'account.invoice.tax'
235
236
237=== modified file 'l10n_ve_sale_purchase/__openerp__.py'
238--- l10n_ve_sale_purchase/__openerp__.py 2013-09-18 23:55:08 +0000
239+++ l10n_ve_sale_purchase/__openerp__.py 2013-11-18 22:02:53 +0000
240@@ -41,7 +41,7 @@
241 ],
242 'demo' : [],
243 'active' : False,
244- 'installable': True,
245+ 'installable': False,
246 'test': [
247 # 'test/purchase_order.yml',
248 # 'test/purchase_picking.yml',
249
250=== modified file 'l10n_ve_split_invoice/__init__.py'
251--- l10n_ve_split_invoice/__init__.py 2012-01-19 20:03:36 +0000
252+++ l10n_ve_split_invoice/__init__.py 2013-11-18 22:02:53 +0000
253@@ -22,7 +22,4 @@
254 # You should have received a copy of the GNU Affero General Public License
255 # along with this program. If not, see <http://www.gnu.org/licenses/>.
256 ##############################################################################
257-import installer
258-import res_company
259-import invoice
260-
261+import model
262
263=== modified file 'l10n_ve_split_invoice/__openerp__.py'
264--- l10n_ve_split_invoice/__openerp__.py 2013-11-14 20:44:23 +0000
265+++ l10n_ve_split_invoice/__openerp__.py 2013-11-18 22:02:53 +0000
266@@ -51,7 +51,7 @@
267 "demo_xml" : [
268 ],
269 "update_xml" : [
270-#~ "installer_view.xml",
271+#~ "view/installer_view.xml",
272 "view/company_view.xml",
273 ],
274 'test': [
275
276=== added directory 'l10n_ve_split_invoice/model'
277=== added file 'l10n_ve_split_invoice/model/__init__.py'
278--- l10n_ve_split_invoice/model/__init__.py 1970-01-01 00:00:00 +0000
279+++ l10n_ve_split_invoice/model/__init__.py 2013-11-18 22:02:53 +0000
280@@ -0,0 +1,28 @@
281+ # -*- encoding: utf-8 -*-
282+###########################################################################
283+# Module Writen to OpenERP, Open Source Management Solution
284+# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
285+# All Rights Reserved
286+###############Credits######################################################
287+# Coded by: nhomar@openerp.com.ve
288+# Planified by: Nhomar Hernandez
289+# Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
290+# Audited by: Humberto Arocha humberto@openerp.com.ve
291+#############################################################################
292+# This program is free software: you can redistribute it and/or modify
293+# it under the terms of the GNU Affero General Public License as published by
294+# the Free Software Foundation, either version 3 of the License, or
295+# (at your option) any later version.
296+#
297+# This program is distributed in the hope that it will be useful,
298+# but WITHOUT ANY WARRANTY; without even the implied warranty of
299+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
300+# GNU Affero General Public License for more details.
301+#
302+# You should have received a copy of the GNU Affero General Public License
303+# along with this program. If not, see <http://www.gnu.org/licenses/>.
304+##############################################################################
305+import installer
306+import res_company
307+import invoice
308+
309
310=== renamed file 'l10n_ve_split_invoice/installer.py' => 'l10n_ve_split_invoice/model/installer.py'
311=== renamed file 'l10n_ve_split_invoice/invoice.py' => 'l10n_ve_split_invoice/model/invoice.py'
312=== renamed file 'l10n_ve_split_invoice/res_company.py' => 'l10n_ve_split_invoice/model/res_company.py'
313=== renamed file 'l10n_ve_split_invoice/installer_view.xml' => 'l10n_ve_split_invoice/view/installer_view.xml'
314=== modified file 'l10n_ve_withholding/__openerp__.py'
315--- l10n_ve_withholding/__openerp__.py 2013-09-18 23:55:08 +0000
316+++ l10n_ve_withholding/__openerp__.py 2013-11-18 22:02:53 +0000
317@@ -49,7 +49,8 @@
318 ],
319 'demo_xml': [],
320 'test': [
321-# 'test/wh_pay_invoice.yml'
322+ 'test/account_supplier_invoice.yml',
323+# 'test/wh_pay_invoice.yml',
324 ],
325 'installable': True,
326 'active': False,
327
328=== modified file 'l10n_ve_withholding/model/invoice.py'
329--- l10n_ve_withholding/model/invoice.py 2013-04-12 20:19:03 +0000
330+++ l10n_ve_withholding/model/invoice.py 2013-11-18 22:02:53 +0000
331@@ -28,11 +28,9 @@
332 from openerp.addons import decimal_precision as dp
333 from openerp.tools.translate import _
334
335-
336 class account_invoice(osv.osv):
337 _inherit = 'account.invoice'
338
339-
340 def _get_move_lines(self, cr, uid, ids, to_wh, period_id,
341 pay_journal_id, writeoff_acc_id,
342 writeoff_period_id, writeoff_journal_id, date,
343@@ -42,7 +40,7 @@
344 """
345 if context is None: context = {}
346 return []
347-
348+
349 def ret_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id,
350 period_id, pay_journal_id, writeoff_acc_id,
351 writeoff_period_id, writeoff_journal_id, date,
352@@ -105,7 +103,6 @@
353 self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context)
354 return {'move_id': move_id}
355
356-
357 def ret_payment_get(self, cr, uid, ids, *args):
358 """ Return payments associated with this bill
359 """
360@@ -127,10 +124,7 @@
361 lines = filter(lambda x: x not in src, lines)
362
363 return lines
364-
365-
366-
367-
368+
369 def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj):
370 """ Check if no tax lines are created. If
371 existing tax lines, there are checks on the invoice
372@@ -157,11 +151,6 @@
373 if not key in tax_key:
374 raise osv.except_osv(_('Warning !'), _('Taxes missing !'))
375
376-account_invoice()
377-
378-
379-
380-
381 class account_invoice_tax(osv.osv):
382 _inherit = 'account.invoice.tax'
383 _columns = {
384@@ -223,6 +212,3 @@
385 t['base_amount'] = cur_obj.round(cr, uid, cur, t['base_amount'])
386 t['tax_amount'] = cur_obj.round(cr, uid, cur, t['tax_amount'])
387 return tax_grouped
388-
389-
390-account_invoice_tax()
391
392=== added file 'l10n_ve_withholding/test/account_supplier_invoice.yml'
393--- l10n_ve_withholding/test/account_supplier_invoice.yml 1970-01-01 00:00:00 +0000
394+++ l10n_ve_withholding/test/account_supplier_invoice.yml 2013-11-18 22:02:53 +0000
395@@ -0,0 +1,76 @@
396+-
397+ In order to test account invoice I create a new supplier invoice
398+-
399+ I create a Tax
400+-
401+ !record {model: account.tax, id: tax10}:
402+ name: Tax 10.0 %
403+ amount: 0.10
404+ type: percent
405+ sequence: 1
406+ company_id: base.main_company
407+ type_tax_use: purchase
408+-
409+ I set the context that will be used for the encoding of all the invoices of this file
410+-
411+ !context
412+ 'type': 'in_invoice'
413+-
414+ I create a supplier invoice
415+-
416+ !record {model: account.invoice, id: account_invoice_supplier0, view: account.invoice_supplier_form}:
417+ account_id: account.a_pay
418+ check_total: 3000.0
419+ company_id: base.main_company
420+ currency_id: base.EUR
421+ invoice_line:
422+ - account_id: account.a_expense
423+ name: '[PCSC234] PC Assemble SC234'
424+ price_unit: 300.0
425+ product_id: product.product_product_3
426+ quantity: 10.0
427+ uos_id: product.product_uom_unit
428+ invoice_line_tax_id:
429+ - tax10
430+ journal_id: account.expenses_journal
431+ partner_id: base.res_partner_12
432+ reference_type: none
433+ type: in_invoice
434+ comment: 'Supplier Invoice - l10n_ve_withholding'
435+-
436+ I check that Initially supplier invoice state is "Draft"
437+-
438+ !assert {model: account.invoice, id: account_invoice_supplier0}:
439+ - state == 'draft'
440+-
441+ I check that the supplier invoice is a "Supplier Invoice"
442+-
443+ !assert {model: account.invoice, id: account_invoice_supplier0, string: This is not a supplier invoice}:
444+ - type == 'in_invoice'
445+-
446+ I change the state of invoice to open by clicking Validate button
447+-
448+ !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_supplier0}
449+-
450+ I check that the invoice state is now "Open"
451+-
452+ !assert {model: account.invoice, id: account_invoice_supplier0}:
453+ - state == 'open'
454+-
455+ I verify that account.invoice.tax has 'tax_id'
456+-
457+ !python {model: account.invoice}: |
458+ inv = self.browse(cr, uid, ref('account_invoice_supplier0'))
459+ assert inv.tax_line, ('This invoice should has at least one tax')
460+ for t in inv.tax_line:
461+ assert t.tax_id, "No tax_id in account.invoice.tax record '%s'"%t.name
462+-
463+ I verify that account move is created
464+-
465+ !python {model: account.invoice}: |
466+ move_obj = self.pool.get('account.move')
467+ inv = self.browse(cr, uid, ref('account_invoice_supplier0'))
468+ move = inv.move_id
469+ assert move, ('Journal Entries has not been created')
470+ assert move.line_id, ('Empty Entry Lines')
471+ print [(x.debit, x.credit) for x in move.line_id]
472
473=== modified file 'l10n_ve_withholding_islr/__openerp__.py'
474--- l10n_ve_withholding_islr/__openerp__.py 2013-11-14 20:14:21 +0000
475+++ l10n_ve_withholding_islr/__openerp__.py 2013-11-18 22:02:53 +0000
476@@ -74,5 +74,5 @@
477 # 'test/test_duplicate.yml',
478 ],
479 "active": False,
480- "installable": True
481+ "installable": True,
482 }
483
484=== modified file 'l10n_ve_withholding_islr/model/invoice.py'
485--- l10n_ve_withholding_islr/model/invoice.py 2013-11-14 05:25:38 +0000
486+++ l10n_ve_withholding_islr/model/invoice.py 2013-11-18 22:02:53 +0000
487@@ -31,7 +31,6 @@
488 import datetime
489 from openerp import netsvc
490
491-
492 class account_invoice_line(osv.osv):
493 """ It adds a field that determines if a line has been retained or not
494 """
495@@ -66,8 +65,7 @@
496 @param price_unit: new Unit Price for the invoice line
497 @param currency_id:
498 """
499- if context is None:
500- context = {}
501+ context = context or {}
502 data = super(
503 account_invoice_line, self).product_id_change(cr, uid, ids,
504 product, uom,
505@@ -88,26 +86,15 @@
506 """ Initialilizes the fields wh_xml_id and apply_wh,
507 when it comes to a new line
508 """
509- if context is None:
510- context = {}
511-
512+ context = context or {}
513 if context.get('new_key', False):
514-
515 vals.update({'wh_xml_id': False,
516 'apply_wh': False,
517-
518 })
519-
520 return super(account_invoice_line, self).create(cr, uid, vals, context=context)
521
522-
523-account_invoice_line()
524-
525-
526 class account_invoice(osv.osv):
527-
528 _inherit = 'account.invoice'
529-
530 _columns = {
531 'status': fields.selection([
532 ('pro', 'Processed withholding, xml Line generated'),
533@@ -207,19 +194,13 @@
534 """ Inicializes the fields islr_wh_doc and status
535 when the line is duplicated
536 """
537- if default is None:
538- default = {}
539-
540- if context is None:
541- context = {}
542-
543+ default = default or {}
544+ context = context or {}
545 default = default.copy()
546 default.update({'islr_wh_doc': 0,
547 'status': 'no_pro',
548 })
549-
550 context.update({'new_key': True})
551-
552 return super(account_invoice, self).copy(cr, uid, id, default,
553 context)
554
555@@ -319,4 +300,3 @@
556
557 return res
558
559-account_invoice()
560
561=== modified file 'l10n_ve_withholding_islr/model/partner.py'
562--- l10n_ve_withholding_islr/model/partner.py 2013-04-12 20:19:03 +0000
563+++ l10n_ve_withholding_islr/model/partner.py 2013-11-18 22:02:53 +0000
564@@ -33,7 +33,6 @@
565 import datetime
566
567 class res_partner(osv.osv):
568- _name = 'res.partner'
569 _inherit = 'res.partner'
570
571 _columns = {
572@@ -45,4 +44,3 @@
573 _defaults = {
574 'islr_withholding_agent': lambda *a: True,
575 }
576-res_partner()
577
578=== modified file 'l10n_ve_withholding_islr/model/product.py'
579--- l10n_ve_withholding_islr/model/product.py 2013-04-26 23:55:44 +0000
580+++ l10n_ve_withholding_islr/model/product.py 2013-11-18 22:02:53 +0000
581@@ -25,6 +25,7 @@
582 # You should have received a copy of the GNU Affero General Public License
583 # along with this program. If not, see <http://www.gnu.org/licenses/>.
584 ##############################################################################
585+
586 from openerp.osv import osv
587 from openerp.osv import fields
588 from openerp.tools.translate import _
589@@ -40,14 +41,10 @@
590 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Concept Income Withholding to apply to the service", required=False),
591 }
592
593-product_template()
594-
595-
596 class product_product(osv.osv):
597
598 _inherit = "product.product"
599-
600-
601+
602 def onchange_product_type(self, cr, uid, ids, prd_type, context=None):
603 """ Add a default concept for products that are not service type,
604 Returns false if the product type is not a service, and if the
605@@ -65,5 +62,3 @@
606 raise osv.except_osv(_('Invalid action !'),_("Must create the concept of income withholding"))
607
608 return {'value' : {'concept_id':concept_id or False}}
609-
610-product_product()
611
612=== modified file 'l10n_ve_withholding_islr/model/res_company.py'
613--- l10n_ve_withholding_islr/model/res_company.py 2013-02-13 19:39:18 +0000
614+++ l10n_ve_withholding_islr/model/res_company.py 2013-11-18 22:02:53 +0000
615@@ -22,6 +22,7 @@
616 # You should have received a copy of the GNU Affero General Public License
617 # along with this program. If not, see <http://www.gnu.org/licenses/>.
618 ##############################################################################
619+
620 from openerp.osv import osv
621 from openerp.osv import fields
622 from openerp.tools.translate import _
623@@ -30,7 +31,6 @@
624 import datetime
625
626 class res_company(osv.osv):
627- _name = 'res.company'
628 _inherit = 'res.company'
629
630 _columns = {
631@@ -38,10 +38,7 @@
632 help='When True, Supplier Income Withholding will be check and '\
633 'validate automatically'),
634 }
635-
636+
637 defaults = {
638 'automatic_income_wh': False,
639 }
640-
641-res_company()
642-
643
644=== modified file 'l10n_ve_withholding_iva/demo/demo_invoices.xml'
645--- l10n_ve_withholding_iva/demo/demo_invoices.xml 2013-11-17 02:03:44 +0000
646+++ l10n_ve_withholding_iva/demo/demo_invoices.xml 2013-11-18 22:02:53 +0000
647@@ -5,9 +5,17 @@
648 Mark demo taxes as withholdable
649 -->
650 <record id="l10n_ve_fiscal_requirements.iva_sale1" model="account.tax">
651+ <field name="name">IVA - Sale</field>
652+ <field name="amount">0.12</field>
653+ <field name="type_tax_use">sale</field>
654+ <field name="applicable_type">true</field>
655 <field name="ret">True</field>
656 </record>
657 <record id="l10n_ve_fiscal_requirements.iva_purchase1" model="account.tax">
658+ <field name="name">IVA - Purchase</field>
659+ <field name="amount">0.12</field>
660+ <field name="type_tax_use">purchase</field>
661+ <field name="applicable_type">true</field>
662 <field name="ret">True</field>
663 </record>
664 <!--
665
666=== modified file 'l10n_ve_withholding_iva/model/account.py'
667--- l10n_ve_withholding_iva/model/account.py 2013-05-11 05:45:52 +0000
668+++ l10n_ve_withholding_iva/model/account.py 2013-11-18 22:02:53 +0000
669@@ -49,5 +49,3 @@
670 domain="[('type', '=', 'other')]",
671 help="This account will be used when applying a withhold to a Refund"),
672 }
673-
674-account_tax()
675
676=== modified file 'l10n_ve_withholding_iva/model/invoice.py'
677--- l10n_ve_withholding_iva/model/invoice.py 2013-11-14 01:52:50 +0000
678+++ l10n_ve_withholding_iva/model/invoice.py 2013-11-18 22:02:53 +0000
679@@ -435,7 +435,6 @@
680 " invoice."))
681 return True
682
683-account_invoice()
684
685 class account_invoice_tax(osv.osv):
686 _inherit = 'account.invoice.tax'
687@@ -460,5 +459,3 @@
688 amount_ret = wh_iva_rate and ait.tax_amount*wh_iva_rate/100.0 or 0.00
689 res[ait.id] = {'amount_ret': amount_ret, 'base_ret': ait.base_amount}
690 return res
691-
692-account_invoice_tax()
693
694=== modified file 'l10n_ve_withholding_iva/model/wh_iva.py'
695--- l10n_ve_withholding_iva/model/wh_iva.py 2013-07-23 14:23:34 +0000
696+++ l10n_ve_withholding_iva/model/wh_iva.py 2013-11-18 22:02:53 +0000
697@@ -30,16 +30,10 @@
698
699 class account_wh_iva_line_tax(osv.osv):
700 _name = 'account.wh.iva.line.tax'
701-account_wh_iva_line_tax()
702-
703 class account_wh_iva_line(osv.osv):
704 _name = "account.wh.iva.line"
705-account_wh_iva_line()
706-
707 class account_wh_iva(osv.osv):
708 _name = "account.wh.iva"
709-account_wh_iva()
710-
711 class account_wh_iva_line_tax(osv.osv):
712
713 def _set_amount_ret(self, cr, uid, id, name, value, arg, ctx=None):
714@@ -91,8 +85,6 @@
715 help="Vat Withholding amount"),
716 }
717
718-account_wh_iva_line_tax()
719-
720 class account_wh_iva_line(osv.osv):
721
722 def _get_tax_lines(self, cr, uid, tax_id_brw, context=None):
723@@ -194,8 +186,6 @@
724
725 return {'value':result, 'domain':domain}
726
727-account_wh_iva_line()
728-
729 class account_wh_iva(osv.osv):
730
731 def name_get(self,cr, uid, ids, context):
732@@ -725,6 +715,7 @@
733 fortnight_str = {'True': ' - Second Fortnight)',
734 'False': ' - First Fortnight)'}
735 for awi_brw in self.browse(cr, uid, ids, context=context):
736+ if not awi_brw.wh_lines: return False
737 if awi_brw.type in ['out_invoice']: return True
738 for awil_brw in awi_brw.wh_lines:
739 awil_period_id, awil_fortnight = per_obj.find_fortnight(
740@@ -781,4 +772,3 @@
741 super(account_wh_iva, self).unlink(cr, uid, ids, context=context)
742 return True
743
744-account_wh_iva()
745
746=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret1.yml'
747--- l10n_ve_withholding_iva/test/iva_purchase_nret1.yml 2013-01-15 15:16:32 +0000
748+++ l10n_ve_withholding_iva/test/iva_purchase_nret1.yml 2013-11-18 22:02:53 +0000
749@@ -32,7 +32,7 @@
750 date_invoice: !eval time.strftime('%Y-%m-%d')
751 partner_id: base.res_partner_23
752 reference_type: none
753- journal_id: account.sales_journal
754+ journal_id: account.expenses_journal
755 wh_iva: True
756 invoice_line:
757 - product_id: product.product_product_3
758
759=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret2.yml'
760--- l10n_ve_withholding_iva/test/iva_purchase_nret2.yml 2013-01-15 15:16:32 +0000
761+++ l10n_ve_withholding_iva/test/iva_purchase_nret2.yml 2013-11-18 22:02:53 +0000
762@@ -42,7 +42,7 @@
763 date_invoice: !eval time.strftime('%Y-%m-%d')
764 partner_id: base.res_partner_23
765 reference_type: none
766- journal_id: account.sales_journal
767+ journal_id: account.expenses_journal
768 wh_iva: True
769 invoice_line:
770 - product_id: product.product_product_3
771
772=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret3.yml'
773--- l10n_ve_withholding_iva/test/iva_purchase_nret3.yml 2013-01-15 15:16:32 +0000
774+++ l10n_ve_withholding_iva/test/iva_purchase_nret3.yml 2013-11-18 22:02:53 +0000
775@@ -52,7 +52,7 @@
776 date_invoice: !eval time.strftime('%Y-%m-%d')
777 partner_id: base.res_partner_23
778 reference_type: none
779- journal_id: account.sales_journal
780+ journal_id: account.expenses_journal
781 wh_iva: True
782 invoice_line:
783 - product_id: product.product_product_3
784
785=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_wh.yml'
786--- l10n_ve_withholding_iva/test/iva_purchase_wh.yml 2013-01-15 15:16:32 +0000
787+++ l10n_ve_withholding_iva/test/iva_purchase_wh.yml 2013-11-18 22:02:53 +0000
788@@ -26,13 +26,14 @@
789 -
790 2.4 I create a purchase invoice
791 -
792- !record {model: account.invoice, id: test_purchase_iva02}:
793- type: out_invoice
794+ !record {model: account.invoice, id: test_purchase_iva02, view: account.invoice_supplier_form, context:{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}}:
795+ type: in_invoice
796+ state: draft
797 company_id: base.main_company
798 date_invoice: !eval time.strftime('%Y-%m-%d')
799 partner_id: base.res_partner_23
800 reference_type: none
801- journal_id: account.sales_journal
802+ journal_id:
803 wh_iva: True
804 invoice_line:
805 - product_id: product.product_product_3
806@@ -50,10 +51,19 @@
807 invoice_line_tax_id:
808 - l10n_ve_fiscal_requirements.iva_purchase1
809 -
810- 2.5 I check that Initially customer invoice is in the "Draft" state
811+ 2.5 I check that Initially supplier invoice is in the "Draft" state
812 -
813- !assert {model: account.invoice, id: test_purchase_iva02}:
814- - state == 'draft'
815+ !python {model: account.invoice}: |
816+ ap_obj=self.pool.get('account.period')
817+ import time
818+ period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})
819+ assert period, 'There aren\'t periods for this date'
820+ ap_obj.write(cr, uid, period, {'special':False})
821+ self.write(cr,uid,ref('test_purchase_iva02'),{'journal_id':ref('account.expenses_journal'),'type':'in_invoice'})
822+ ai_brw = self.browse(cr,uid,ref('test_purchase_iva02'))
823+ assert ai_brw.type == 'in_invoice', "Not the intended type. It should be 'in_invoice' not '%s'"%ai_brw.type
824+ assert ai_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%ai_brw.state
825+ assert ai_brw.journal_id.id == ref('account.expenses_journal'), "Not the intended Journal. It should be 'Expenses Journal - (test)' not '%s'"%ai_brw.journal_id.name
826 -
827 2.6 I change the state of invoice to "Proforma2" by clicking PRO-FORMA button
828 -
829@@ -76,6 +86,7 @@
830 2.10 Set control number for the invoice
831 -
832 !python {model: account.invoice}: |
833- self.write(cr, uid, [ref("test_purchase_iva02")], {'nro_ctrl':'iva002', 'journal_id':ref("account.expenses_journal")})
834+ self.write(cr, uid, [ref("test_purchase_iva02")], {'nro_ctrl':'iva002'})
835 ai_brw = self.browse(cr, uid, ref("test_purchase_iva02"))
836- assert ai_brw.nro_ctrl=='iva002' and ai_brw.journal_id.id == ref("account.expenses_journal"), 'Invoice wasn\'t updated properly'
837+ assert ai_brw.nro_ctrl=='iva002', "Not the intended Control Number. It should be 'iva002' not '%s'"%ai_brw.nro_ctrl
838+ assert ai_brw.journal_id.id == ref('account.expenses_journal'), "Not the intended Journal. It should be 'Expenses Journal - (test)' not '%s'"%ai_brw.journal_id.name
839
840=== modified file 'l10n_ve_withholding_iva/test/iva_sale_wh.yml'
841--- l10n_ve_withholding_iva/test/iva_sale_wh.yml 2013-01-17 19:19:09 +0000
842+++ l10n_ve_withholding_iva/test/iva_sale_wh.yml 2013-11-18 22:02:53 +0000
843@@ -109,11 +109,13 @@
844 ap_obj=self.pool.get('account.period')
845 period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})
846 assert period, 'There aren\'t periods for this date'
847+ ap_obj.write(cr, uid, period, {'special':False})
848 ap_brw = ap_obj.browse(cr, uid, period[0])
849 if ap_brw.state == 'done':
850 ap.action_draft(cr, uid, period)
851 ap_brw = ap.browse(cr, uid, period[0])
852 assert ap_brw.state == 'draft', 'Period is not open as it should be'
853+ assert ap_brw.special == False, 'Period is special. It should be'
854
855 self.write(cr, uid, ref("wh_iva_sale01"), {'period_id':period[0]})
856 -
857
858=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_2.yml'
859--- l10n_ve_withholding_iva/test/iva_test_wh_2.yml 2013-01-18 19:55:38 +0000
860+++ l10n_ve_withholding_iva/test/iva_test_wh_2.yml 2013-11-18 22:02:53 +0000
861@@ -10,28 +10,55 @@
862 -
863 10.2 I generate a withholding vat customer
864 -
865- !record {model: account.wh.iva, id: wh_iva_test02}:
866+ !record {model: account.wh.iva, id: wh_iva_test02, view: view_wh_iva_form_customer, context: {'type':'out_invoice'}}:
867 journal_id: wh_sales_journal
868 partner_id: base.res_partner_23
869 number: 222444333000
870 account_id: account.a_recv
871 name: 'IVA wh vat customer Vauxoo test 2'
872 type: out_invoice
873+ state: draft
874 -
875 10.3 I check withholding vat customer
876 -
877- !assert {model: account.wh.iva, id: wh_iva_test02, string: Wh was not saved}:
878- - state == 'draft'
879+ !python {model: account.wh.iva}: |
880+ values = {}
881+ rp_obj = self.pool.get('res.partner')
882+ rp_brw = rp_obj.browse(cr,uid,ref("base.res_partner_23"))
883+ res = self.onchange_partner_id(cr, uid, [ref('wh_iva_test02')], 'out_invoice', rp_brw.id)
884+ values['wh_lines'] = [(0,0,{'invoice_id':ref('test_iva01'), 'name':'N/A', 'wh_iva_rate':rp_brw.wh_iva_rate})]
885+ values['account_id'] = res['value']['account_id']
886+ values['type'] = 'out_invoice'
887+ self.write(cr,uid,ref('wh_iva_test02'),values)
888+ awi_brw = self.browse(cr,uid,ref('wh_iva_test02'))
889+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
890+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
891+ assert awi_brw.wh_lines, "There are no lines to withhold"
892+ self.compute_amount_wh(cr,uid,[ref('wh_iva_test02')])
893 -
894 10.4 I confirm the withholding vat customer
895 -
896- !workflow {model: account.wh.iva, action: wh_iva_confirmed, ref: wh_iva_test02}
897+ !python {model: account.wh.iva}: |
898+ import netsvc
899+ from openerp.osv import osv
900+ wf_service = netsvc.LocalService("workflow")
901+ try:
902+ self.check_wh_lines_fortnights(cr, uid, [ref('wh_iva_test02')])
903+ self.check_invoice_nro_ctrl(cr, uid, [ref('wh_iva_test02')])
904+ self.check_vat_wh(cr, uid, [ref('wh_iva_test02')])
905+ self.check_wh_taxes(cr, uid, [ref('wh_iva_test02')])
906+ self.check_wh_taxes(cr, uid, [ref('wh_iva_test02')])
907+ assert False, "An exception should have been raised, unwithholdable taxes are not allowed to reach here!"
908+ except osv.except_osv:
909+ # exception was raised as expected
910+ pass
911 -
912 10.5 I check withholding vat is not confirmed
913 # TODO: Check this test case, it fails. It means that something in the wh_iva_confirmed action is wrong.
914 -
915- !assert {model: account.wh.iva, id: wh_iva_test02, string: Could not confirm the wh}:
916- - state != 'confirmed'
917+ !python {model: account.wh.iva}: |
918+ awi_brw = self.browse(cr,uid,ref('wh_iva_test02'))
919+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
920 -
921 10.6 I try to mark it as done
922 -
923
924=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_3.yml'
925--- l10n_ve_withholding_iva/test/iva_test_wh_3.yml 2013-01-18 19:55:38 +0000
926+++ l10n_ve_withholding_iva/test/iva_test_wh_3.yml 2013-11-18 22:02:53 +0000
927@@ -16,11 +16,15 @@
928 account_id: account.a_recv
929 name: 'IVA wh vat customer Vauxoo test 3'
930 type: out_invoice
931+ state: draft
932 -
933 11.3 I check withholding vat customer
934 -
935- !assert {model: account.wh.iva, id: wh_iva_test03, string: Wh was not saved}:
936- - state == 'draft'
937+ !python {model: account.wh.iva}: |
938+ self.write(cr,uid,ref('wh_iva_test03'),{'type':'out_invoice'})
939+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
940+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
941+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
942 -
943 11.4 Before validating let's add the period
944 -
945@@ -43,8 +47,9 @@
946 11.7 I check withholding vat is not confirmed
947 # TODO: Check this test case, it fails. It means that something in the wh_iva_confirmed action is wrong.
948 -
949- !assert {model: account.wh.iva, id: wh_iva_test03, string: Could not confirm the wh}:
950- - state != 'confirmed'
951+ !python {model: account.wh.iva}: |
952+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
953+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
954 -
955 11.8 I try to mark it as done
956 -
957@@ -52,5 +57,6 @@
958 -
959 11.9 I check withholding vat is not done
960 -
961- !assert {model: account.wh.iva, id: wh_iva_test01, string: Wh cannot be in done state}:
962- - state != 'done'
963+ !python {model: account.wh.iva}: |
964+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
965+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
966
967=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_4.yml'
968--- l10n_ve_withholding_iva/test/iva_test_wh_4.yml 2013-01-18 19:55:38 +0000
969+++ l10n_ve_withholding_iva/test/iva_test_wh_4.yml 2013-11-18 22:02:53 +0000
970@@ -16,11 +16,15 @@
971 account_id: account.a_recv
972 name: 'IVA wh vat customer Vauxoo test 3'
973 type: out_invoice
974+ state: draft
975 -
976 12.3 I check withholding vat customer
977 -
978- !assert {model: account.wh.iva, id: wh_iva_test04, string: Wh was not saved}:
979- - state == 'draft'
980+ !python {model: account.wh.iva}: |
981+ self.write(cr,uid,ref('wh_iva_test04'),{'type':'out_invoice'})
982+ awi_brw = self.browse(cr,uid,ref('wh_iva_test04'))
983+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
984+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
985 -
986 12.4 Before validating let's add the period
987 -
988
989=== modified file 'l10n_ve_withholding_muni/__openerp__.py'
990--- l10n_ve_withholding_muni/__openerp__.py 2013-01-30 20:27:24 +0000
991+++ l10n_ve_withholding_muni/__openerp__.py 2013-11-18 22:02:53 +0000
992@@ -46,10 +46,9 @@
993 'data/wh_muni_sequence.xml',
994 ],
995 'demo_xml': [],
996- 'test': [],
997+ 'test': [
998+ ],
999 'installable': True,
1000 'active': False,
1001 }
1002-
1003-
1004 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1005
1006=== modified file 'l10n_ve_withholding_muni/model/invoice.py'
1007--- l10n_ve_withholding_muni/model/invoice.py 2013-04-12 20:19:03 +0000
1008+++ l10n_ve_withholding_muni/model/invoice.py 2013-11-18 22:02:53 +0000
1009@@ -158,5 +158,3 @@
1010 readonly=True, help="Withholding muni."),
1011
1012 }
1013-
1014-account_invoice()
1015
1016=== modified file 'l10n_ve_withholding_muni/model/partner.py'
1017--- l10n_ve_withholding_muni/model/partner.py 2013-02-28 16:24:39 +0000
1018+++ l10n_ve_withholding_muni/model/partner.py 2013-11-18 22:02:53 +0000
1019@@ -26,7 +26,6 @@
1020
1021 from openerp.osv import fields, osv
1022
1023-
1024 class res_partner(osv.osv):
1025 _inherit = 'res.partner'
1026 _columns = {
1027@@ -50,6 +49,3 @@
1028 help="This account will be used credit local withholding amount"),
1029
1030 }
1031-
1032-
1033-res_partner()
1034
1035=== modified file 'l10n_ve_withholding_muni/model/wh_muni.py'
1036--- l10n_ve_withholding_muni/model/wh_muni.py 2013-06-11 21:12:31 +0000
1037+++ l10n_ve_withholding_muni/model/wh_muni.py 2013-11-18 22:02:53 +0000
1038@@ -23,14 +23,12 @@
1039 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1040 ##########################################################################
1041
1042-
1043 from openerp.osv import osv, fields
1044 import time
1045 from openerp.tools import config
1046 from openerp.tools.translate import _
1047 from openerp.addons import decimal_precision as dp
1048
1049-
1050 class account_wh_munici(osv.osv):
1051
1052 def _get_type(self, cr, uid, context=None):
1053@@ -96,9 +94,8 @@
1054 'munici_line_ids': fields.one2many('account.wh.munici.line', 'retention_id', 'Local withholding lines', readonly=True, states={'draft': [('readonly', False)]}, help="Invoices to will be made local withholdings"),
1055 'amount': fields.float('Amount', required=False, digits_compute=dp.get_precision('Withhold'), help="Amount withheld"),
1056 'move_id': fields.many2one('account.move', 'Account Entry', help='account entry for the invoice'),
1057-
1058-
1059 }
1060+
1061 _defaults = {
1062 'type': _get_type,
1063 'state': lambda *a: 'draft',
1064@@ -107,7 +104,6 @@
1065 'company_id': lambda self, cr, uid, context:
1066 self.pool.get('res.users').browse(cr, uid, uid,
1067 context=context).company_id.id,
1068-
1069 }
1070
1071 _sql_constraints = [
1072@@ -307,10 +303,6 @@
1073 super(account_wh_munici, self).unlink(cr, uid, ids, context=context)
1074 return True
1075
1076-
1077-account_wh_munici()
1078-
1079-
1080 class account_wh_munici_line(osv.osv):
1081
1082 def default_get(self, cr, uid, fields, context=None):
1083@@ -322,6 +314,7 @@
1084 uid, fields, context)
1085 self.munici_context = context
1086 return data
1087+
1088 # TODO
1089 # necesito crear el campo y tener la forma de calcular el monto del impuesto
1090 # munici retenido en la factura
1091@@ -376,6 +369,3 @@
1092
1093 total = res.amount_total
1094 return {'value': {'amount': total}}
1095-
1096-
1097-account_wh_munici_line()
1098
1099=== modified file 'l10n_ve_withholding_src/__openerp__.py'
1100--- l10n_ve_withholding_src/__openerp__.py 2013-04-18 21:03:12 +0000
1101+++ l10n_ve_withholding_src/__openerp__.py 2013-11-18 22:02:53 +0000
1102@@ -67,5 +67,5 @@
1103
1104 ],
1105 "active": False,
1106- "installable": True
1107+ "installable": True,
1108 }
1109
1110=== modified file 'l10n_ve_withholding_src/model/invoice.py'
1111--- l10n_ve_withholding_src/model/invoice.py 2013-11-04 20:34:17 +0000
1112+++ l10n_ve_withholding_src/model/invoice.py 2013-11-18 22:02:53 +0000
1113@@ -138,7 +138,7 @@
1114 @param date: current date
1115 @param name: description
1116 """
1117- if context is None: context = {}
1118+ context = context or {}
1119 res = super(account_invoice,self)._get_move_lines(cr, uid, ids, to_wh, period_id,
1120 pay_journal_id, writeoff_acc_id,
1121 writeoff_period_id, writeoff_journal_id, date,
1122@@ -166,7 +166,4 @@
1123 'currency_id': False,
1124 'name':name
1125 }))
1126-
1127 return res
1128-
1129-account_invoice()
1130
1131=== modified file 'l10n_ve_withholding_src/model/partner.py'
1132--- l10n_ve_withholding_src/model/partner.py 2013-04-23 15:15:12 +0000
1133+++ l10n_ve_withholding_src/model/partner.py 2013-11-18 22:02:53 +0000
1134@@ -38,4 +38,3 @@
1135 _defaults = {
1136 'wh_src_rate': lambda *a: 0,
1137 }
1138-res_partner()
1139
1140=== modified file 'l10n_ve_withholding_src/model/res_company.py'
1141--- l10n_ve_withholding_src/model/res_company.py 2013-03-01 10:53:41 +0000
1142+++ l10n_ve_withholding_src/model/res_company.py 2013-11-18 22:02:53 +0000
1143@@ -30,7 +30,6 @@
1144
1145 class res_company(osv.osv):
1146 _inherit = 'res.company'
1147-
1148 _columns = {
1149 'wh_src_collected_account_id': fields.many2one(
1150 'account.account',
1151@@ -51,5 +50,3 @@
1152 domain="[('type', '=', 'other')]",
1153 help="This account will be used when applying a withhold to a Customer"),
1154 }
1155-
1156-res_company()
1157
1158=== modified file 'l10n_ve_withholding_src/model/wh_src.py'
1159--- l10n_ve_withholding_src/model/wh_src.py 2013-06-11 21:03:55 +0000
1160+++ l10n_ve_withholding_src/model/wh_src.py 2013-11-18 22:02:53 +0000
1161@@ -155,14 +155,11 @@
1162 _defaults = {
1163 'state': lambda *a: 'draft',
1164 'currency_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id,
1165- 'journal_id':lambda self, cr, uid, context: \
1166- self._diario(cr, uid, uid, context),
1167+ 'journal_id': _diario,
1168 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
1169-
1170 }
1171
1172 _sql_constraints = [
1173-
1174 ]
1175
1176 def onchange_partner_id(self, cr, uid, ids, type, partner_id,context=None):
1177@@ -363,7 +360,6 @@
1178
1179
1180
1181-account_wh_src()
1182
1183 class account_wh_src_line(osv.osv):
1184
1185@@ -414,4 +410,3 @@
1186 }
1187 }
1188 return res
1189-account_wh_src_line()
1190
1191=== modified file 'ovl/__openerp__.py'
1192--- ovl/__openerp__.py 2013-11-14 06:07:44 +0000
1193+++ ovl/__openerp__.py 2013-11-18 22:02:53 +0000
1194@@ -87,5 +87,5 @@
1195 "images" : [],
1196 "auto_install": False,
1197 "application": True,
1198- "installable": True,
1199+ "installable": False,
1200 }