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