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