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: 1236 lines (+310/-178)
45 files modified
l10n_ve_fiscal_book/__openerp__.py (+1/-1)
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_generic/__openerp__.py (+1/-1)
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_vat_write_off/__openerp__.py (+1/-1)
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+195558@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.
930. By hbto [Vauxoo] http://www.vauxoo.com

[FIX][l10n_ve_split_invoice] Enabling & Scrambling split_invoice

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

[FIX][l10n_ve_generic] Enabling Module

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

[FIX][l10n_ve_fiscal_book] Enabling Module

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