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