Merge lp:~vauxoo/openerp-venezuela-localization/7.0-YAML-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-dev-hbto
Merge into: lp:openerp-venezuela-localization
Diff against target: 384 lines (+105/-51)
15 files modified
l10n_ve_fiscal_requirements/__openerp__.py (+8/-9)
l10n_ve_fiscal_requirements/test/fr_damaged.yml (+6/-3)
l10n_ve_split_invoice/__openerp__.py (+1/-1)
l10n_ve_withholding/__openerp__.py (+1/-1)
l10n_ve_withholding_islr/__openerp__.py (+1/-0)
l10n_ve_withholding_iva/__openerp__.py (+12/-12)
l10n_ve_withholding_iva/model/wh_iva.py (+1/-0)
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)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/7.0-YAML-dev-hbto
Reviewer Review Type Date Requested Status
Nhomar - Vauxoo Pending
Review via email: mp+195404@code.launchpad.net

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

Description of the change

Test YAML to OVL

To post a comment you must log in.
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :
Download full text (20.0 KiB)

Mergea de una vez men. Ya habia probado esto local.

Saludos

Aprobado

Written from my android
On Nov 15, 2013 10:46 AM, "hbto [Vauxoo] http://www.vauxoo.com" <
<email address hidden>> wrote:

> hbto [Vauxoo] http://www.vauxoo.com has proposed merging
> lp:~vauxoo/openerp-venezuela-localization/7.0-YAML-dev-hbto into
> lp:openerp-venezuela-localization.
>
> Requested reviews:
> Nhomar - Vauxoo (nhomar)
>
> For more details, see:
>
> https://code.launchpad.net/~vauxoo/openerp-venezuela-localization/7.0-YAML-dev-hbto/+merge/195404
>
> Test YAML to OVL
> --
>
> https://code.launchpad.net/~vauxoo/openerp-venezuela-localization/7.0-YAML-dev-hbto/+merge/195404
> You are requested to review the proposed merge of
> lp:~vauxoo/openerp-venezuela-localization/7.0-YAML-dev-hbto into
> lp:openerp-venezuela-localization.
>
> === modified file 'l10n_ve_fiscal_requirements/__openerp__.py'
> --- l10n_ve_fiscal_requirements/__openerp__.py 2013-09-18 23:55:08 +0000
> +++ l10n_ve_fiscal_requirements/__openerp__.py 2013-11-15 15:15:46 +0000
> @@ -91,15 +91,14 @@
> 'demo/journal_demo.xml',
> ],
> 'test': [
> -# 'test/control_number.yml',
> -# 'test/fr_sale_test.yml',
> -# 'test/fr_purchase_test.yml',
> -# 'test/fr_tax_except.yml',
> -# 'test/fr_address.yml',
> -# 'test/fr_vat_test.yml',
> -# 'test/fr_damaged.yml',
> -# 'test/fr_debit_note.yml',
> -# 'test/fr_refund_note.yml',
> + 'test/control_number.yml',
> + 'test/fr_sale_test.yml',
> + 'test/fr_purchase_test.yml',
> + 'test/fr_address.yml',
> + 'test/fr_vat_test.yml',
> + 'test/fr_damaged.yml',
> + 'test/fr_debit_note.yml',
> + 'test/fr_refund_note.yml',
> ],
> 'installable': True,
> 'active': False,
>
> === modified file 'l10n_ve_fiscal_requirements/test/fr_damaged.yml'
> --- l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-01-08
> 18:59:09 +0000
> +++ l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-11-15
> 15:15:46 +0000
> @@ -96,7 +96,7 @@
> l = cr.sql_log
> cr.sql_log = logger.isEnabledFor(logging.OFF)
> self.action_invoice_create(cr, uid, [], None, inv_brw)
> - assert False, 'Should not create damaged paper if account is not
> configured for allow cancelations'
> + assert False, 'Should not create damaged paper if journal is not
> configured for allow cancelations'
> except Exception:
> part_id = False
> cr.rollback = rollback
> @@ -104,10 +104,13 @@
> finally:
> cr.sql_log = l
> -
> - 6.12 Update journal to allow cancelation
> + 6.12 Update journals to allow cancelation
> -
> !python {model: account.journal}: |
> - self.write(cr, uid, [ref("account.sales_journal")], {'update_posted':
> True})
> + aj_ids = self.search(cr, uid, [('type', '=','sale')])
> + assert aj_ids, 'There are no Journals'
> +
> + self.write(cr, uid, aj_ids, {'update_posted': True})
> -
> 6.13 Verify that the journal was properly updated
> -
>
> === modified file 'l10n_ve_split_invoice/__openerp__.py'
> --- l10n_ve_split_invoice/__openerp__.py 2013-09-18 23:55:08 +0000
...

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

a mi me está saliendo un error,

voy a esperar,

a revisar que paso entre la revno 915 y 916

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

[MERGE] From Trunk

Unmerged revisions

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

[MERGE] From Trunk

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-09-18 23:55:08 +0000
3+++ l10n_ve_fiscal_requirements/__openerp__.py 2013-11-15 20:20:15 +0000
4@@ -91,15 +91,14 @@
5 'demo/journal_demo.xml',
6 ],
7 'test': [
8-# 'test/control_number.yml',
9-# 'test/fr_sale_test.yml',
10-# 'test/fr_purchase_test.yml',
11-# 'test/fr_tax_except.yml',
12-# 'test/fr_address.yml',
13-# 'test/fr_vat_test.yml',
14-# 'test/fr_damaged.yml',
15-# 'test/fr_debit_note.yml',
16-# 'test/fr_refund_note.yml',
17+ 'test/control_number.yml',
18+ 'test/fr_sale_test.yml',
19+ 'test/fr_purchase_test.yml',
20+ 'test/fr_address.yml',
21+ 'test/fr_vat_test.yml',
22+ 'test/fr_damaged.yml',
23+ 'test/fr_debit_note.yml',
24+ 'test/fr_refund_note.yml',
25 ],
26 'installable': True,
27 'active': False,
28
29=== modified file 'l10n_ve_fiscal_requirements/test/fr_damaged.yml'
30--- l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-01-08 18:59:09 +0000
31+++ l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-11-15 20:20:15 +0000
32@@ -96,7 +96,7 @@
33 l = cr.sql_log
34 cr.sql_log = logger.isEnabledFor(logging.OFF)
35 self.action_invoice_create(cr, uid, [], None, inv_brw)
36- assert False, 'Should not create damaged paper if account is not configured for allow cancelations'
37+ assert False, 'Should not create damaged paper if journal is not configured for allow cancelations'
38 except Exception:
39 part_id = False
40 cr.rollback = rollback
41@@ -104,10 +104,13 @@
42 finally:
43 cr.sql_log = l
44 -
45- 6.12 Update journal to allow cancelation
46+ 6.12 Update journals to allow cancelation
47 -
48 !python {model: account.journal}: |
49- self.write(cr, uid, [ref("account.sales_journal")], {'update_posted': True})
50+ aj_ids = self.search(cr, uid, [('type', '=','sale')])
51+ assert aj_ids, 'There are no Journals'
52+
53+ self.write(cr, uid, aj_ids, {'update_posted': True})
54 -
55 6.13 Verify that the journal was properly updated
56 -
57
58=== modified file 'l10n_ve_split_invoice/__openerp__.py'
59--- l10n_ve_split_invoice/__openerp__.py 2013-09-18 23:55:08 +0000
60+++ l10n_ve_split_invoice/__openerp__.py 2013-11-15 20:20:15 +0000
61@@ -55,7 +55,7 @@
62 "view/company_view.xml",
63 ],
64 'test': [
65-# 'test/spl_test.yml',
66+ 'test/spl_test.yml',
67 ],
68 "active": False,
69 "installable": True,
70
71=== modified file 'l10n_ve_withholding/__openerp__.py'
72--- l10n_ve_withholding/__openerp__.py 2013-09-18 23:55:08 +0000
73+++ l10n_ve_withholding/__openerp__.py 2013-11-15 20:20:15 +0000
74@@ -49,7 +49,7 @@
75 ],
76 'demo_xml': [],
77 'test': [
78-# 'test/wh_pay_invoice.yml'
79+ 'test/wh_pay_invoice.yml'
80 ],
81 'installable': True,
82 'active': False,
83
84=== modified file 'l10n_ve_withholding_islr/__openerp__.py'
85--- l10n_ve_withholding_islr/__openerp__.py 2013-09-18 23:55:08 +0000
86+++ l10n_ve_withholding_islr/__openerp__.py 2013-11-15 20:20:15 +0000
87@@ -67,6 +67,7 @@
88 #"edi/islr_wh_doc_action_data.xml",
89 ],
90 'test': [
91+# 'test/fr_tax_except.yml',
92 # 'test/test.yml',
93 # 'test/test_sale.yml',
94 # 'test/test_notax.yml',
95
96=== modified file 'l10n_ve_withholding_iva/__openerp__.py'
97--- l10n_ve_withholding_iva/__openerp__.py 2013-09-18 23:55:08 +0000
98+++ l10n_ve_withholding_iva/__openerp__.py 2013-11-15 20:20:15 +0000
99@@ -63,18 +63,18 @@
100 ],
101 'demo_xml': ["demo/l10n_ve_withholding_iva_demo.xml"],
102 'test': [
103-# 'test/iva_purchase.yml',
104-# 'test/iva_purchase_wh.yml',
105-# 'test/iva_purchase_nret1.yml',
106-# 'test/iva_purchase_nret2.yml',
107-# 'test/iva_purchase_nret3.yml',
108-# 'test/iva_sale.yml',
109-# 'test/iva_sale_wh.yml',
110-# 'test/iva_test_invoice.yml',
111-# 'test/iva_test_wh.yml',
112-# 'test/iva_test_wh_2.yml',
113-# 'test/iva_test_wh_3.yml',
114-# 'test/iva_test_wh_4.yml',
115+ 'test/iva_purchase.yml',
116+ 'test/iva_purchase_wh.yml',
117+ 'test/iva_purchase_nret1.yml',
118+ 'test/iva_purchase_nret2.yml',
119+ 'test/iva_purchase_nret3.yml',
120+ 'test/iva_sale.yml',
121+ 'test/iva_sale_wh.yml',
122+ 'test/iva_test_invoice.yml',
123+ 'test/iva_test_wh.yml',
124+ 'test/iva_test_wh_2.yml',
125+ 'test/iva_test_wh_3.yml',
126+ 'test/iva_test_wh_4.yml',
127 ],
128 'installable': True,
129 'active': False,
130
131=== modified file 'l10n_ve_withholding_iva/model/wh_iva.py'
132--- l10n_ve_withholding_iva/model/wh_iva.py 2013-07-23 14:23:34 +0000
133+++ l10n_ve_withholding_iva/model/wh_iva.py 2013-11-15 20:20:15 +0000
134@@ -725,6 +725,7 @@
135 fortnight_str = {'True': ' - Second Fortnight)',
136 'False': ' - First Fortnight)'}
137 for awi_brw in self.browse(cr, uid, ids, context=context):
138+ if not awi_brw.wh_lines: return False
139 if awi_brw.type in ['out_invoice']: return True
140 for awil_brw in awi_brw.wh_lines:
141 awil_period_id, awil_fortnight = per_obj.find_fortnight(
142
143=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret1.yml'
144--- l10n_ve_withholding_iva/test/iva_purchase_nret1.yml 2013-01-15 15:16:32 +0000
145+++ l10n_ve_withholding_iva/test/iva_purchase_nret1.yml 2013-11-15 20:20:15 +0000
146@@ -32,7 +32,7 @@
147 date_invoice: !eval time.strftime('%Y-%m-%d')
148 partner_id: base.res_partner_23
149 reference_type: none
150- journal_id: account.sales_journal
151+ journal_id: account.expenses_journal
152 wh_iva: True
153 invoice_line:
154 - product_id: product.product_product_3
155
156=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret2.yml'
157--- l10n_ve_withholding_iva/test/iva_purchase_nret2.yml 2013-01-15 15:16:32 +0000
158+++ l10n_ve_withholding_iva/test/iva_purchase_nret2.yml 2013-11-15 20:20:15 +0000
159@@ -42,7 +42,7 @@
160 date_invoice: !eval time.strftime('%Y-%m-%d')
161 partner_id: base.res_partner_23
162 reference_type: none
163- journal_id: account.sales_journal
164+ journal_id: account.expenses_journal
165 wh_iva: True
166 invoice_line:
167 - product_id: product.product_product_3
168
169=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret3.yml'
170--- l10n_ve_withholding_iva/test/iva_purchase_nret3.yml 2013-01-15 15:16:32 +0000
171+++ l10n_ve_withholding_iva/test/iva_purchase_nret3.yml 2013-11-15 20:20:15 +0000
172@@ -52,7 +52,7 @@
173 date_invoice: !eval time.strftime('%Y-%m-%d')
174 partner_id: base.res_partner_23
175 reference_type: none
176- journal_id: account.sales_journal
177+ journal_id: account.expenses_journal
178 wh_iva: True
179 invoice_line:
180 - product_id: product.product_product_3
181
182=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_wh.yml'
183--- l10n_ve_withholding_iva/test/iva_purchase_wh.yml 2013-01-15 15:16:32 +0000
184+++ l10n_ve_withholding_iva/test/iva_purchase_wh.yml 2013-11-15 20:20:15 +0000
185@@ -26,13 +26,14 @@
186 -
187 2.4 I create a purchase invoice
188 -
189- !record {model: account.invoice, id: test_purchase_iva02}:
190- type: out_invoice
191+ !record {model: account.invoice, id: test_purchase_iva02, view: account.invoice_supplier_form, context:{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}}:
192+ type: in_invoice
193+ state: draft
194 company_id: base.main_company
195 date_invoice: !eval time.strftime('%Y-%m-%d')
196 partner_id: base.res_partner_23
197 reference_type: none
198- journal_id: account.sales_journal
199+ journal_id:
200 wh_iva: True
201 invoice_line:
202 - product_id: product.product_product_3
203@@ -50,10 +51,19 @@
204 invoice_line_tax_id:
205 - l10n_ve_fiscal_requirements.iva_purchase1
206 -
207- 2.5 I check that Initially customer invoice is in the "Draft" state
208+ 2.5 I check that Initially supplier invoice is in the "Draft" state
209 -
210- !assert {model: account.invoice, id: test_purchase_iva02}:
211- - state == 'draft'
212+ !python {model: account.invoice}: |
213+ ap_obj=self.pool.get('account.period')
214+ import time
215+ period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})
216+ assert period, 'There aren\'t periods for this date'
217+ ap_obj.write(cr, uid, period, {'special':False})
218+ self.write(cr,uid,ref('test_purchase_iva02'),{'journal_id':ref('account.expenses_journal'),'type':'in_invoice'})
219+ ai_brw = self.browse(cr,uid,ref('test_purchase_iva02'))
220+ assert ai_brw.type == 'in_invoice', "Not the intended type. It should be 'in_invoice' not '%s'"%ai_brw.type
221+ assert ai_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%ai_brw.state
222+ 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
223 -
224 2.6 I change the state of invoice to "Proforma2" by clicking PRO-FORMA button
225 -
226@@ -76,6 +86,7 @@
227 2.10 Set control number for the invoice
228 -
229 !python {model: account.invoice}: |
230- self.write(cr, uid, [ref("test_purchase_iva02")], {'nro_ctrl':'iva002', 'journal_id':ref("account.expenses_journal")})
231+ self.write(cr, uid, [ref("test_purchase_iva02")], {'nro_ctrl':'iva002'})
232 ai_brw = self.browse(cr, uid, ref("test_purchase_iva02"))
233- assert ai_brw.nro_ctrl=='iva002' and ai_brw.journal_id.id == ref("account.expenses_journal"), 'Invoice wasn\'t updated properly'
234+ assert ai_brw.nro_ctrl=='iva002', "Not the intended Control Number. It should be 'iva002' not '%s'"%ai_brw.nro_ctrl
235+ 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
236
237=== modified file 'l10n_ve_withholding_iva/test/iva_sale_wh.yml'
238--- l10n_ve_withholding_iva/test/iva_sale_wh.yml 2013-01-17 19:19:09 +0000
239+++ l10n_ve_withholding_iva/test/iva_sale_wh.yml 2013-11-15 20:20:15 +0000
240@@ -109,11 +109,13 @@
241 ap_obj=self.pool.get('account.period')
242 period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})
243 assert period, 'There aren\'t periods for this date'
244+ ap_obj.write(cr, uid, period, {'special':False})
245 ap_brw = ap_obj.browse(cr, uid, period[0])
246 if ap_brw.state == 'done':
247 ap.action_draft(cr, uid, period)
248 ap_brw = ap.browse(cr, uid, period[0])
249 assert ap_brw.state == 'draft', 'Period is not open as it should be'
250+ assert ap_brw.special == False, 'Period is special. It should be'
251
252 self.write(cr, uid, ref("wh_iva_sale01"), {'period_id':period[0]})
253 -
254
255=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_2.yml'
256--- l10n_ve_withholding_iva/test/iva_test_wh_2.yml 2013-01-18 19:55:38 +0000
257+++ l10n_ve_withholding_iva/test/iva_test_wh_2.yml 2013-11-15 20:20:15 +0000
258@@ -10,28 +10,55 @@
259 -
260 10.2 I generate a withholding vat customer
261 -
262- !record {model: account.wh.iva, id: wh_iva_test02}:
263+ !record {model: account.wh.iva, id: wh_iva_test02, view: view_wh_iva_form_customer, context: {'type':'out_invoice'}}:
264 journal_id: wh_sales_journal
265 partner_id: base.res_partner_23
266 number: 222444333000
267 account_id: account.a_recv
268 name: 'IVA wh vat customer Vauxoo test 2'
269 type: out_invoice
270+ state: draft
271 -
272 10.3 I check withholding vat customer
273 -
274- !assert {model: account.wh.iva, id: wh_iva_test02, string: Wh was not saved}:
275- - state == 'draft'
276+ !python {model: account.wh.iva}: |
277+ values = {}
278+ rp_obj = self.pool.get('res.partner')
279+ rp_brw = rp_obj.browse(cr,uid,ref("base.res_partner_23"))
280+ res = self.onchange_partner_id(cr, uid, [ref('wh_iva_test02')], 'out_invoice', rp_brw.id)
281+ values['wh_lines'] = [(0,0,{'invoice_id':ref('test_iva01'), 'name':'N/A', 'wh_iva_rate':rp_brw.wh_iva_rate})]
282+ values['account_id'] = res['value']['account_id']
283+ values['type'] = 'out_invoice'
284+ self.write(cr,uid,ref('wh_iva_test02'),values)
285+ awi_brw = self.browse(cr,uid,ref('wh_iva_test02'))
286+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
287+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
288+ assert awi_brw.wh_lines, "There are no lines to withhold"
289+ self.compute_amount_wh(cr,uid,[ref('wh_iva_test02')])
290 -
291 10.4 I confirm the withholding vat customer
292 -
293- !workflow {model: account.wh.iva, action: wh_iva_confirmed, ref: wh_iva_test02}
294+ !python {model: account.wh.iva}: |
295+ import netsvc
296+ from openerp.osv import osv
297+ wf_service = netsvc.LocalService("workflow")
298+ try:
299+ self.check_wh_lines_fortnights(cr, uid, [ref('wh_iva_test02')])
300+ self.check_invoice_nro_ctrl(cr, uid, [ref('wh_iva_test02')])
301+ self.check_vat_wh(cr, uid, [ref('wh_iva_test02')])
302+ self.check_wh_taxes(cr, uid, [ref('wh_iva_test02')])
303+ self.check_wh_taxes(cr, uid, [ref('wh_iva_test02')])
304+ assert False, "An exception should have been raised, unwithholdable taxes are not allowed to reach here!"
305+ except osv.except_osv:
306+ # exception was raised as expected
307+ pass
308 -
309 10.5 I check withholding vat is not confirmed
310 # TODO: Check this test case, it fails. It means that something in the wh_iva_confirmed action is wrong.
311 -
312- !assert {model: account.wh.iva, id: wh_iva_test02, string: Could not confirm the wh}:
313- - state != 'confirmed'
314+ !python {model: account.wh.iva}: |
315+ awi_brw = self.browse(cr,uid,ref('wh_iva_test02'))
316+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
317 -
318 10.6 I try to mark it as done
319 -
320
321=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_3.yml'
322--- l10n_ve_withholding_iva/test/iva_test_wh_3.yml 2013-01-18 19:55:38 +0000
323+++ l10n_ve_withholding_iva/test/iva_test_wh_3.yml 2013-11-15 20:20:15 +0000
324@@ -16,11 +16,15 @@
325 account_id: account.a_recv
326 name: 'IVA wh vat customer Vauxoo test 3'
327 type: out_invoice
328+ state: draft
329 -
330 11.3 I check withholding vat customer
331 -
332- !assert {model: account.wh.iva, id: wh_iva_test03, string: Wh was not saved}:
333- - state == 'draft'
334+ !python {model: account.wh.iva}: |
335+ self.write(cr,uid,ref('wh_iva_test03'),{'type':'out_invoice'})
336+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
337+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
338+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
339 -
340 11.4 Before validating let's add the period
341 -
342@@ -43,8 +47,9 @@
343 11.7 I check withholding vat is not confirmed
344 # TODO: Check this test case, it fails. It means that something in the wh_iva_confirmed action is wrong.
345 -
346- !assert {model: account.wh.iva, id: wh_iva_test03, string: Could not confirm the wh}:
347- - state != 'confirmed'
348+ !python {model: account.wh.iva}: |
349+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
350+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
351 -
352 11.8 I try to mark it as done
353 -
354@@ -52,5 +57,6 @@
355 -
356 11.9 I check withholding vat is not done
357 -
358- !assert {model: account.wh.iva, id: wh_iva_test01, string: Wh cannot be in done state}:
359- - state != 'done'
360+ !python {model: account.wh.iva}: |
361+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
362+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
363
364=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_4.yml'
365--- l10n_ve_withholding_iva/test/iva_test_wh_4.yml 2013-01-18 19:55:38 +0000
366+++ l10n_ve_withholding_iva/test/iva_test_wh_4.yml 2013-11-15 20:20:15 +0000
367@@ -16,11 +16,15 @@
368 account_id: account.a_recv
369 name: 'IVA wh vat customer Vauxoo test 3'
370 type: out_invoice
371+ state: draft
372 -
373 12.3 I check withholding vat customer
374 -
375- !assert {model: account.wh.iva, id: wh_iva_test04, string: Wh was not saved}:
376- - state == 'draft'
377+ !python {model: account.wh.iva}: |
378+ self.write(cr,uid,ref('wh_iva_test04'),{'type':'out_invoice'})
379+ awi_brw = self.browse(cr,uid,ref('wh_iva_test04'))
380+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
381+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
382 -
383 12.4 Before validating let's add the period
384 -