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