Merge lp:~vauxoo/openerp-venezuela-localization/ovl70-fb-rev3-kty into lp:openerp-venezuela-localization

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 855
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/ovl70-fb-rev3-kty
Merge into: lp:openerp-venezuela-localization
Diff against target: 736 lines (+194/-202)
4 files modified
l10n_ve_fiscal_book/model/fiscal_book.py (+182/-192)
l10n_ve_fiscal_book/model/invoice.py (+8/-7)
l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py (+2/-2)
l10n_ve_fiscal_book/workflow/fb_workflow.xml (+2/-1)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/ovl70-fb-rev3-kty
Reviewer Review Type Date Requested Status
hbto [Vauxoo] http://www.vauxoo.com Approve
Review via email: mp+167392@code.launchpad.net

Description of the change

[MERGE] module fiscal book fixes and improvements.
[IMP] Add an exception when trying to delete a fiscal book that is not in cancel state.
[FIX] bad condition in the raise of an exception.
[IMP] when cancel a fiscal book it would clear the book lines and associated data (invoices, taxes, summary, taxes, book amount fields).
[FIX] duplicate fiscal book taxes entries. Delete no needed the update_book_taxes() method and related inner methods.
Now the book taxes are only added one, with all the correct information at the link_book_lines_and_taxes() method

To post a comment you must log in.
Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_fiscal_book/model/fiscal_book.py'
2--- l10n_ve_fiscal_book/model/fiscal_book.py 2013-05-30 21:21:57 +0000
3+++ l10n_ve_fiscal_book/model/fiscal_book.py 2013-06-04 20:15:34 +0000
4@@ -200,8 +200,8 @@
5 string='Status', required=True),
6 'type': fields.selection([('sale', 'Sale Book'),
7 ('purchase', 'Purchase Book')],
8- help='Select Sale for Customers and Purchase \
9- for Suppliers',
10+ help="Select Sale for Customers and" \
11+ " Purchase for Suppliers",
12 string='Book Type', required=True),
13 'base_amount': fields.float('Taxable Amount',
14 help='Amount used as Taxing Base'),
15@@ -214,20 +214,20 @@
16 'fbts_ids': fields.one2many('fiscal.book.taxes.summary', 'fb_id',
17 'Tax Summary'),
18 'invoice_ids': fields.one2many('account.invoice', 'fb_id', 'Invoices',
19- help='Invoices being recorded in a \
20- Fiscal Book'),
21+ help="Invoices being recorded in a" \
22+ " Fiscal Book"),
23 'issue_invoice_ids': fields.one2many('account.invoice', 'issue_fb_id',
24 'Issue Invoices',
25- help='Invoices that are in \
26- pending state. Cancel or Draft'),
27+ help="Invoices that are in" \
28+ " pending state cancel or draft"),
29 'iwdl_ids': fields.one2many('account.wh.iva.line', 'fb_id',
30 'Vat Withholdings',
31- help='Vat Withholdings being recorded in \
32- a Fiscal Book'),
33+ help="Vat Withholdings being recorded" \
34+ " in a Fiscal Book"),
35 'abl_ids': fields.one2many('adjustment.book.line', 'fb_id',
36 'Adjustment Lines',
37- help='Adjustment Lines being recorded in \
38- a Fiscal Book'),
39+ help="Adjustment Lines being recorded in " \
40+ " a Fiscal Book"),
41 'note': fields.text('Note'),
42 'article_number': fields.selection(
43 _get_article_number_types,
44@@ -235,13 +235,13 @@
45 required=True,
46 help="Article number describing the fiscal book special features" \
47 " according to the Venezuelan RLIVA statement for fiscal" \
48- " accounting books. Options:"
49- " - Art. 75: Pruchase Book."
50- " - Art. 76: Sale Book. Reflects every individual operation datail."
51- " - Art. 77: Sale Book. Groups no tax payer operations in one "
52- " consolidated line. Only fiscal billing."
53- " - Art. 78: Sale Book. Hybrid for 76 and 77 article. Show"
54- " automatic and mechanized operations in individual way, and "
55+ " accounting books. Options:" \
56+ " - Art. 75: Pruchase Book." \
57+ " - Art. 76: Sale Book. Reflects every individual operation datail." \
58+ " - Art. 77: Sale Book. Groups no tax payer operations in one " \
59+ " consolidated line. Only fiscal billing." \
60+ " - Art. 78: Sale Book. Hybrid for 76 and 77 article. Show" \
61+ " automatic and mechanized operations in individual way, and " \
62 " groups fiscal billing operationss in one consolidated line." ),
63
64 #~ Withholding fields
65@@ -249,10 +249,10 @@
66 _get_wh,
67 type="float", method=True, store=True, multi="get_wh",
68 string="Current Period Withholding",
69- help="Used at \
70- 1. Totalization row in Fiscal Book Line block at Withholding VAT \
71- Column \
72- 2. Second row at the Withholding Summary block"),
73+ help="Used at" \
74+ " 1. Totalization row in Fiscal Book Line block at Withholding" \
75+ " VAT Column" \
76+ " 2. Second row at the Withholding Summary block"),
77 'get_previous_wh_sum': fields.function(
78 _get_wh,
79 type="float", method=True, store=True, multi="get_wh",
80@@ -267,8 +267,8 @@
81 _get_wh,
82 type="float", method=True, store=True, multi="get_wh",
83 string="Based Tax Debit Sum",
84- help="Totalization row in Fiscal Book Line block at \
85- Based Tax Debit Column"),
86+ help="Totalization row in Fiscal Book Line block at" \
87+ " Based Tax Debit Column"),
88
89 #~ Printable report data
90 'get_partner_addr': fields.function(
91@@ -286,22 +286,22 @@
92 type="float", method=True, store=True,
93 multi="get_total_with_iva",
94 string='Total amount with VAT',
95- help="Total with VAT Sum (Import/Export, Domestic, Tax Payer and \
96- No Tax Payer"),
97+ help="Total with VAT Sum (Import/Export, Domestic, Tax Payer and" \
98+ " No Tax Payer"),
99 'get_vat_sdcf_sum': fields.function(
100 _get_vat_sdcf_sum,
101 type="float", method=True, store=True,
102 string="Exempt and SDCF Tax Sum",
103- help="Exempt and Non entitled to tax credit totalization. Sum of SDCF and Exempt Tax Totalization columns for all \
104- transaction types"),
105+ help="Exempt and Non entitled to tax credit totalization. Sum of" \
106+ " SDCF and Exempt Tax Totalization columns for all transaction" \
107+ " types"),
108 'get_total_tax_credit_debit_base_sum': fields.function(
109 _get_total_tax_credit_debit,
110 type="float", method=True, store=True,
111 multi="get_total_tax_credit_debit",
112 string="Tax Credit Total Base Amount",
113- help="Uses at \
114- 1. purchase: total row at summary taxes.\
115- 2. sales: row at summary taxes."),
116+ help="Uses at 1. purchase: total row at summary taxes." \
117+ " 2. sales: row at summary taxes."),
118 'get_total_tax_credit_debit_tax_sum': fields.function(
119 _get_total_tax_credit_debit,
120 type="float", method=True, store=True,
121@@ -310,9 +310,9 @@
122 'do_sdcf_and_exempt_sum': fields.float(
123 digits_compute=dp.get_precision('Account'),
124 string="Domestic Untaxed VAT Sum",
125- help="SDCF and Exempt sum for domestict transanctions. "
126- "At Sale book represent the sum of Tax Payer and No Tax payer"
127- "transactions."),
128+ help="SDCF and Exempt sum for domestict transanctions." \
129+ " At Sale book represent the sum of Tax Payer and No Tax payer" \
130+ " transactions."),
131
132 #~ Totalization fields for international transactions
133 'get_total_with_iva_imex_sum': fields.function(
134@@ -324,48 +324,49 @@
135 'imex_vat_base_sum': fields.float(
136 digits_compute=dp.get_precision('Account'),
137 string="International Taxable Amount",
138- help="Sum of International Tax Base Amounts (reduced, general and"
139- " additional). Used at 2nd row in thw Sale book's summary with "
140- "Exportation Sales title"),
141+ help="Sum of International Tax Base Amounts (reduced, general" \
142+ " and additional). Used at 2nd row in thw Sale book's summary" \
143+ " with Exportation Sales title"),
144 'imex_exempt_vat_sum': fields.float(
145 digits_compute=dp.get_precision('Account'),
146 string="Exempt Tax",
147- help="Import/Export Exempt Tax Totalization: Sum of Exempt column for international transactions"),
148+ help="Import/Export Exempt Tax Totalization: Sum of Exempt" \
149+ " column for international transactions"),
150 'imex_sdcf_vat_sum': fields.float(
151 digits_compute=dp.get_precision('Account'),
152 string="SDCF Tax",
153- help="Import/Export SDCF Tax Totalization: Sum of SDCF column for \
154- international transactions"),
155+ help="Import/Export SDCF Tax Totalization: Sum of SDCF column" \
156+ " for international transactions"),
157 'imex_general_vat_base_sum': fields.float(
158 digits_compute=dp.get_precision('Account'),
159 string="General VAT Taxable Amount",
160- help="General VAT Taxed Imports/Exports Base Amount. Sum of \
161- General VAT Base column for international transactions"),
162+ help="General VAT Taxed Imports/Exports Base Amount. Sum of" \
163+ " General VAT Base column for international transactions"),
164 'imex_general_vat_tax_sum': fields.float(
165 digits_compute=dp.get_precision('Account'),
166 string="General VAT Taxed Amount",
167- help="General VAT Taxed Imports/Exports Tax Amount. Sum of \
168- General VAT Tax column for international transactions"),
169+ help="General VAT Taxed Imports/Exports Tax Amount. Sum of" \
170+ " General VAT Tax column for international transactions"),
171 'imex_additional_vat_base_sum': fields.float(
172 digits_compute=dp.get_precision('Account'),
173 string="Additional VAT Taxable Amount",
174- help="Additional VAT Taxed Imports/Exports Base Amount. Sum of \
175- Additional VAT Base column for international transactions"),
176+ help="Additional VAT Taxed Imports/Exports Base Amount. Sum of" \
177+ " Additional VAT Base column for international transactions"),
178 'imex_additional_vat_tax_sum': fields.float(
179 digits_compute=dp.get_precision('Account'),
180 string="Additional VAT Taxed Amount",
181- help="Additional VAT Taxed Imports/Exports Tax Amount. Sum of \
182- Additional VAT Tax column for international transactions"),
183+ help="Additional VAT Taxed Imports/Exports Tax Amount. Sum of " \
184+ " Additional VAT Tax column for international transactions"),
185 'imex_reduced_vat_base_sum': fields.float(
186 digits_compute=dp.get_precision('Account'),
187 string="Reduced VAT Taxable Amount",
188- help="Reduced VAT Taxed Imports/Exports Base Amount. Sum of \
189- Reduced VAT Base column for international transactions"),
190+ help="Reduced VAT Taxed Imports/Exports Base Amount. Sum of " \
191+ " Reduced VAT Base column for international transactions"),
192 'imex_reduced_vat_tax_sum': fields.float(
193 digits_compute=dp.get_precision('Account'),
194 string="Reduced VAT Taxed Amount",
195- help="Reduced VAT Taxed Imports/Exports Tax Amount. Sum of \
196- Reduced VAT Tax column for international transactions"),
197+ help="Reduced VAT Taxed Imports/Exports Tax Amount. Sum of " \
198+ " Reduced VAT Tax column for international transactions"),
199
200 #~ Totalization fields for domestic transactions
201 'get_total_with_iva_do_sum': fields.function(
202@@ -377,71 +378,71 @@
203 'do_vat_base_sum': fields.float(
204 digits_compute=dp.get_precision('Account'),
205 string="Domestic Taxable Amount",
206- help="Sum of all domestic transaction base amounts (reduced, \
207- general and additional)"),
208+ help="Sum of all domestic transaction base amounts (reduced," \
209+ " general and additional)"),
210 'do_exempt_vat_sum': fields.float(
211 digits_compute=dp.get_precision('Account'),
212 string="Exempt Tax",
213- help="Domestic Exempt Tax Totalization. For Purchase Book it sums"
214- " Exempt column for domestic transactions. For Sale Book it sums"
215- " Tax Payer and No Tax Payer Exempt columns"),
216+ help="Domestic Exempt Tax Totalization. For Purchase Book it" \
217+ " sums Exempt column for domestic transactions. For Sale Book it" \
218+ " sums Tax Payer and No Tax Payer Exempt columns"),
219 'do_sdcf_vat_sum': fields.float(
220 digits_compute=dp.get_precision('Account'),
221 string="SDCF Tax",
222- help="Domestic SDCF Tax Totalization. For Purchase Book it sums"
223- " SDCF column for domestic transactions. For Sale Book it sums"
224+ help="Domestic SDCF Tax Totalization. For Purchase Book it sums" \
225+ " SDCF column for domestic transactions. For Sale Book it sums" \
226 " Tax Payer and No Tax Payer SDCF columns"),
227 'do_general_vat_base_sum': fields.float(
228 digits_compute=dp.get_precision('Account'),
229 string="General VAT Taxable Amount",
230- help="General VAT Taxed Domestic Base Amount Totalization. " \
231- "For Purchase Book it sums General VAT Base column for domestic"
232- " transactions. For Sale Book it sums Tax Payer and No Tax Payer"
233+ help="General VAT Taxed Domestic Base Amount Totalization." \
234+ " For Purchase Book it sums General VAT Base column for domestic" \
235+ " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \
236 " General VAT Base columns"),
237 'do_general_vat_tax_sum': fields.float(
238 digits_compute=dp.get_precision('Account'),
239 string="General VAT Taxed Amount",
240- help="General VAT Taxed Domestic Tax Amount Totalization. " \
241- "For Purchase Book it sums General VAT Tax column for domestic"
242- " transactions. For Sale Book it sums Tax Payer and No Tax Payer"
243+ help="General VAT Taxed Domestic Tax Amount Totalization." \
244+ " For Purchase Book it sums General VAT Tax column for domestic" \
245+ " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \
246 " General VAT Tax columns"),
247 'do_additional_vat_base_sum': fields.float(
248 digits_compute=dp.get_precision('Account'),
249 string="Additional VAT Taxable Amount",
250- help="Additional VAT Taxed Domestic Base Amount Totalization."
251- "For Purchase Book it sums Additional VAT Base column for domestic"
252- " transactions. For Sale Book it sums Tax Payer and No Tax Payer"
253- " Additional VAT Base columns"),
254+ help="Additional VAT Taxed Domestic Base Amount Totalization." \
255+ " For Purchase Book it sums Additional VAT Base column for" \
256+ " domestic transactions. For Sale Book it sums Tax Payer and No" \
257+ " Tax Payer Additional VAT Base columns"),
258 'do_additional_vat_tax_sum': fields.float(
259 digits_compute=dp.get_precision('Account'),
260 string="Additional VAT Taxed Amount",
261- help="Additional VAT Taxed Domestic Tax Amount Totalization. "
262- "For Purchase Book it sums Additional VAT Tax column for domestic"
263- " transactions. For Sale Book it sums Tax Payer and No Tax Payer"
264- " Additional VAT Tax columns"),
265+ help="Additional VAT Taxed Domestic Tax Amount Totalization." \
266+ " For Purchase Book it sums Additional VAT Tax column for" \
267+ " domestic transactions. For Sale Book it sums Tax Payer and No" \
268+ " Tax Payer Additional VAT Tax columns"),
269 'do_reduced_vat_base_sum': fields.float(
270 digits_compute=dp.get_precision('Account'),
271 string="Reduced VAT Taxable Amount",
272- help="Reduced VAT Taxed Domestic Base Amount Totalization. "
273- "For Purchase Book it sums Reduced VAT Base column for domestic"
274- " transactions. For Sale Book it sums Tax Payer and No Tax Payer"
275+ help="Reduced VAT Taxed Domestic Base Amount Totalization." \
276+ " For Purchase Book it sums Reduced VAT Base column for domestic" \
277+ " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \
278 " Reduced VAT Base columns"),
279 'do_reduced_vat_tax_sum': fields.float(
280 digits_compute=dp.get_precision('Account'),
281 string="Reduced VAT Taxed Amount",
282- help="Reduced VAT Taxed Domestic Tax Amount Totalization. "
283- "For Purchase Book it sums Reduced VAT Tax column for domestic"
284- " transactions. For Sale Book it sums Tax Payer and No Tax Payer"
285+ help="Reduced VAT Taxed Domestic Tax Amount Totalization." \
286+ " For Purchase Book it sums Reduced VAT Tax column for domestic" \
287+ " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \
288 " Reduced VAT Tax columns"),
289
290 #~ Apply only for sale book
291 #~ Totalization fields for tax payer and no tax payer transactions
292 'ntp_fbl_ids': fields.one2many("fiscal.book.line", "ntp_fb_id",
293 string = "No Tax Payer Detail Lines",
294- help="No Tax Payer Lines that are"
295- " grouped by the statement law that"
296- " represent the data of are consolidate"
297- "book lines"),
298+ help="No Tax Payer Lines that are" \
299+ " grouped by the statement law that" \
300+ " represent the data of are" \
301+ " consolidate book lines"),
302 'get_total_with_iva_tp_sum': fields.function(
303 _get_total_with_iva_sum,
304 type="float", method=True, store=True,
305@@ -451,48 +452,48 @@
306 'tp_vat_base_sum': fields.float(
307 digits_compute=dp.get_precision('Account'),
308 string="Tax Payer Taxable Amount",
309- help="Sum of all Tax Payer Grand Base Sum (reduced, general and " \
310- "additional taxes)"),
311+ help="Sum of all Tax Payer Grand Base Sum (reduced, general and" \
312+ " additional taxes)"),
313 'tp_exempt_vat_sum': fields.float(
314 digits_compute=dp.get_precision('Account'),
315 string="Exempt Tax",
316- help="Tax Payer Exempt Tax Totalization. Sum of Exempt column " \
317- "for tax payer transactions"),
318+ help="Tax Payer Exempt Tax Totalization. Sum of Exempt column" \
319+ " for tax payer transactions"),
320 'tp_sdcf_vat_sum': fields.float(
321 digits_compute=dp.get_precision('Account'),
322 string="SDCF Tax",
323- help="Tax Payer SDCF Tax Totalization. Sum of SDCF column for " \
324- "tax payer transactions"),
325+ help="Tax Payer SDCF Tax Totalization. Sum of SDCF column for" \
326+ " tax payer transactions"),
327 'tp_general_vat_base_sum': fields.float(
328 digits_compute=dp.get_precision('Account'),
329 string="General VAT Taxable Amount",
330- help="General VAT Taxed Tax Payer Base Amount Totalization. " \
331- "Sum of General VAT Base column for taxy payer transactions"),
332+ help="General VAT Taxed Tax Payer Base Amount Totalization." \
333+ " Sum of General VAT Base column for taxy payer transactions"),
334 'tp_general_vat_tax_sum': fields.float(
335 digits_compute=dp.get_precision('Account'),
336 string="General VAT Taxed Amount",
337- help="General VAT Taxed Tax Payer Tax Amount Totalization. " \
338- "Sum of General VAT Tax column for tax payer transactions"),
339+ help="General VAT Taxed Tax Payer Tax Amount Totalization." \
340+ " Sum of General VAT Tax column for tax payer transactions"),
341 'tp_additional_vat_base_sum': fields.float(
342 digits_compute=dp.get_precision('Account'),
343 string="Additional VAT Taxable Amount",
344- help="Additional VAT Taxed Tax Payer Base Amount Totalization. " \
345- "Sum of Additional VAT Base column for tax payer transactions"),
346+ help="Additional VAT Taxed Tax Payer Base Amount Totalization." \
347+ " Sum of Additional VAT Base column for tax payer transactions"),
348 'tp_additional_vat_tax_sum': fields.float(
349 digits_compute=dp.get_precision('Account'),
350 string="Additional VAT Taxed Amount",
351- help="Additional VAT Taxed Tax Payer Tax Amount Totalization. " \
352- "Sum of Additional VAT Tax column for tax payer transactions"),
353+ help="Additional VAT Taxed Tax Payer Tax Amount Totalization." \
354+ " Sum of Additional VAT Tax column for tax payer transactions"),
355 'tp_reduced_vat_base_sum': fields.float(
356 digits_compute=dp.get_precision('Account'),
357 string="Reduced VAT Taxable Amount",
358- help="Reduced VAT Taxed Tax Payer Base Amount Totalization. " \
359- "Sum of Reduced VAT Base column for tax payer transactions"),
360+ help="Reduced VAT Taxed Tax Payer Base Amount Totalization." \
361+ " Sum of Reduced VAT Base column for tax payer transactions"),
362 'tp_reduced_vat_tax_sum': fields.float(
363 digits_compute=dp.get_precision('Account'),
364 string="Reduced VAT Taxed Amount",
365- help="Reduced VAT Taxed Tax Payer Tax Amount Totalization. " \
366- "Sum of Reduced VAT Tax column for tax payer transactions"),
367+ help="Reduced VAT Taxed Tax Payer Tax Amount Totalization." \
368+ " Sum of Reduced VAT Tax column for tax payer transactions"),
369
370 'get_total_with_iva_ntp_sum': fields.function(
371 _get_total_with_iva_sum,
372@@ -503,48 +504,48 @@
373 'ntp_vat_base_sum': fields.float(
374 digits_compute=dp.get_precision('Account'),
375 string="No Tax Payer Taxable Amount",
376- help="No Tax Payer Grand Base Totalization. Sum of all no tax " \
377- "payer tax bases (reduced, general and additional)"),
378+ help="No Tax Payer Grand Base Totalization. Sum of all no tax" \
379+ " payer tax bases (reduced, general and additional)"),
380 'ntp_exempt_vat_sum': fields.float(
381 digits_compute=dp.get_precision('Account'),
382 string="Exempt Tax",
383- help="No Tax Payer Exempt Tax Totalization. Sum of Exempt " \
384- "column for no tax payer transactions"),
385+ help="No Tax Payer Exempt Tax Totalization. Sum of Exempt" \
386+ " column for no tax payer transactions"),
387 'ntp_sdcf_vat_sum': fields.float(
388 digits_compute=dp.get_precision('Account'),
389 string="SDCF Tax",
390- help="No Tax Payer SDCF Tax Totalization. Sum of SDCF column " \
391- "for no tax payer transactions"),
392+ help="No Tax Payer SDCF Tax Totalization. Sum of SDCF column" \
393+ " for no tax payer transactions"),
394 'ntp_general_vat_base_sum': fields.float(
395 digits_compute=dp.get_precision('Account'),
396 string="General VAT Taxable Amount",
397- help="General VAT Taxed No Tax Payer Base Amount Totalization. " \
398- "Sum of General VAT Base column for taxy payer transactions"),
399+ help="General VAT Taxed No Tax Payer Base Amount Totalization." \
400+ " Sum of General VAT Base column for taxy payer transactions"),
401 'ntp_general_vat_tax_sum': fields.float(
402 digits_compute=dp.get_precision('Account'),
403 string="General VAT Taxed Amount",
404- help="General VAT Taxed No Tax Payer Tax Amount Totalization. " \
405- "Sum of General VAT Tax column for no tax payer transactions"),
406+ help="General VAT Taxed No Tax Payer Tax Amount Totalization." \
407+ " Sum of General VAT Tax column for no tax payer transactions"),
408 'ntp_additional_vat_base_sum': fields.float(
409 digits_compute=dp.get_precision('Account'),
410 string="Additional VAT Taxable Amount",
411- help="Additional VAT Taxed No Tax Payer Base Amount Totalization. " \
412- "Sum of Additional VAT Base column for no tax payer transactions"),
413+ help="Additional VAT Taxed No Tax Payer Base Amount Totalization." \
414+ " Sum of Additional VAT Base column for no tax payer transactions"),
415 'ntp_additional_vat_tax_sum': fields.float(
416 digits_compute=dp.get_precision('Account'),
417 string="Additional VAT Taxed Amount",
418- help="Additional VAT Taxed No Tax Payer Tax Amount Totalization. " \
419- "Sum of Additional VAT Tax column for no tax payer transactions"),
420+ help="Additional VAT Taxed No Tax Payer Tax Amount Totalization." \
421+ " Sum of Additional VAT Tax column for no tax payer transactions"),
422 'ntp_reduced_vat_base_sum': fields.float(
423 digits_compute=dp.get_precision('Account'),
424 string="Reduced VAT Taxable Amount",
425- help="Reduced VAT Taxed No Tax Payer Base Amount Totalization. " \
426- "Sum of Reduced VAT Base column for no tax payer transactions"),
427+ help="Reduced VAT Taxed No Tax Payer Base Amount Totalization." \
428+ " Sum of Reduced VAT Base column for no tax payer transactions"),
429 'ntp_reduced_vat_tax_sum': fields.float(
430 digits_compute=dp.get_precision('Account'),
431 string="Reduced VAT Taxed Amount",
432- help="Reduced VAT Taxed No Tax Payer Tax Amount Totalization. " \
433- "Sum of Reduced VAT Tax column for no tax payer transactions"),
434+ help="Reduced VAT Taxed No Tax Payer Tax Amount Totalization." \
435+ " Sum of Reduced VAT Tax column for no tax payer transactions"),
436 }
437
438 _defaults = {
439@@ -612,8 +613,6 @@
440 #~ Relate invoices
441 inv_ids = self._get_invoice_ids(cr, uid, fb_id, context=context)
442 inv_obj.write(cr, uid, inv_ids, {'fb_id': fb_id}, context=context)
443- #~ update book taxes
444- self.update_book_taxes(cr, uid, fb_id, context=context)
445
446 #~ TODO: move this process to the cancel process of the invoice
447 #~ Unrelate invoices (period book change, invoice now cancel/draft or
448@@ -699,8 +698,8 @@
449 #~ Relate wh iva lines
450 iwdl_ids = self._get_wh_iva_line_ids(cr, uid, fb_id, context=context)
451
452- if fb_brw.type == "sale" \
453- and fb_brw.company_id.partner_id.wh_iva_agent and iwdl_ids:
454+ if fb_brw.type == "sale" and iwdl_ids \
455+ and not fb_brw.company_id.partner_id.wh_iva_agent:
456 raise osv.except_osv(_("Error!"),
457 _("You have withholdings registred but you are not a withholding agent"))
458
459@@ -715,28 +714,6 @@
460 context=context)
461 return True
462
463- def _get_book_taxes_ids(self, cr, uid, fb_id, context=None):
464- """ It returns account invoice taxes IDs from the fiscal book
465- invoices.
466- @param fb_id: fiscal book id
467- """
468- context = context or {}
469- ait_ids = []
470- for inv_brw in self.browse(cr, uid, fb_id,
471- context=context).invoice_ids:
472- ait_ids += [ait.id for ait in inv_brw.tax_line]
473- return ait_ids
474-
475- def update_book_taxes(self, cr, uid, fb_id, context=None):
476- """ It relate the invoices taxes from the period to the book.
477- @param fb_id: fiscal book id
478- """
479- context = context or {}
480- ait_ids = self._get_book_taxes_ids(cr, uid, fb_id, context=context)
481- data = map(lambda x: (0, 0, {'ait_id': x}), ait_ids)
482- self.write(cr, uid, fb_id, {'fbt_ids': data}, context=context)
483- return True
484-
485 def _get_invoice_iwdl_id(self, cr, uid, fb_id, inv_id, context=None):
486 """ It check if the invoice have wh iva lines asociated and if its
487 check if it is at the same period. Return the wh iva line ID or False
488@@ -1594,6 +1571,19 @@
489 or (fb_brw.type == 'purchase' and 'do' \
490 or (inv_brw.partner_id.vat_subjected and 'tp' or 'ntp' ))
491
492+ def unlink(self, cr, uid, ids, context=None):
493+ """ Overwrite the unlink method to throw an exception if the book is
494+ not in cancel state."""
495+ context = context or {}
496+ for fb_brw in self.browse(cr, uid, ids, context=context):
497+ if fb_brw.state != 'cancel':
498+ raise osv.except_osv("Invalid Procedure!!",
499+ "Youre book needs to be in cancel state to be deleted.")
500+ else:
501+ super(fiscal_book,self).unlink(cr, uid, ids, context=context)
502+ return True
503+
504+
505 class fiscal_book_lines(orm.Model):
506
507 def _get_wh_vat(self, cr, uid, ids, field_name, arg, context=None):
508@@ -1633,23 +1623,23 @@
509 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
510 help='Fiscal Book that owns this book line'),
511 'ntp_fb_id': fields.many2one("fiscal.book", "No Tax Payer Detail",
512- help="Fiscal Book that owns this book line"
513- "This Book is only for no tax payer lines"),
514+ help="Fiscal Book that owns this book line" \
515+ " This Book is only for no tax payer lines"),
516 'fbt_ids': fields.one2many('fiscal.book.taxes', 'fbl_id',
517- string='Tax Lines', help='Tax Lines being \
518- recorded in a Fiscal Book'),
519+ string='Tax Lines', help="Tax Lines being" \
520+ " recorded in a Fiscal Book"),
521 'invoice_id': fields.many2one('account.invoice', 'Invoice',
522- help='Invoice related to this book \
523- line'),
524+ help="Invoice related to this book" \
525+ " line"),
526 'iwdl_id': fields.many2one('account.wh.iva.line', 'Vat Withholding',
527- help='Withholding iva line related to this \
528- book line'),
529+ help="Withholding iva line related to" \
530+ " this book line"),
531 'parent_id': fields.many2one(
532 "fiscal.book.line",
533 string="Consolidated Line",
534 ondelete='cascade',
535- help="No Tax Payer Consolidated Line. Indicate the id of the "
536- "consolidated line where this no tax payer line belongs"),
537+ help="No Tax Payer Consolidated Line. Indicate the id of the" \
538+ " consolidated line where this no tax payer line belongs"),
539 'parent_left': fields.integer('Left Parent', select=1),
540 'parent_right': fields.integer('Right Parent', select=1),
541 'child_ids': fields.one2many(
542@@ -1665,16 +1655,16 @@
543 help='Invoice Document Date / Wh IVA Line Voucher Date'),
544 'accounting_date': fields.date(
545 string='Accounting Date',
546- help='The day of the accounting record [(invoice, date_invoice), \
547- (wh iva line, date_ret)]'),
548+ help="The day of the accounting record [(invoice, date_invoice)," \
549+ " (wh iva line, date_ret)]"),
550 'doc_type': fields.char('Doc. Type', size=8, help='Document Type'),
551 'partner_name': fields.char(size=128, string='Partner Name', help=''),
552 'partner_vat': fields.char(size=128, string='Partner TIN', help=''),
553 'affected_invoice': fields.char(
554 string='Affected Invoice',
555 size=64,
556- help="For an invoice line type means parent invoice for a Debit "
557- " or Credit Note. For an withholding line type means the invoice"
558+ help="For an invoice line type means parent invoice for a Debit" \
559+ " or Credit Note. For an withholding line type means the invoice" \
560 " number related to the withholding"),
561 #~ Apply for wh iva lines
562 'get_wh_vat': fields.function(_get_wh_vat,
563@@ -1682,7 +1672,7 @@
564 string="Withholding VAT",
565 help="Withholding VAT"),
566 'wh_number': fields.char(string='Withholding number', size=64,
567- help=''),
568+ help=""),
569 'affected_invoice_date': fields.date(string="Affected Invoice Date",
570 help=""),
571 'wh_rate': fields.float(string="Withholding percentage",
572@@ -1691,16 +1681,16 @@
573 _get_based_tax_debit,
574 type="float", method=True, store=True,
575 string="Based Tax Debit",
576- help="Sum of all tax amount for the taxes realeted to the \
577- wh iva line."),
578+ help="Sum of all tax amount for the taxes realeted to the wh iva" \
579+ " line."),
580
581 #~ Apply for invoice lines
582 'ctrl_number': fields.char(string='Invoice Control number', size=64,
583 help=''),
584 'invoice_number': fields.char(string='Invoice number', size=64,
585- help="Invoice Number. In case of use"
586- " of fiscal printer this field will "
587- " store the invoice number generate"
588+ help="Invoice Number. In case of use" \
589+ " of fiscal printer this field will" \
590+ " store the invoice number generate" \
591 " by the fiscal printer machine"),
592 'imex_date': fields.date(string='Imex Date',
593 help='Invoice Importation/Exportation Date'),
594@@ -1717,9 +1707,9 @@
595 ('tp', 'Tax Payer'),
596 ('ntp', 'No Tax Payer')],
597 string = 'Transaction Type', required=True,
598- help="Book line transtaction type: \
599- - Purchase: Import or Domestic. \
600- - Sales: Expertation, Tax Payer, No Tax Payer."),
601+ help="Book line transtaction type:" \
602+ " - Purchase: Import or Domestic." \
603+ " - Sales: Expertation, Tax Payer, No Tax Payer."),
604 'void_form': fields.char(string='Transaction type', size=192,
605 help="Operation Type"),
606 'fiscal_printer': fields.char(string='Fiscal machine number',
607@@ -1728,26 +1718,26 @@
608 'custom_statement': fields.char(string="Custom Statement",
609 size=192, help=""),
610 #~ -- taxes fields
611- 'total_with_iva': fields.float('Total with IVA', help="Sub Total \
612- of the invoice (untaxed amount) plus \
613- all tax amount of the related taxes"),
614- 'vat_sdcf': fields.float("SDCF", help="Not entitled to tax credit \
615- (The field name correspond to the spanih \
616- acronym for 'Sin Derecho a Credito Fiscal')"),
617- 'vat_exempt': fields.float("Exempt", help="Exempt is a Tax with 0 \
618- tax percentage"),
619- 'vat_reduced_base': fields.float("RED BASE", help="Vat Reduced Base \
620- Amount"),
621- 'vat_reduced_tax': fields.float("RED TAX", help="Vat Reduced Tax \
622- Amount"),
623- 'vat_general_base': fields.float("GRAL BASE",help="Vat General Base \
624- Amount"),
625- 'vat_general_tax': fields.float("GRAL TAX", help="Vat General Tax \
626- Amount"),
627- 'vat_additional_base': fields.float("ADD BASE", help="Vat Generald \
628- plus Additional Base Amount"),
629- 'vat_additional_tax': fields.float("ADD TAX", help="Vat General plus \
630- Additional Tax Amount"),
631+ 'total_with_iva': fields.float('Total with IVA', help="Sub Total of" \
632+ " the invoice (untaxed amount) plus" \
633+ " all tax amount of the related taxes"),
634+ 'vat_sdcf': fields.float("SDCF", help="Not entitled to tax credit" \
635+ " (The field name correspond to the spanih" \
636+ " acronym for 'Sin Derecho a Credito Fiscal')"),
637+ 'vat_exempt': fields.float("Exempt", help="Exempt is a Tax with 0" \
638+ " tax percentage"),
639+ 'vat_reduced_base': fields.float("RED BASE", help="Vat Reduced Base" \
640+ " Amount"),
641+ 'vat_reduced_tax': fields.float("RED TAX", help="Vat Reduced Tax" \
642+ " Amount"),
643+ 'vat_general_base': fields.float("GRAL BASE",help="Vat General Base" \
644+ " Amount"),
645+ 'vat_general_tax': fields.float("GRAL TAX", help="Vat General Tax" \
646+ " Amount"),
647+ 'vat_additional_base': fields.float("ADD BASE", help="Vat Generald" \
648+ " plus Additional Base Amount"),
649+ 'vat_additional_tax': fields.float("ADD TAX", help="Vat General plus" \
650+ " Additional Tax Amount"),
651 }
652
653
654@@ -1803,9 +1793,9 @@
655 ('tp', 'Tax Payer'),
656 ('ntp', 'No Tax Payer')],
657 string = 'Operation Type',
658- help="Operation Type: \
659- - Purchase: Import or Domestic. \
660- - Sales: Expertation, Tax Payer, No Tax Payer."),
661+ help="Operation Type:" \
662+ " - Purchase: Import or Domestic." \
663+ " - Sales: Expertation, Tax Payer, No Tax Payer."),
664 'base_amount_sum': fields.float('Taxable Amount Sum'),
665 'tax_amount_sum': fields.float('Taxed Amount Sum'),
666 }
667@@ -1839,8 +1829,8 @@
668 'type_doc': fields.selection([
669 ('F', 'Invoice'), ('ND', 'Debit Note'), ('NC', 'Credit Note'), ],
670 'Document Type', select=True, required=True,
671- help="Type of Document for adjustment book: \
672- -Invoice(F),-Debit Note(dn),-Credit Note(cn)"),
673+ help="Type of Document for adjustment book:"
674+ " -Invoice(F),-Debit Note(dn),-Credit Note(cn)"),
675 'doc_affected': fields.char(
676 'Affected Document', size=256, required=True,
677 help="Affected Document for adjustment book"),
678
679=== modified file 'l10n_ve_fiscal_book/model/invoice.py'
680--- l10n_ve_fiscal_book/model/invoice.py 2013-04-25 16:22:59 +0000
681+++ l10n_ve_fiscal_book/model/invoice.py 2013-06-04 20:15:34 +0000
682@@ -31,17 +31,18 @@
683
684 _columns = {
685 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
686- help='Fiscal Book where this line is \
687- related to'),
688+ help="Fiscal Book where this line is" \
689+ " related to"),
690 'issue_fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
691- help='Fiscal Book where this invoice \
692- needs to be add'),
693+ help="Fiscal Book where this invoice" \
694+ " needs to be add"),
695 # TODO: THIS FIELD TO BE CHANGED TO A STORABLE FUNCTIONAL FIELD
696 # CHANGE EVEN FROM boolean to selection
697 'fb_submitted': fields.boolean('Fiscal Book Submitted?',
698- help='Indicates if this invoice is in \
699- a Fiscal Book which has being already \
700- submitted to the statutory institute'),
701+ help="Indicates if this invoice is in" \
702+ " a Fiscal Book which has being" \
703+ " already submitted to the statutory" \
704+ " institute"),
705 }
706
707 inherited_invoice()
708
709=== modified file 'l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py'
710--- l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py 2013-04-16 16:53:35 +0000
711+++ l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py 2013-06-04 20:15:34 +0000
712@@ -44,8 +44,8 @@
713 ids = self.pool.get('account.period').search(
714 cr, uid, [('date_start', '<=', dt), ('date_stop', '>=', dt)])
715 if not ids:
716- raise osv.except_osv(_('Error !'), _('No period defined for this \
717- date !\nPlease create a fiscal year.'))
718+ raise osv.except_osv(_('Error !'), _('No period defined for this' \
719+ ' date !\nPlease create a fiscal year.'))
720 return ids
721
722 def _same_account_period(self, cr, uid, admin_date, account_date, context=None):
723
724=== modified file 'l10n_ve_fiscal_book/workflow/fb_workflow.xml'
725--- l10n_ve_fiscal_book/workflow/fb_workflow.xml 2013-05-27 16:36:56 +0000
726+++ l10n_ve_fiscal_book/workflow/fb_workflow.xml 2013-06-04 20:15:34 +0000
727@@ -39,7 +39,8 @@
728 <field name="wkf_id" ref="fb_wkf"/>
729 <field name="name">cancel</field>
730 <field name="kind">function</field>
731- <field name="action">write({'state':'cancel'})</field>
732+ <field name="action">clear_book()
733+write({'state':'cancel'})</field>
734 </record>
735
736 <!--