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: 700 lines (+196/-99)
28 files modified
l10n_ve_fiscal_book/__openerp__.py (+1/-1)
l10n_ve_fiscal_requirements/__openerp__.py (+11/-10)
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/__openerp__.py (+1/-1)
l10n_ve_sale_purchase/__openerp__.py (+1/-1)
l10n_ve_split_invoice/__openerp__.py (+1/-1)
l10n_ve_vat_write_off/__openerp__.py (+1/-1)
l10n_ve_withholding/model/invoice.py (+2/-16)
l10n_ve_withholding_islr/__openerp__.py (+1/-1)
l10n_ve_withholding_iva/__openerp__.py (+13/-13)
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)
l10n_ve_withholding_muni/__openerp__.py (+1/-1)
l10n_ve_withholding_src/__openerp__.py (+1/-1)
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+195531@code.launchpad.net

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

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

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

[FIX][l10n_ve_withholding] Cleansing

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

[FIX][l10n_ve_withholding] Enabling Module & Disabling Test for Module

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

[IMP][l10n_ve_withholding] Enabled & Added, checking invoice and taxes are OK

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

[MERGE][l10n_ve_withholding_muni] Cleansing & Enabling Module

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

[MERGE][l10n_ve_withholding_islr] Cleansing & Enabling Module

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

[MERGE][l10n_ve_withholding_src] Cleansing & Enabling Module

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

[MERGE][l10n_ve_withholding_iva] Cleansing & Enabling Module, and Restricting Test

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

[MERGE][l10n_ve_withholding_iva] From lp:~vauxoo/openerp-venezuela-localization/7.0-fixing-demo

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

[FIX] Fixing demo data

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

[FIX][l10n_ve_imex] Enabling Module

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 00:07:54 +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 00:07:54 +0000
15@@ -91,20 +91,21 @@
16 'demo/demo_partners.xml',
17 'demo/journal_demo.xml',
18 'demo/demo_invoice.xml',
19- 'demo/demo_taxes.yml',
20+# 'demo/demo_taxes.yml',
21 ],
22 'test': [
23- 'test/control_number.yml',
24- 'test/fr_sale_test.yml',
25- 'test/fr_purchase_test.yml',
26- 'test/fr_address.yml',
27- 'test/fr_vat_test.yml',
28- 'test/fr_damaged.yml',
29- 'test/fr_debit_note.yml',
30- 'test/fr_refund_note.yml',
31+ 'test/account_customer_invoice.yml',
32+ 'test/account_supplier_invoice.yml',
33+# 'test/control_number.yml',
34+# 'test/fr_sale_test.yml',
35+# 'test/fr_purchase_test.yml',
36+# 'test/fr_address.yml',
37+# 'test/fr_vat_test.yml',
38+# 'test/fr_damaged.yml',
39+# 'test/fr_debit_note.yml',
40+# 'test/fr_refund_note.yml',
41 ],
42 'installable': True,
43 'active': False,
44 }
45
46-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
47
48=== modified file 'l10n_ve_fiscal_requirements/model/account.py'
49--- l10n_ve_fiscal_requirements/model/account.py 2013-02-13 19:39:18 +0000
50+++ l10n_ve_fiscal_requirements/model/account.py 2013-11-18 00:07:54 +0000
51@@ -24,9 +24,6 @@
52 ################################################################################
53
54 from openerp.osv import fields, osv
55-__TYPES__ = [('sale_debit', 'Sale Debit'),('purchase_debit', 'Purchase Debit')]
56-
57-__HELP__= " Select 'Sale Debit' for customer debit note journals. Select 'Purchase Debit' for supplier debit note journals."
58
59 class account_journal(osv.osv):
60 _inherit = 'account.journal'
61@@ -45,5 +42,3 @@
62 " Select 'Sale Debit' for customer debit note journals."\
63 " Select 'Purchase Debit' for supplier debit note journals.")
64 }
65-
66-account_journal()
67
68=== modified file 'l10n_ve_fiscal_requirements/model/invoice.py'
69--- l10n_ve_fiscal_requirements/model/invoice.py 2013-06-01 18:58:59 +0000
70+++ l10n_ve_fiscal_requirements/model/invoice.py 2013-11-18 00:07:54 +0000
71@@ -33,21 +33,18 @@
72 it does not exist, return false
73 """
74
75- if context is None:
76- context = {}
77- journal_type_inv = context.get('journal_type', 'sale')
78-
79- if journal_type_inv in ('sale_debit', 'purchase_debit'):
80+ context = context or {}
81+ res = super(account_invoice, self)._get_journal(cr, uid, context=context)
82+ if res: return res
83+ type_inv = context.get('type', 'sale')
84+ if type_inv in ('sale_debit', 'purchase_debit'):
85 user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
86 company_id = context.get('company_id', user.company_id.id)
87 journal_obj = self.pool.get('account.journal')
88- res = journal_obj.search(cr, uid, [('type', '=',journal_type_inv),
89- ('company_id', '=', company_id)],
90- limit=1)
91- return res and res[0] or False
92- else:
93- return super(account_invoice, self)._get_journal(cr, uid, context=context)
94-
95+ domain = [('company_id', '=', company_id),('type', '=',type_inv)]
96+ res = journal_obj.search(cr, uid, domain, limit=1)
97+ return res and res[0] or False
98+
99 def _unique_invoice_per_partner(self, cr, uid, ids, context=None):
100 """ Return false when it is found
101 that the bill is not out_invoice or out_refund,
102@@ -118,6 +115,17 @@
103 'child_ids':[],
104 'nro_ctrl':None,
105 'supplier_invoice_number':None,
106+ 'sin_cred': False,
107+ # No cleaned in this copy because it is related to the previous
108+ # document, if previous document says so this too
109+ # 'parent_id':False,
110+ 'date_document': False,
111+ 'invoice_printer' : '',
112+ 'fiscal_printer' : '',
113+ # No cleaned in this copy because it is related to the previous
114+ # document, if previous document says so this too
115+ #'loc_req':False,
116+ 'z_report': '',
117 })
118 return super(account_invoice, self).copy(cr, uid, id, default, context)
119
120@@ -129,9 +137,6 @@
121 return super(account_invoice, self).write(cr, uid, ids, vals,
122 context=context)
123
124-account_invoice()
125-
126-
127 class account_invoice_tax(osv.osv):
128 _inherit = 'account.invoice.tax'
129 _columns = {
130@@ -139,6 +144,4 @@
131 help="Tax relation to original tax, to be able to take off all data from invoices."),
132 }
133
134-account_invoice_tax()
135-
136 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
137
138=== modified file 'l10n_ve_fiscal_requirements/model/partner.py'
139--- l10n_ve_fiscal_requirements/model/partner.py 2013-11-16 04:03:30 +0000
140+++ l10n_ve_fiscal_requirements/model/partner.py 2013-11-18 00:07:54 +0000
141@@ -308,5 +308,4 @@
142 # force full VIES online check
143 self.update_rif(cr, uid, ids, context=context)
144 return True
145-res_partner()
146 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
147
148=== added file 'l10n_ve_fiscal_requirements/test/account_customer_invoice.yml'
149--- l10n_ve_fiscal_requirements/test/account_customer_invoice.yml 1970-01-01 00:00:00 +0000
150+++ l10n_ve_fiscal_requirements/test/account_customer_invoice.yml 2013-11-18 00:07:54 +0000
151@@ -0,0 +1,29 @@
152+-
153+ In order to test account invoice I create a new customer invoice
154+-
155+ I set the context that will be used for the encoding of all the invoices of this file
156+-
157+ !context
158+ 'type': 'out_invoice'
159+-
160+ I create a customer invoice
161+-
162+ !record {model: account.invoice, id: account_invoice_customer0, view: account.invoice_form}:
163+ payment_term: account.account_payment_term_advance
164+ journal_id: account.sales_journal
165+ partner_id: base.res_partner_3
166+ reference_type: none
167+ name: 'Test Customer Invoice - l10n_ve_fiscal_requirements'
168+ invoice_line:
169+ - product_id: product.product_product_5
170+ quantity: 10.0
171+-
172+ I check that Initially customer invoice state is "Draft"
173+-
174+ !assert {model: account.invoice, id: account_invoice_customer0}:
175+ - state == 'draft'
176+-
177+ I check that the customer invoice is a "Customer Invoice"
178+-
179+ !assert {model: account.invoice, id: account_invoice_customer0, string: This is not a customer invoice}:
180+ - type == 'out_invoice'
181
182=== added file 'l10n_ve_fiscal_requirements/test/account_supplier_invoice.yml'
183--- l10n_ve_fiscal_requirements/test/account_supplier_invoice.yml 1970-01-01 00:00:00 +0000
184+++ l10n_ve_fiscal_requirements/test/account_supplier_invoice.yml 2013-11-18 00:07:54 +0000
185@@ -0,0 +1,35 @@
186+-
187+ In order to test account invoice I create a new supplier invoice
188+-
189+ I set the context that will be used for the encoding of all the invoices of this file
190+-
191+ !context
192+ 'type': 'in_invoice'
193+-
194+ I create a supplier invoice
195+-
196+ !record {model: account.invoice, id: account_invoice_supplier0, view: account.invoice_supplier_form }:
197+ account_id: account.a_pay
198+ company_id: base.main_company
199+ currency_id: base.EUR
200+ invoice_line:
201+ - account_id: account.a_expense
202+ name: '[PCSC234] PC Assemble SC234'
203+ price_unit: 300.0
204+ product_id: product.product_product_3
205+ quantity: 10.0
206+ uos_id: product.product_uom_unit
207+ journal_id: account.expenses_journal
208+ partner_id: base.res_partner_12
209+ reference_type: none
210+ type: 'in_invoice'
211+-
212+ I check that Initially supplier invoice state is "Draft"
213+-
214+ !assert {model: account.invoice, id: account_invoice_supplier0}:
215+ - state == 'draft'
216+-
217+ I check that the supplier invoice is a "Supplier Invoice"
218+-
219+ !assert {model: account.invoice, id: account_invoice_supplier0, string: This is not a supplier invoice}:
220+ - type == 'in_invoice'
221
222=== modified file 'l10n_ve_fiscal_requirements/test/fr_damaged.yml'
223--- l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-11-14 20:14:21 +0000
224+++ l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-11-18 00:07:54 +0000
225@@ -109,7 +109,6 @@
226 !python {model: account.journal}: |
227 aj_ids = self.search(cr, uid, [('type', '=','sale')])
228 assert aj_ids, 'There are no Journals'
229-
230 self.write(cr, uid, aj_ids, {'update_posted': True})
231 -
232 6.13 Verify that the journal was properly updated
233@@ -171,4 +170,3 @@
234 pass
235 finally:
236 cr.sql_log = l
237-
238
239=== modified file 'l10n_ve_generic/__openerp__.py'
240--- l10n_ve_generic/__openerp__.py 2012-09-24 12:47:27 +0000
241+++ l10n_ve_generic/__openerp__.py 2013-11-18 00:07:54 +0000
242@@ -39,7 +39,7 @@
243 "update_xml" : ['account_tax_code.xml',"account_chart.xml",
244 'account_tax.xml','l10n_chart_ve_wizard.xml'],
245 "auto_install": False,
246- "installable": True,
247+ "installable": False,
248 'images': ['images/config_chart_l10n_ve.jpeg','images/l10n_ve_chart.jpeg'],
249 }
250 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
251
252=== modified file 'l10n_ve_imex/__openerp__.py'
253--- l10n_ve_imex/__openerp__.py 2013-04-29 16:31:11 +0000
254+++ l10n_ve_imex/__openerp__.py 2013-11-18 00:07:54 +0000
255@@ -55,5 +55,5 @@
256 'workflow/customs_form.xml',
257 ],
258 "active": False,
259- "installable": True,
260+ "installable": False,
261 }
262
263=== modified file 'l10n_ve_sale_purchase/__openerp__.py'
264--- l10n_ve_sale_purchase/__openerp__.py 2013-09-18 23:55:08 +0000
265+++ l10n_ve_sale_purchase/__openerp__.py 2013-11-18 00:07:54 +0000
266@@ -41,7 +41,7 @@
267 ],
268 'demo' : [],
269 'active' : False,
270- 'installable': True,
271+ 'installable': False,
272 'test': [
273 # 'test/purchase_order.yml',
274 # 'test/purchase_picking.yml',
275
276=== modified file 'l10n_ve_split_invoice/__openerp__.py'
277--- l10n_ve_split_invoice/__openerp__.py 2013-11-14 20:44:23 +0000
278+++ l10n_ve_split_invoice/__openerp__.py 2013-11-18 00:07:54 +0000
279@@ -58,5 +58,5 @@
280 'test/spl_test.yml',
281 ],
282 "active": False,
283- "installable": True,
284+ "installable": False,
285 }
286
287=== modified file 'l10n_ve_vat_write_off/__openerp__.py'
288--- l10n_ve_vat_write_off/__openerp__.py 2013-05-02 17:01:41 +0000
289+++ l10n_ve_vat_write_off/__openerp__.py 2013-11-18 00:07:54 +0000
290@@ -13,6 +13,6 @@
291 "view/l10n_ve_vat_write_off.xml",
292 ],
293 "active": False,
294- "installable": True,
295+ "installable": False,
296 }
297
298
299=== modified file 'l10n_ve_withholding/model/invoice.py'
300--- l10n_ve_withholding/model/invoice.py 2013-04-12 20:19:03 +0000
301+++ l10n_ve_withholding/model/invoice.py 2013-11-18 00:07:54 +0000
302@@ -28,11 +28,9 @@
303 from openerp.addons import decimal_precision as dp
304 from openerp.tools.translate import _
305
306-
307 class account_invoice(osv.osv):
308 _inherit = 'account.invoice'
309
310-
311 def _get_move_lines(self, cr, uid, ids, to_wh, period_id,
312 pay_journal_id, writeoff_acc_id,
313 writeoff_period_id, writeoff_journal_id, date,
314@@ -42,7 +40,7 @@
315 """
316 if context is None: context = {}
317 return []
318-
319+
320 def ret_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id,
321 period_id, pay_journal_id, writeoff_acc_id,
322 writeoff_period_id, writeoff_journal_id, date,
323@@ -105,7 +103,6 @@
324 self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context)
325 return {'move_id': move_id}
326
327-
328 def ret_payment_get(self, cr, uid, ids, *args):
329 """ Return payments associated with this bill
330 """
331@@ -127,10 +124,7 @@
332 lines = filter(lambda x: x not in src, lines)
333
334 return lines
335-
336-
337-
338-
339+
340 def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj):
341 """ Check if no tax lines are created. If
342 existing tax lines, there are checks on the invoice
343@@ -157,11 +151,6 @@
344 if not key in tax_key:
345 raise osv.except_osv(_('Warning !'), _('Taxes missing !'))
346
347-account_invoice()
348-
349-
350-
351-
352 class account_invoice_tax(osv.osv):
353 _inherit = 'account.invoice.tax'
354 _columns = {
355@@ -223,6 +212,3 @@
356 t['base_amount'] = cur_obj.round(cr, uid, cur, t['base_amount'])
357 t['tax_amount'] = cur_obj.round(cr, uid, cur, t['tax_amount'])
358 return tax_grouped
359-
360-
361-account_invoice_tax()
362
363=== modified file 'l10n_ve_withholding_islr/__openerp__.py'
364--- l10n_ve_withholding_islr/__openerp__.py 2013-11-14 20:14:21 +0000
365+++ l10n_ve_withholding_islr/__openerp__.py 2013-11-18 00:07:54 +0000
366@@ -74,5 +74,5 @@
367 # 'test/test_duplicate.yml',
368 ],
369 "active": False,
370- "installable": True
371+ "installable": False,
372 }
373
374=== modified file 'l10n_ve_withholding_iva/__openerp__.py'
375--- l10n_ve_withholding_iva/__openerp__.py 2013-11-17 02:03:44 +0000
376+++ l10n_ve_withholding_iva/__openerp__.py 2013-11-18 00:07:54 +0000
377@@ -72,20 +72,20 @@
378 ],
379
380 'test': [
381-# 'test/iva_purchase.yml',
382-# 'test/iva_purchase_wh.yml',
383-# 'test/iva_purchase_nret1.yml',
384-# 'test/iva_purchase_nret2.yml',
385-# 'test/iva_purchase_nret3.yml',
386-# 'test/iva_sale.yml',
387-# 'test/iva_sale_wh.yml',
388-# 'test/iva_test_invoice.yml',
389-# 'test/iva_test_wh.yml',
390-# 'test/iva_test_wh_2.yml',
391-# 'test/iva_test_wh_3.yml',
392-# 'test/iva_test_wh_4.yml',
393+ 'test/iva_purchase.yml',
394+ 'test/iva_purchase_wh.yml',
395+ 'test/iva_purchase_nret1.yml',
396+ 'test/iva_purchase_nret2.yml',
397+ 'test/iva_purchase_nret3.yml',
398+ 'test/iva_sale.yml',
399+ 'test/iva_sale_wh.yml',
400+ 'test/iva_test_invoice.yml',
401+ 'test/iva_test_wh.yml',
402+ 'test/iva_test_wh_2.yml',
403+ 'test/iva_test_wh_3.yml',
404+ 'test/iva_test_wh_4.yml',
405 ],
406- 'installable': True,
407+ 'installable': False,
408 'active': False,
409 }
410
411
412=== modified file 'l10n_ve_withholding_iva/model/wh_iva.py'
413--- l10n_ve_withholding_iva/model/wh_iva.py 2013-07-23 14:23:34 +0000
414+++ l10n_ve_withholding_iva/model/wh_iva.py 2013-11-18 00:07:54 +0000
415@@ -725,6 +725,7 @@
416 fortnight_str = {'True': ' - Second Fortnight)',
417 'False': ' - First Fortnight)'}
418 for awi_brw in self.browse(cr, uid, ids, context=context):
419+ if not awi_brw.wh_lines: return False
420 if awi_brw.type in ['out_invoice']: return True
421 for awil_brw in awi_brw.wh_lines:
422 awil_period_id, awil_fortnight = per_obj.find_fortnight(
423
424=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret1.yml'
425--- l10n_ve_withholding_iva/test/iva_purchase_nret1.yml 2013-01-15 15:16:32 +0000
426+++ l10n_ve_withholding_iva/test/iva_purchase_nret1.yml 2013-11-18 00:07:54 +0000
427@@ -32,7 +32,7 @@
428 date_invoice: !eval time.strftime('%Y-%m-%d')
429 partner_id: base.res_partner_23
430 reference_type: none
431- journal_id: account.sales_journal
432+ journal_id: account.expenses_journal
433 wh_iva: True
434 invoice_line:
435 - product_id: product.product_product_3
436
437=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret2.yml'
438--- l10n_ve_withholding_iva/test/iva_purchase_nret2.yml 2013-01-15 15:16:32 +0000
439+++ l10n_ve_withholding_iva/test/iva_purchase_nret2.yml 2013-11-18 00:07:54 +0000
440@@ -42,7 +42,7 @@
441 date_invoice: !eval time.strftime('%Y-%m-%d')
442 partner_id: base.res_partner_23
443 reference_type: none
444- journal_id: account.sales_journal
445+ journal_id: account.expenses_journal
446 wh_iva: True
447 invoice_line:
448 - product_id: product.product_product_3
449
450=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_nret3.yml'
451--- l10n_ve_withholding_iva/test/iva_purchase_nret3.yml 2013-01-15 15:16:32 +0000
452+++ l10n_ve_withholding_iva/test/iva_purchase_nret3.yml 2013-11-18 00:07:54 +0000
453@@ -52,7 +52,7 @@
454 date_invoice: !eval time.strftime('%Y-%m-%d')
455 partner_id: base.res_partner_23
456 reference_type: none
457- journal_id: account.sales_journal
458+ journal_id: account.expenses_journal
459 wh_iva: True
460 invoice_line:
461 - product_id: product.product_product_3
462
463=== modified file 'l10n_ve_withholding_iva/test/iva_purchase_wh.yml'
464--- l10n_ve_withholding_iva/test/iva_purchase_wh.yml 2013-01-15 15:16:32 +0000
465+++ l10n_ve_withholding_iva/test/iva_purchase_wh.yml 2013-11-18 00:07:54 +0000
466@@ -26,13 +26,14 @@
467 -
468 2.4 I create a purchase invoice
469 -
470- !record {model: account.invoice, id: test_purchase_iva02}:
471- type: out_invoice
472+ !record {model: account.invoice, id: test_purchase_iva02, view: account.invoice_supplier_form, context:{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}}:
473+ type: in_invoice
474+ state: draft
475 company_id: base.main_company
476 date_invoice: !eval time.strftime('%Y-%m-%d')
477 partner_id: base.res_partner_23
478 reference_type: none
479- journal_id: account.sales_journal
480+ journal_id:
481 wh_iva: True
482 invoice_line:
483 - product_id: product.product_product_3
484@@ -50,10 +51,19 @@
485 invoice_line_tax_id:
486 - l10n_ve_fiscal_requirements.iva_purchase1
487 -
488- 2.5 I check that Initially customer invoice is in the "Draft" state
489+ 2.5 I check that Initially supplier invoice is in the "Draft" state
490 -
491- !assert {model: account.invoice, id: test_purchase_iva02}:
492- - state == 'draft'
493+ !python {model: account.invoice}: |
494+ ap_obj=self.pool.get('account.period')
495+ import time
496+ period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})
497+ assert period, 'There aren\'t periods for this date'
498+ ap_obj.write(cr, uid, period, {'special':False})
499+ self.write(cr,uid,ref('test_purchase_iva02'),{'journal_id':ref('account.expenses_journal'),'type':'in_invoice'})
500+ ai_brw = self.browse(cr,uid,ref('test_purchase_iva02'))
501+ assert ai_brw.type == 'in_invoice', "Not the intended type. It should be 'in_invoice' not '%s'"%ai_brw.type
502+ assert ai_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%ai_brw.state
503+ 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
504 -
505 2.6 I change the state of invoice to "Proforma2" by clicking PRO-FORMA button
506 -
507@@ -76,6 +86,7 @@
508 2.10 Set control number for the invoice
509 -
510 !python {model: account.invoice}: |
511- self.write(cr, uid, [ref("test_purchase_iva02")], {'nro_ctrl':'iva002', 'journal_id':ref("account.expenses_journal")})
512+ self.write(cr, uid, [ref("test_purchase_iva02")], {'nro_ctrl':'iva002'})
513 ai_brw = self.browse(cr, uid, ref("test_purchase_iva02"))
514- assert ai_brw.nro_ctrl=='iva002' and ai_brw.journal_id.id == ref("account.expenses_journal"), 'Invoice wasn\'t updated properly'
515+ assert ai_brw.nro_ctrl=='iva002', "Not the intended Control Number. It should be 'iva002' not '%s'"%ai_brw.nro_ctrl
516+ 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
517
518=== modified file 'l10n_ve_withholding_iva/test/iva_sale_wh.yml'
519--- l10n_ve_withholding_iva/test/iva_sale_wh.yml 2013-01-17 19:19:09 +0000
520+++ l10n_ve_withholding_iva/test/iva_sale_wh.yml 2013-11-18 00:07:54 +0000
521@@ -109,11 +109,13 @@
522 ap_obj=self.pool.get('account.period')
523 period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})
524 assert period, 'There aren\'t periods for this date'
525+ ap_obj.write(cr, uid, period, {'special':False})
526 ap_brw = ap_obj.browse(cr, uid, period[0])
527 if ap_brw.state == 'done':
528 ap.action_draft(cr, uid, period)
529 ap_brw = ap.browse(cr, uid, period[0])
530 assert ap_brw.state == 'draft', 'Period is not open as it should be'
531+ assert ap_brw.special == False, 'Period is special. It should be'
532
533 self.write(cr, uid, ref("wh_iva_sale01"), {'period_id':period[0]})
534 -
535
536=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_2.yml'
537--- l10n_ve_withholding_iva/test/iva_test_wh_2.yml 2013-01-18 19:55:38 +0000
538+++ l10n_ve_withholding_iva/test/iva_test_wh_2.yml 2013-11-18 00:07:54 +0000
539@@ -10,28 +10,55 @@
540 -
541 10.2 I generate a withholding vat customer
542 -
543- !record {model: account.wh.iva, id: wh_iva_test02}:
544+ !record {model: account.wh.iva, id: wh_iva_test02, view: view_wh_iva_form_customer, context: {'type':'out_invoice'}}:
545 journal_id: wh_sales_journal
546 partner_id: base.res_partner_23
547 number: 222444333000
548 account_id: account.a_recv
549 name: 'IVA wh vat customer Vauxoo test 2'
550 type: out_invoice
551+ state: draft
552 -
553 10.3 I check withholding vat customer
554 -
555- !assert {model: account.wh.iva, id: wh_iva_test02, string: Wh was not saved}:
556- - state == 'draft'
557+ !python {model: account.wh.iva}: |
558+ values = {}
559+ rp_obj = self.pool.get('res.partner')
560+ rp_brw = rp_obj.browse(cr,uid,ref("base.res_partner_23"))
561+ res = self.onchange_partner_id(cr, uid, [ref('wh_iva_test02')], 'out_invoice', rp_brw.id)
562+ values['wh_lines'] = [(0,0,{'invoice_id':ref('test_iva01'), 'name':'N/A', 'wh_iva_rate':rp_brw.wh_iva_rate})]
563+ values['account_id'] = res['value']['account_id']
564+ values['type'] = 'out_invoice'
565+ self.write(cr,uid,ref('wh_iva_test02'),values)
566+ awi_brw = self.browse(cr,uid,ref('wh_iva_test02'))
567+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
568+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
569+ assert awi_brw.wh_lines, "There are no lines to withhold"
570+ self.compute_amount_wh(cr,uid,[ref('wh_iva_test02')])
571 -
572 10.4 I confirm the withholding vat customer
573 -
574- !workflow {model: account.wh.iva, action: wh_iva_confirmed, ref: wh_iva_test02}
575+ !python {model: account.wh.iva}: |
576+ import netsvc
577+ from openerp.osv import osv
578+ wf_service = netsvc.LocalService("workflow")
579+ try:
580+ self.check_wh_lines_fortnights(cr, uid, [ref('wh_iva_test02')])
581+ self.check_invoice_nro_ctrl(cr, uid, [ref('wh_iva_test02')])
582+ self.check_vat_wh(cr, uid, [ref('wh_iva_test02')])
583+ self.check_wh_taxes(cr, uid, [ref('wh_iva_test02')])
584+ self.check_wh_taxes(cr, uid, [ref('wh_iva_test02')])
585+ assert False, "An exception should have been raised, unwithholdable taxes are not allowed to reach here!"
586+ except osv.except_osv:
587+ # exception was raised as expected
588+ pass
589 -
590 10.5 I check withholding vat is not confirmed
591 # TODO: Check this test case, it fails. It means that something in the wh_iva_confirmed action is wrong.
592 -
593- !assert {model: account.wh.iva, id: wh_iva_test02, string: Could not confirm the wh}:
594- - state != 'confirmed'
595+ !python {model: account.wh.iva}: |
596+ awi_brw = self.browse(cr,uid,ref('wh_iva_test02'))
597+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
598 -
599 10.6 I try to mark it as done
600 -
601
602=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_3.yml'
603--- l10n_ve_withholding_iva/test/iva_test_wh_3.yml 2013-01-18 19:55:38 +0000
604+++ l10n_ve_withholding_iva/test/iva_test_wh_3.yml 2013-11-18 00:07:54 +0000
605@@ -16,11 +16,15 @@
606 account_id: account.a_recv
607 name: 'IVA wh vat customer Vauxoo test 3'
608 type: out_invoice
609+ state: draft
610 -
611 11.3 I check withholding vat customer
612 -
613- !assert {model: account.wh.iva, id: wh_iva_test03, string: Wh was not saved}:
614- - state == 'draft'
615+ !python {model: account.wh.iva}: |
616+ self.write(cr,uid,ref('wh_iva_test03'),{'type':'out_invoice'})
617+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
618+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
619+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
620 -
621 11.4 Before validating let's add the period
622 -
623@@ -43,8 +47,9 @@
624 11.7 I check withholding vat is not confirmed
625 # TODO: Check this test case, it fails. It means that something in the wh_iva_confirmed action is wrong.
626 -
627- !assert {model: account.wh.iva, id: wh_iva_test03, string: Could not confirm the wh}:
628- - state != 'confirmed'
629+ !python {model: account.wh.iva}: |
630+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
631+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
632 -
633 11.8 I try to mark it as done
634 -
635@@ -52,5 +57,6 @@
636 -
637 11.9 I check withholding vat is not done
638 -
639- !assert {model: account.wh.iva, id: wh_iva_test01, string: Wh cannot be in done state}:
640- - state != 'done'
641+ !python {model: account.wh.iva}: |
642+ awi_brw = self.browse(cr,uid,ref('wh_iva_test03'))
643+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
644
645=== modified file 'l10n_ve_withholding_iva/test/iva_test_wh_4.yml'
646--- l10n_ve_withholding_iva/test/iva_test_wh_4.yml 2013-01-18 19:55:38 +0000
647+++ l10n_ve_withholding_iva/test/iva_test_wh_4.yml 2013-11-18 00:07:54 +0000
648@@ -16,11 +16,15 @@
649 account_id: account.a_recv
650 name: 'IVA wh vat customer Vauxoo test 3'
651 type: out_invoice
652+ state: draft
653 -
654 12.3 I check withholding vat customer
655 -
656- !assert {model: account.wh.iva, id: wh_iva_test04, string: Wh was not saved}:
657- - state == 'draft'
658+ !python {model: account.wh.iva}: |
659+ self.write(cr,uid,ref('wh_iva_test04'),{'type':'out_invoice'})
660+ awi_brw = self.browse(cr,uid,ref('wh_iva_test04'))
661+ assert awi_brw.type == 'out_invoice', "Not the intended type. It should be 'out_invoice' not '%s'"%awi_brw.type
662+ assert awi_brw.state == 'draft', "Not the intended state. It should be 'draft' not '%s'"%awi_brw.state
663 -
664 12.4 Before validating let's add the period
665 -
666
667=== modified file 'l10n_ve_withholding_muni/__openerp__.py'
668--- l10n_ve_withholding_muni/__openerp__.py 2013-01-30 20:27:24 +0000
669+++ l10n_ve_withholding_muni/__openerp__.py 2013-11-18 00:07:54 +0000
670@@ -47,7 +47,7 @@
671 ],
672 'demo_xml': [],
673 'test': [],
674- 'installable': True,
675+ 'installable': False,
676 'active': False,
677 }
678
679
680=== modified file 'l10n_ve_withholding_src/__openerp__.py'
681--- l10n_ve_withholding_src/__openerp__.py 2013-04-18 21:03:12 +0000
682+++ l10n_ve_withholding_src/__openerp__.py 2013-11-18 00:07:54 +0000
683@@ -67,5 +67,5 @@
684
685 ],
686 "active": False,
687- "installable": True
688+ "installable": False,
689 }
690
691=== modified file 'ovl/__openerp__.py'
692--- ovl/__openerp__.py 2013-11-14 06:07:44 +0000
693+++ ovl/__openerp__.py 2013-11-18 00:07:54 +0000
694@@ -87,5 +87,5 @@
695 "images" : [],
696 "auto_install": False,
697 "application": True,
698- "installable": True,
699+ "installable": False,
700 }