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