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
=== modified file 'l10n_ve_fiscal_book/model/fiscal_book.py'
--- l10n_ve_fiscal_book/model/fiscal_book.py 2013-05-30 21:21:57 +0000
+++ l10n_ve_fiscal_book/model/fiscal_book.py 2013-06-04 20:15:34 +0000
@@ -200,8 +200,8 @@
200 string='Status', required=True),200 string='Status', required=True),
201 'type': fields.selection([('sale', 'Sale Book'),201 'type': fields.selection([('sale', 'Sale Book'),
202 ('purchase', 'Purchase Book')],202 ('purchase', 'Purchase Book')],
203 help='Select Sale for Customers and Purchase \203 help="Select Sale for Customers and" \
204 for Suppliers',204 " Purchase for Suppliers",
205 string='Book Type', required=True),205 string='Book Type', required=True),
206 'base_amount': fields.float('Taxable Amount',206 'base_amount': fields.float('Taxable Amount',
207 help='Amount used as Taxing Base'),207 help='Amount used as Taxing Base'),
@@ -214,20 +214,20 @@
214 'fbts_ids': fields.one2many('fiscal.book.taxes.summary', 'fb_id',214 'fbts_ids': fields.one2many('fiscal.book.taxes.summary', 'fb_id',
215 'Tax Summary'),215 'Tax Summary'),
216 'invoice_ids': fields.one2many('account.invoice', 'fb_id', 'Invoices',216 'invoice_ids': fields.one2many('account.invoice', 'fb_id', 'Invoices',
217 help='Invoices being recorded in a \217 help="Invoices being recorded in a" \
218 Fiscal Book'),218 " Fiscal Book"),
219 'issue_invoice_ids': fields.one2many('account.invoice', 'issue_fb_id',219 'issue_invoice_ids': fields.one2many('account.invoice', 'issue_fb_id',
220 'Issue Invoices',220 'Issue Invoices',
221 help='Invoices that are in \221 help="Invoices that are in" \
222 pending state. Cancel or Draft'),222 " pending state cancel or draft"),
223 'iwdl_ids': fields.one2many('account.wh.iva.line', 'fb_id',223 'iwdl_ids': fields.one2many('account.wh.iva.line', 'fb_id',
224 'Vat Withholdings',224 'Vat Withholdings',
225 help='Vat Withholdings being recorded in \225 help="Vat Withholdings being recorded" \
226 a Fiscal Book'),226 " in a Fiscal Book"),
227 'abl_ids': fields.one2many('adjustment.book.line', 'fb_id',227 'abl_ids': fields.one2many('adjustment.book.line', 'fb_id',
228 'Adjustment Lines',228 'Adjustment Lines',
229 help='Adjustment Lines being recorded in \229 help="Adjustment Lines being recorded in " \
230 a Fiscal Book'),230 " a Fiscal Book"),
231 'note': fields.text('Note'),231 'note': fields.text('Note'),
232 'article_number': fields.selection(232 'article_number': fields.selection(
233 _get_article_number_types,233 _get_article_number_types,
@@ -235,13 +235,13 @@
235 required=True,235 required=True,
236 help="Article number describing the fiscal book special features" \236 help="Article number describing the fiscal book special features" \
237 " according to the Venezuelan RLIVA statement for fiscal" \237 " according to the Venezuelan RLIVA statement for fiscal" \
238 " accounting books. Options:"238 " accounting books. Options:" \
239 " - Art. 75: Pruchase Book."239 " - Art. 75: Pruchase Book." \
240 " - Art. 76: Sale Book. Reflects every individual operation datail."240 " - Art. 76: Sale Book. Reflects every individual operation datail." \
241 " - Art. 77: Sale Book. Groups no tax payer operations in one "241 " - Art. 77: Sale Book. Groups no tax payer operations in one " \
242 " consolidated line. Only fiscal billing."242 " consolidated line. Only fiscal billing." \
243 " - Art. 78: Sale Book. Hybrid for 76 and 77 article. Show"243 " - Art. 78: Sale Book. Hybrid for 76 and 77 article. Show" \
244 " automatic and mechanized operations in individual way, and "244 " automatic and mechanized operations in individual way, and " \
245 " groups fiscal billing operationss in one consolidated line." ),245 " groups fiscal billing operationss in one consolidated line." ),
246246
247 #~ Withholding fields247 #~ Withholding fields
@@ -249,10 +249,10 @@
249 _get_wh,249 _get_wh,
250 type="float", method=True, store=True, multi="get_wh",250 type="float", method=True, store=True, multi="get_wh",
251 string="Current Period Withholding",251 string="Current Period Withholding",
252 help="Used at \252 help="Used at" \
253 1. Totalization row in Fiscal Book Line block at Withholding VAT \253 " 1. Totalization row in Fiscal Book Line block at Withholding" \
254 Column \254 " VAT Column" \
255 2. Second row at the Withholding Summary block"),255 " 2. Second row at the Withholding Summary block"),
256 'get_previous_wh_sum': fields.function(256 'get_previous_wh_sum': fields.function(
257 _get_wh,257 _get_wh,
258 type="float", method=True, store=True, multi="get_wh",258 type="float", method=True, store=True, multi="get_wh",
@@ -267,8 +267,8 @@
267 _get_wh,267 _get_wh,
268 type="float", method=True, store=True, multi="get_wh",268 type="float", method=True, store=True, multi="get_wh",
269 string="Based Tax Debit Sum",269 string="Based Tax Debit Sum",
270 help="Totalization row in Fiscal Book Line block at \270 help="Totalization row in Fiscal Book Line block at" \
271 Based Tax Debit Column"),271 " Based Tax Debit Column"),
272272
273 #~ Printable report data273 #~ Printable report data
274 'get_partner_addr': fields.function(274 'get_partner_addr': fields.function(
@@ -286,22 +286,22 @@
286 type="float", method=True, store=True,286 type="float", method=True, store=True,
287 multi="get_total_with_iva",287 multi="get_total_with_iva",
288 string='Total amount with VAT',288 string='Total amount with VAT',
289 help="Total with VAT Sum (Import/Export, Domestic, Tax Payer and \289 help="Total with VAT Sum (Import/Export, Domestic, Tax Payer and" \
290 No Tax Payer"),290 " No Tax Payer"),
291 'get_vat_sdcf_sum': fields.function(291 'get_vat_sdcf_sum': fields.function(
292 _get_vat_sdcf_sum,292 _get_vat_sdcf_sum,
293 type="float", method=True, store=True,293 type="float", method=True, store=True,
294 string="Exempt and SDCF Tax Sum",294 string="Exempt and SDCF Tax Sum",
295 help="Exempt and Non entitled to tax credit totalization. Sum of SDCF and Exempt Tax Totalization columns for all \295 help="Exempt and Non entitled to tax credit totalization. Sum of" \
296 transaction types"),296 " SDCF and Exempt Tax Totalization columns for all transaction" \
297 " types"),
297 'get_total_tax_credit_debit_base_sum': fields.function(298 'get_total_tax_credit_debit_base_sum': fields.function(
298 _get_total_tax_credit_debit,299 _get_total_tax_credit_debit,
299 type="float", method=True, store=True,300 type="float", method=True, store=True,
300 multi="get_total_tax_credit_debit",301 multi="get_total_tax_credit_debit",
301 string="Tax Credit Total Base Amount",302 string="Tax Credit Total Base Amount",
302 help="Uses at \303 help="Uses at 1. purchase: total row at summary taxes." \
303 1. purchase: total row at summary taxes.\304 " 2. sales: row at summary taxes."),
304 2. sales: row at summary taxes."),
305 'get_total_tax_credit_debit_tax_sum': fields.function(305 'get_total_tax_credit_debit_tax_sum': fields.function(
306 _get_total_tax_credit_debit,306 _get_total_tax_credit_debit,
307 type="float", method=True, store=True,307 type="float", method=True, store=True,
@@ -310,9 +310,9 @@
310 'do_sdcf_and_exempt_sum': fields.float(310 'do_sdcf_and_exempt_sum': fields.float(
311 digits_compute=dp.get_precision('Account'),311 digits_compute=dp.get_precision('Account'),
312 string="Domestic Untaxed VAT Sum",312 string="Domestic Untaxed VAT Sum",
313 help="SDCF and Exempt sum for domestict transanctions. "313 help="SDCF and Exempt sum for domestict transanctions." \
314 "At Sale book represent the sum of Tax Payer and No Tax payer"314 " At Sale book represent the sum of Tax Payer and No Tax payer" \
315 "transactions."),315 " transactions."),
316316
317 #~ Totalization fields for international transactions317 #~ Totalization fields for international transactions
318 'get_total_with_iva_imex_sum': fields.function(318 'get_total_with_iva_imex_sum': fields.function(
@@ -324,48 +324,49 @@
324 'imex_vat_base_sum': fields.float(324 'imex_vat_base_sum': fields.float(
325 digits_compute=dp.get_precision('Account'),325 digits_compute=dp.get_precision('Account'),
326 string="International Taxable Amount",326 string="International Taxable Amount",
327 help="Sum of International Tax Base Amounts (reduced, general and"327 help="Sum of International Tax Base Amounts (reduced, general" \
328 " additional). Used at 2nd row in thw Sale book's summary with "328 " and additional). Used at 2nd row in thw Sale book's summary" \
329 "Exportation Sales title"),329 " with Exportation Sales title"),
330 'imex_exempt_vat_sum': fields.float(330 'imex_exempt_vat_sum': fields.float(
331 digits_compute=dp.get_precision('Account'),331 digits_compute=dp.get_precision('Account'),
332 string="Exempt Tax",332 string="Exempt Tax",
333 help="Import/Export Exempt Tax Totalization: Sum of Exempt column for international transactions"),333 help="Import/Export Exempt Tax Totalization: Sum of Exempt" \
334 " column for international transactions"),
334 'imex_sdcf_vat_sum': fields.float(335 'imex_sdcf_vat_sum': fields.float(
335 digits_compute=dp.get_precision('Account'),336 digits_compute=dp.get_precision('Account'),
336 string="SDCF Tax",337 string="SDCF Tax",
337 help="Import/Export SDCF Tax Totalization: Sum of SDCF column for \338 help="Import/Export SDCF Tax Totalization: Sum of SDCF column" \
338 international transactions"),339 " for international transactions"),
339 'imex_general_vat_base_sum': fields.float(340 'imex_general_vat_base_sum': fields.float(
340 digits_compute=dp.get_precision('Account'),341 digits_compute=dp.get_precision('Account'),
341 string="General VAT Taxable Amount",342 string="General VAT Taxable Amount",
342 help="General VAT Taxed Imports/Exports Base Amount. Sum of \343 help="General VAT Taxed Imports/Exports Base Amount. Sum of" \
343 General VAT Base column for international transactions"),344 " General VAT Base column for international transactions"),
344 'imex_general_vat_tax_sum': fields.float(345 'imex_general_vat_tax_sum': fields.float(
345 digits_compute=dp.get_precision('Account'),346 digits_compute=dp.get_precision('Account'),
346 string="General VAT Taxed Amount",347 string="General VAT Taxed Amount",
347 help="General VAT Taxed Imports/Exports Tax Amount. Sum of \348 help="General VAT Taxed Imports/Exports Tax Amount. Sum of" \
348 General VAT Tax column for international transactions"),349 " General VAT Tax column for international transactions"),
349 'imex_additional_vat_base_sum': fields.float(350 'imex_additional_vat_base_sum': fields.float(
350 digits_compute=dp.get_precision('Account'),351 digits_compute=dp.get_precision('Account'),
351 string="Additional VAT Taxable Amount",352 string="Additional VAT Taxable Amount",
352 help="Additional VAT Taxed Imports/Exports Base Amount. Sum of \353 help="Additional VAT Taxed Imports/Exports Base Amount. Sum of" \
353 Additional VAT Base column for international transactions"),354 " Additional VAT Base column for international transactions"),
354 'imex_additional_vat_tax_sum': fields.float(355 'imex_additional_vat_tax_sum': fields.float(
355 digits_compute=dp.get_precision('Account'),356 digits_compute=dp.get_precision('Account'),
356 string="Additional VAT Taxed Amount",357 string="Additional VAT Taxed Amount",
357 help="Additional VAT Taxed Imports/Exports Tax Amount. Sum of \358 help="Additional VAT Taxed Imports/Exports Tax Amount. Sum of " \
358 Additional VAT Tax column for international transactions"),359 " Additional VAT Tax column for international transactions"),
359 'imex_reduced_vat_base_sum': fields.float(360 'imex_reduced_vat_base_sum': fields.float(
360 digits_compute=dp.get_precision('Account'),361 digits_compute=dp.get_precision('Account'),
361 string="Reduced VAT Taxable Amount",362 string="Reduced VAT Taxable Amount",
362 help="Reduced VAT Taxed Imports/Exports Base Amount. Sum of \363 help="Reduced VAT Taxed Imports/Exports Base Amount. Sum of " \
363 Reduced VAT Base column for international transactions"),364 " Reduced VAT Base column for international transactions"),
364 'imex_reduced_vat_tax_sum': fields.float(365 'imex_reduced_vat_tax_sum': fields.float(
365 digits_compute=dp.get_precision('Account'),366 digits_compute=dp.get_precision('Account'),
366 string="Reduced VAT Taxed Amount",367 string="Reduced VAT Taxed Amount",
367 help="Reduced VAT Taxed Imports/Exports Tax Amount. Sum of \368 help="Reduced VAT Taxed Imports/Exports Tax Amount. Sum of " \
368 Reduced VAT Tax column for international transactions"),369 " Reduced VAT Tax column for international transactions"),
369370
370 #~ Totalization fields for domestic transactions371 #~ Totalization fields for domestic transactions
371 'get_total_with_iva_do_sum': fields.function(372 'get_total_with_iva_do_sum': fields.function(
@@ -377,71 +378,71 @@
377 'do_vat_base_sum': fields.float(378 'do_vat_base_sum': fields.float(
378 digits_compute=dp.get_precision('Account'),379 digits_compute=dp.get_precision('Account'),
379 string="Domestic Taxable Amount",380 string="Domestic Taxable Amount",
380 help="Sum of all domestic transaction base amounts (reduced, \381 help="Sum of all domestic transaction base amounts (reduced," \
381 general and additional)"),382 " general and additional)"),
382 'do_exempt_vat_sum': fields.float(383 'do_exempt_vat_sum': fields.float(
383 digits_compute=dp.get_precision('Account'),384 digits_compute=dp.get_precision('Account'),
384 string="Exempt Tax",385 string="Exempt Tax",
385 help="Domestic Exempt Tax Totalization. For Purchase Book it sums"386 help="Domestic Exempt Tax Totalization. For Purchase Book it" \
386 " Exempt column for domestic transactions. For Sale Book it sums"387 " sums Exempt column for domestic transactions. For Sale Book it" \
387 " Tax Payer and No Tax Payer Exempt columns"),388 " sums Tax Payer and No Tax Payer Exempt columns"),
388 'do_sdcf_vat_sum': fields.float(389 'do_sdcf_vat_sum': fields.float(
389 digits_compute=dp.get_precision('Account'),390 digits_compute=dp.get_precision('Account'),
390 string="SDCF Tax",391 string="SDCF Tax",
391 help="Domestic SDCF Tax Totalization. For Purchase Book it sums"392 help="Domestic SDCF Tax Totalization. For Purchase Book it sums" \
392 " SDCF column for domestic transactions. For Sale Book it sums"393 " SDCF column for domestic transactions. For Sale Book it sums" \
393 " Tax Payer and No Tax Payer SDCF columns"),394 " Tax Payer and No Tax Payer SDCF columns"),
394 'do_general_vat_base_sum': fields.float(395 'do_general_vat_base_sum': fields.float(
395 digits_compute=dp.get_precision('Account'),396 digits_compute=dp.get_precision('Account'),
396 string="General VAT Taxable Amount",397 string="General VAT Taxable Amount",
397 help="General VAT Taxed Domestic Base Amount Totalization. " \398 help="General VAT Taxed Domestic Base Amount Totalization." \
398 "For Purchase Book it sums General VAT Base column for domestic"399 " For Purchase Book it sums General VAT Base column for domestic" \
399 " transactions. For Sale Book it sums Tax Payer and No Tax Payer"400 " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \
400 " General VAT Base columns"),401 " General VAT Base columns"),
401 'do_general_vat_tax_sum': fields.float(402 'do_general_vat_tax_sum': fields.float(
402 digits_compute=dp.get_precision('Account'),403 digits_compute=dp.get_precision('Account'),
403 string="General VAT Taxed Amount",404 string="General VAT Taxed Amount",
404 help="General VAT Taxed Domestic Tax Amount Totalization. " \405 help="General VAT Taxed Domestic Tax Amount Totalization." \
405 "For Purchase Book it sums General VAT Tax column for domestic"406 " For Purchase Book it sums General VAT Tax column for domestic" \
406 " transactions. For Sale Book it sums Tax Payer and No Tax Payer"407 " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \
407 " General VAT Tax columns"),408 " General VAT Tax columns"),
408 'do_additional_vat_base_sum': fields.float(409 'do_additional_vat_base_sum': fields.float(
409 digits_compute=dp.get_precision('Account'),410 digits_compute=dp.get_precision('Account'),
410 string="Additional VAT Taxable Amount",411 string="Additional VAT Taxable Amount",
411 help="Additional VAT Taxed Domestic Base Amount Totalization."412 help="Additional VAT Taxed Domestic Base Amount Totalization." \
412 "For Purchase Book it sums Additional VAT Base column for domestic"413 " For Purchase Book it sums Additional VAT Base column for" \
413 " transactions. For Sale Book it sums Tax Payer and No Tax Payer"414 " domestic transactions. For Sale Book it sums Tax Payer and No" \
414 " Additional VAT Base columns"),415 " Tax Payer Additional VAT Base columns"),
415 'do_additional_vat_tax_sum': fields.float(416 'do_additional_vat_tax_sum': fields.float(
416 digits_compute=dp.get_precision('Account'),417 digits_compute=dp.get_precision('Account'),
417 string="Additional VAT Taxed Amount",418 string="Additional VAT Taxed Amount",
418 help="Additional VAT Taxed Domestic Tax Amount Totalization. "419 help="Additional VAT Taxed Domestic Tax Amount Totalization." \
419 "For Purchase Book it sums Additional VAT Tax column for domestic"420 " For Purchase Book it sums Additional VAT Tax column for" \
420 " transactions. For Sale Book it sums Tax Payer and No Tax Payer"421 " domestic transactions. For Sale Book it sums Tax Payer and No" \
421 " Additional VAT Tax columns"),422 " Tax Payer Additional VAT Tax columns"),
422 'do_reduced_vat_base_sum': fields.float(423 'do_reduced_vat_base_sum': fields.float(
423 digits_compute=dp.get_precision('Account'),424 digits_compute=dp.get_precision('Account'),
424 string="Reduced VAT Taxable Amount",425 string="Reduced VAT Taxable Amount",
425 help="Reduced VAT Taxed Domestic Base Amount Totalization. "426 help="Reduced VAT Taxed Domestic Base Amount Totalization." \
426 "For Purchase Book it sums Reduced VAT Base column for domestic"427 " For Purchase Book it sums Reduced VAT Base column for domestic" \
427 " transactions. For Sale Book it sums Tax Payer and No Tax Payer"428 " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \
428 " Reduced VAT Base columns"),429 " Reduced VAT Base columns"),
429 'do_reduced_vat_tax_sum': fields.float(430 'do_reduced_vat_tax_sum': fields.float(
430 digits_compute=dp.get_precision('Account'),431 digits_compute=dp.get_precision('Account'),
431 string="Reduced VAT Taxed Amount",432 string="Reduced VAT Taxed Amount",
432 help="Reduced VAT Taxed Domestic Tax Amount Totalization. "433 help="Reduced VAT Taxed Domestic Tax Amount Totalization." \
433 "For Purchase Book it sums Reduced VAT Tax column for domestic"434 " For Purchase Book it sums Reduced VAT Tax column for domestic" \
434 " transactions. For Sale Book it sums Tax Payer and No Tax Payer"435 " transactions. For Sale Book it sums Tax Payer and No Tax Payer" \
435 " Reduced VAT Tax columns"),436 " Reduced VAT Tax columns"),
436437
437 #~ Apply only for sale book438 #~ Apply only for sale book
438 #~ Totalization fields for tax payer and no tax payer transactions439 #~ Totalization fields for tax payer and no tax payer transactions
439 'ntp_fbl_ids': fields.one2many("fiscal.book.line", "ntp_fb_id",440 'ntp_fbl_ids': fields.one2many("fiscal.book.line", "ntp_fb_id",
440 string = "No Tax Payer Detail Lines",441 string = "No Tax Payer Detail Lines",
441 help="No Tax Payer Lines that are"442 help="No Tax Payer Lines that are" \
442 " grouped by the statement law that"443 " grouped by the statement law that" \
443 " represent the data of are consolidate"444 " represent the data of are" \
444 "book lines"),445 " consolidate book lines"),
445 'get_total_with_iva_tp_sum': fields.function(446 'get_total_with_iva_tp_sum': fields.function(
446 _get_total_with_iva_sum,447 _get_total_with_iva_sum,
447 type="float", method=True, store=True,448 type="float", method=True, store=True,
@@ -451,48 +452,48 @@
451 'tp_vat_base_sum': fields.float(452 'tp_vat_base_sum': fields.float(
452 digits_compute=dp.get_precision('Account'),453 digits_compute=dp.get_precision('Account'),
453 string="Tax Payer Taxable Amount",454 string="Tax Payer Taxable Amount",
454 help="Sum of all Tax Payer Grand Base Sum (reduced, general and " \455 help="Sum of all Tax Payer Grand Base Sum (reduced, general and" \
455 "additional taxes)"),456 " additional taxes)"),
456 'tp_exempt_vat_sum': fields.float(457 'tp_exempt_vat_sum': fields.float(
457 digits_compute=dp.get_precision('Account'),458 digits_compute=dp.get_precision('Account'),
458 string="Exempt Tax",459 string="Exempt Tax",
459 help="Tax Payer Exempt Tax Totalization. Sum of Exempt column " \460 help="Tax Payer Exempt Tax Totalization. Sum of Exempt column" \
460 "for tax payer transactions"),461 " for tax payer transactions"),
461 'tp_sdcf_vat_sum': fields.float(462 'tp_sdcf_vat_sum': fields.float(
462 digits_compute=dp.get_precision('Account'),463 digits_compute=dp.get_precision('Account'),
463 string="SDCF Tax",464 string="SDCF Tax",
464 help="Tax Payer SDCF Tax Totalization. Sum of SDCF column for " \465 help="Tax Payer SDCF Tax Totalization. Sum of SDCF column for" \
465 "tax payer transactions"),466 " tax payer transactions"),
466 'tp_general_vat_base_sum': fields.float(467 'tp_general_vat_base_sum': fields.float(
467 digits_compute=dp.get_precision('Account'),468 digits_compute=dp.get_precision('Account'),
468 string="General VAT Taxable Amount",469 string="General VAT Taxable Amount",
469 help="General VAT Taxed Tax Payer Base Amount Totalization. " \470 help="General VAT Taxed Tax Payer Base Amount Totalization." \
470 "Sum of General VAT Base column for taxy payer transactions"),471 " Sum of General VAT Base column for taxy payer transactions"),
471 'tp_general_vat_tax_sum': fields.float(472 'tp_general_vat_tax_sum': fields.float(
472 digits_compute=dp.get_precision('Account'),473 digits_compute=dp.get_precision('Account'),
473 string="General VAT Taxed Amount",474 string="General VAT Taxed Amount",
474 help="General VAT Taxed Tax Payer Tax Amount Totalization. " \475 help="General VAT Taxed Tax Payer Tax Amount Totalization." \
475 "Sum of General VAT Tax column for tax payer transactions"),476 " Sum of General VAT Tax column for tax payer transactions"),
476 'tp_additional_vat_base_sum': fields.float(477 'tp_additional_vat_base_sum': fields.float(
477 digits_compute=dp.get_precision('Account'),478 digits_compute=dp.get_precision('Account'),
478 string="Additional VAT Taxable Amount",479 string="Additional VAT Taxable Amount",
479 help="Additional VAT Taxed Tax Payer Base Amount Totalization. " \480 help="Additional VAT Taxed Tax Payer Base Amount Totalization." \
480 "Sum of Additional VAT Base column for tax payer transactions"),481 " Sum of Additional VAT Base column for tax payer transactions"),
481 'tp_additional_vat_tax_sum': fields.float(482 'tp_additional_vat_tax_sum': fields.float(
482 digits_compute=dp.get_precision('Account'),483 digits_compute=dp.get_precision('Account'),
483 string="Additional VAT Taxed Amount",484 string="Additional VAT Taxed Amount",
484 help="Additional VAT Taxed Tax Payer Tax Amount Totalization. " \485 help="Additional VAT Taxed Tax Payer Tax Amount Totalization." \
485 "Sum of Additional VAT Tax column for tax payer transactions"),486 " Sum of Additional VAT Tax column for tax payer transactions"),
486 'tp_reduced_vat_base_sum': fields.float(487 'tp_reduced_vat_base_sum': fields.float(
487 digits_compute=dp.get_precision('Account'),488 digits_compute=dp.get_precision('Account'),
488 string="Reduced VAT Taxable Amount",489 string="Reduced VAT Taxable Amount",
489 help="Reduced VAT Taxed Tax Payer Base Amount Totalization. " \490 help="Reduced VAT Taxed Tax Payer Base Amount Totalization." \
490 "Sum of Reduced VAT Base column for tax payer transactions"),491 " Sum of Reduced VAT Base column for tax payer transactions"),
491 'tp_reduced_vat_tax_sum': fields.float(492 'tp_reduced_vat_tax_sum': fields.float(
492 digits_compute=dp.get_precision('Account'),493 digits_compute=dp.get_precision('Account'),
493 string="Reduced VAT Taxed Amount",494 string="Reduced VAT Taxed Amount",
494 help="Reduced VAT Taxed Tax Payer Tax Amount Totalization. " \495 help="Reduced VAT Taxed Tax Payer Tax Amount Totalization." \
495 "Sum of Reduced VAT Tax column for tax payer transactions"),496 " Sum of Reduced VAT Tax column for tax payer transactions"),
496497
497 'get_total_with_iva_ntp_sum': fields.function(498 'get_total_with_iva_ntp_sum': fields.function(
498 _get_total_with_iva_sum,499 _get_total_with_iva_sum,
@@ -503,48 +504,48 @@
503 'ntp_vat_base_sum': fields.float(504 'ntp_vat_base_sum': fields.float(
504 digits_compute=dp.get_precision('Account'),505 digits_compute=dp.get_precision('Account'),
505 string="No Tax Payer Taxable Amount",506 string="No Tax Payer Taxable Amount",
506 help="No Tax Payer Grand Base Totalization. Sum of all no tax " \507 help="No Tax Payer Grand Base Totalization. Sum of all no tax" \
507 "payer tax bases (reduced, general and additional)"),508 " payer tax bases (reduced, general and additional)"),
508 'ntp_exempt_vat_sum': fields.float(509 'ntp_exempt_vat_sum': fields.float(
509 digits_compute=dp.get_precision('Account'),510 digits_compute=dp.get_precision('Account'),
510 string="Exempt Tax",511 string="Exempt Tax",
511 help="No Tax Payer Exempt Tax Totalization. Sum of Exempt " \512 help="No Tax Payer Exempt Tax Totalization. Sum of Exempt" \
512 "column for no tax payer transactions"),513 " column for no tax payer transactions"),
513 'ntp_sdcf_vat_sum': fields.float(514 'ntp_sdcf_vat_sum': fields.float(
514 digits_compute=dp.get_precision('Account'),515 digits_compute=dp.get_precision('Account'),
515 string="SDCF Tax",516 string="SDCF Tax",
516 help="No Tax Payer SDCF Tax Totalization. Sum of SDCF column " \517 help="No Tax Payer SDCF Tax Totalization. Sum of SDCF column" \
517 "for no tax payer transactions"),518 " for no tax payer transactions"),
518 'ntp_general_vat_base_sum': fields.float(519 'ntp_general_vat_base_sum': fields.float(
519 digits_compute=dp.get_precision('Account'),520 digits_compute=dp.get_precision('Account'),
520 string="General VAT Taxable Amount",521 string="General VAT Taxable Amount",
521 help="General VAT Taxed No Tax Payer Base Amount Totalization. " \522 help="General VAT Taxed No Tax Payer Base Amount Totalization." \
522 "Sum of General VAT Base column for taxy payer transactions"),523 " Sum of General VAT Base column for taxy payer transactions"),
523 'ntp_general_vat_tax_sum': fields.float(524 'ntp_general_vat_tax_sum': fields.float(
524 digits_compute=dp.get_precision('Account'),525 digits_compute=dp.get_precision('Account'),
525 string="General VAT Taxed Amount",526 string="General VAT Taxed Amount",
526 help="General VAT Taxed No Tax Payer Tax Amount Totalization. " \527 help="General VAT Taxed No Tax Payer Tax Amount Totalization." \
527 "Sum of General VAT Tax column for no tax payer transactions"),528 " Sum of General VAT Tax column for no tax payer transactions"),
528 'ntp_additional_vat_base_sum': fields.float(529 'ntp_additional_vat_base_sum': fields.float(
529 digits_compute=dp.get_precision('Account'),530 digits_compute=dp.get_precision('Account'),
530 string="Additional VAT Taxable Amount",531 string="Additional VAT Taxable Amount",
531 help="Additional VAT Taxed No Tax Payer Base Amount Totalization. " \532 help="Additional VAT Taxed No Tax Payer Base Amount Totalization." \
532 "Sum of Additional VAT Base column for no tax payer transactions"),533 " Sum of Additional VAT Base column for no tax payer transactions"),
533 'ntp_additional_vat_tax_sum': fields.float(534 'ntp_additional_vat_tax_sum': fields.float(
534 digits_compute=dp.get_precision('Account'),535 digits_compute=dp.get_precision('Account'),
535 string="Additional VAT Taxed Amount",536 string="Additional VAT Taxed Amount",
536 help="Additional VAT Taxed No Tax Payer Tax Amount Totalization. " \537 help="Additional VAT Taxed No Tax Payer Tax Amount Totalization." \
537 "Sum of Additional VAT Tax column for no tax payer transactions"),538 " Sum of Additional VAT Tax column for no tax payer transactions"),
538 'ntp_reduced_vat_base_sum': fields.float(539 'ntp_reduced_vat_base_sum': fields.float(
539 digits_compute=dp.get_precision('Account'),540 digits_compute=dp.get_precision('Account'),
540 string="Reduced VAT Taxable Amount",541 string="Reduced VAT Taxable Amount",
541 help="Reduced VAT Taxed No Tax Payer Base Amount Totalization. " \542 help="Reduced VAT Taxed No Tax Payer Base Amount Totalization." \
542 "Sum of Reduced VAT Base column for no tax payer transactions"),543 " Sum of Reduced VAT Base column for no tax payer transactions"),
543 'ntp_reduced_vat_tax_sum': fields.float(544 'ntp_reduced_vat_tax_sum': fields.float(
544 digits_compute=dp.get_precision('Account'),545 digits_compute=dp.get_precision('Account'),
545 string="Reduced VAT Taxed Amount",546 string="Reduced VAT Taxed Amount",
546 help="Reduced VAT Taxed No Tax Payer Tax Amount Totalization. " \547 help="Reduced VAT Taxed No Tax Payer Tax Amount Totalization." \
547 "Sum of Reduced VAT Tax column for no tax payer transactions"),548 " Sum of Reduced VAT Tax column for no tax payer transactions"),
548 }549 }
549550
550 _defaults = {551 _defaults = {
@@ -612,8 +613,6 @@
612 #~ Relate invoices613 #~ Relate invoices
613 inv_ids = self._get_invoice_ids(cr, uid, fb_id, context=context)614 inv_ids = self._get_invoice_ids(cr, uid, fb_id, context=context)
614 inv_obj.write(cr, uid, inv_ids, {'fb_id': fb_id}, context=context)615 inv_obj.write(cr, uid, inv_ids, {'fb_id': fb_id}, context=context)
615 #~ update book taxes
616 self.update_book_taxes(cr, uid, fb_id, context=context)
617616
618 #~ TODO: move this process to the cancel process of the invoice617 #~ TODO: move this process to the cancel process of the invoice
619 #~ Unrelate invoices (period book change, invoice now cancel/draft or618 #~ Unrelate invoices (period book change, invoice now cancel/draft or
@@ -699,8 +698,8 @@
699 #~ Relate wh iva lines698 #~ Relate wh iva lines
700 iwdl_ids = self._get_wh_iva_line_ids(cr, uid, fb_id, context=context)699 iwdl_ids = self._get_wh_iva_line_ids(cr, uid, fb_id, context=context)
701700
702 if fb_brw.type == "sale" \701 if fb_brw.type == "sale" and iwdl_ids \
703 and fb_brw.company_id.partner_id.wh_iva_agent and iwdl_ids:702 and not fb_brw.company_id.partner_id.wh_iva_agent:
704 raise osv.except_osv(_("Error!"),703 raise osv.except_osv(_("Error!"),
705 _("You have withholdings registred but you are not a withholding agent"))704 _("You have withholdings registred but you are not a withholding agent"))
706705
@@ -715,28 +714,6 @@
715 context=context)714 context=context)
716 return True715 return True
717716
718 def _get_book_taxes_ids(self, cr, uid, fb_id, context=None):
719 """ It returns account invoice taxes IDs from the fiscal book
720 invoices.
721 @param fb_id: fiscal book id
722 """
723 context = context or {}
724 ait_ids = []
725 for inv_brw in self.browse(cr, uid, fb_id,
726 context=context).invoice_ids:
727 ait_ids += [ait.id for ait in inv_brw.tax_line]
728 return ait_ids
729
730 def update_book_taxes(self, cr, uid, fb_id, context=None):
731 """ It relate the invoices taxes from the period to the book.
732 @param fb_id: fiscal book id
733 """
734 context = context or {}
735 ait_ids = self._get_book_taxes_ids(cr, uid, fb_id, context=context)
736 data = map(lambda x: (0, 0, {'ait_id': x}), ait_ids)
737 self.write(cr, uid, fb_id, {'fbt_ids': data}, context=context)
738 return True
739
740 def _get_invoice_iwdl_id(self, cr, uid, fb_id, inv_id, context=None):717 def _get_invoice_iwdl_id(self, cr, uid, fb_id, inv_id, context=None):
741 """ It check if the invoice have wh iva lines asociated and if its718 """ It check if the invoice have wh iva lines asociated and if its
742 check if it is at the same period. Return the wh iva line ID or False719 check if it is at the same period. Return the wh iva line ID or False
@@ -1594,6 +1571,19 @@
1594 or (fb_brw.type == 'purchase' and 'do' \1571 or (fb_brw.type == 'purchase' and 'do' \
1595 or (inv_brw.partner_id.vat_subjected and 'tp' or 'ntp' ))1572 or (inv_brw.partner_id.vat_subjected and 'tp' or 'ntp' ))
15961573
1574 def unlink(self, cr, uid, ids, context=None):
1575 """ Overwrite the unlink method to throw an exception if the book is
1576 not in cancel state."""
1577 context = context or {}
1578 for fb_brw in self.browse(cr, uid, ids, context=context):
1579 if fb_brw.state != 'cancel':
1580 raise osv.except_osv("Invalid Procedure!!",
1581 "Youre book needs to be in cancel state to be deleted.")
1582 else:
1583 super(fiscal_book,self).unlink(cr, uid, ids, context=context)
1584 return True
1585
1586
1597class fiscal_book_lines(orm.Model):1587class fiscal_book_lines(orm.Model):
15981588
1599 def _get_wh_vat(self, cr, uid, ids, field_name, arg, context=None):1589 def _get_wh_vat(self, cr, uid, ids, field_name, arg, context=None):
@@ -1633,23 +1623,23 @@
1633 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',1623 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
1634 help='Fiscal Book that owns this book line'),1624 help='Fiscal Book that owns this book line'),
1635 'ntp_fb_id': fields.many2one("fiscal.book", "No Tax Payer Detail",1625 'ntp_fb_id': fields.many2one("fiscal.book", "No Tax Payer Detail",
1636 help="Fiscal Book that owns this book line"1626 help="Fiscal Book that owns this book line" \
1637 "This Book is only for no tax payer lines"),1627 " This Book is only for no tax payer lines"),
1638 'fbt_ids': fields.one2many('fiscal.book.taxes', 'fbl_id',1628 'fbt_ids': fields.one2many('fiscal.book.taxes', 'fbl_id',
1639 string='Tax Lines', help='Tax Lines being \1629 string='Tax Lines', help="Tax Lines being" \
1640 recorded in a Fiscal Book'),1630 " recorded in a Fiscal Book"),
1641 'invoice_id': fields.many2one('account.invoice', 'Invoice',1631 'invoice_id': fields.many2one('account.invoice', 'Invoice',
1642 help='Invoice related to this book \1632 help="Invoice related to this book" \
1643 line'),1633 " line"),
1644 'iwdl_id': fields.many2one('account.wh.iva.line', 'Vat Withholding',1634 'iwdl_id': fields.many2one('account.wh.iva.line', 'Vat Withholding',
1645 help='Withholding iva line related to this \1635 help="Withholding iva line related to" \
1646 book line'),1636 " this book line"),
1647 'parent_id': fields.many2one(1637 'parent_id': fields.many2one(
1648 "fiscal.book.line",1638 "fiscal.book.line",
1649 string="Consolidated Line",1639 string="Consolidated Line",
1650 ondelete='cascade',1640 ondelete='cascade',
1651 help="No Tax Payer Consolidated Line. Indicate the id of the "1641 help="No Tax Payer Consolidated Line. Indicate the id of the" \
1652 "consolidated line where this no tax payer line belongs"),1642 " consolidated line where this no tax payer line belongs"),
1653 'parent_left': fields.integer('Left Parent', select=1),1643 'parent_left': fields.integer('Left Parent', select=1),
1654 'parent_right': fields.integer('Right Parent', select=1),1644 'parent_right': fields.integer('Right Parent', select=1),
1655 'child_ids': fields.one2many(1645 'child_ids': fields.one2many(
@@ -1665,16 +1655,16 @@
1665 help='Invoice Document Date / Wh IVA Line Voucher Date'),1655 help='Invoice Document Date / Wh IVA Line Voucher Date'),
1666 'accounting_date': fields.date(1656 'accounting_date': fields.date(
1667 string='Accounting Date',1657 string='Accounting Date',
1668 help='The day of the accounting record [(invoice, date_invoice), \1658 help="The day of the accounting record [(invoice, date_invoice)," \
1669 (wh iva line, date_ret)]'),1659 " (wh iva line, date_ret)]"),
1670 'doc_type': fields.char('Doc. Type', size=8, help='Document Type'),1660 'doc_type': fields.char('Doc. Type', size=8, help='Document Type'),
1671 'partner_name': fields.char(size=128, string='Partner Name', help=''),1661 'partner_name': fields.char(size=128, string='Partner Name', help=''),
1672 'partner_vat': fields.char(size=128, string='Partner TIN', help=''),1662 'partner_vat': fields.char(size=128, string='Partner TIN', help=''),
1673 'affected_invoice': fields.char(1663 'affected_invoice': fields.char(
1674 string='Affected Invoice',1664 string='Affected Invoice',
1675 size=64,1665 size=64,
1676 help="For an invoice line type means parent invoice for a Debit "1666 help="For an invoice line type means parent invoice for a Debit" \
1677 " or Credit Note. For an withholding line type means the invoice"1667 " or Credit Note. For an withholding line type means the invoice" \
1678 " number related to the withholding"),1668 " number related to the withholding"),
1679 #~ Apply for wh iva lines1669 #~ Apply for wh iva lines
1680 'get_wh_vat': fields.function(_get_wh_vat,1670 'get_wh_vat': fields.function(_get_wh_vat,
@@ -1682,7 +1672,7 @@
1682 string="Withholding VAT",1672 string="Withholding VAT",
1683 help="Withholding VAT"),1673 help="Withholding VAT"),
1684 'wh_number': fields.char(string='Withholding number', size=64,1674 'wh_number': fields.char(string='Withholding number', size=64,
1685 help=''),1675 help=""),
1686 'affected_invoice_date': fields.date(string="Affected Invoice Date",1676 'affected_invoice_date': fields.date(string="Affected Invoice Date",
1687 help=""),1677 help=""),
1688 'wh_rate': fields.float(string="Withholding percentage",1678 'wh_rate': fields.float(string="Withholding percentage",
@@ -1691,16 +1681,16 @@
1691 _get_based_tax_debit,1681 _get_based_tax_debit,
1692 type="float", method=True, store=True,1682 type="float", method=True, store=True,
1693 string="Based Tax Debit",1683 string="Based Tax Debit",
1694 help="Sum of all tax amount for the taxes realeted to the \1684 help="Sum of all tax amount for the taxes realeted to the wh iva" \
1695 wh iva line."),1685 " line."),
16961686
1697 #~ Apply for invoice lines1687 #~ Apply for invoice lines
1698 'ctrl_number': fields.char(string='Invoice Control number', size=64,1688 'ctrl_number': fields.char(string='Invoice Control number', size=64,
1699 help=''),1689 help=''),
1700 'invoice_number': fields.char(string='Invoice number', size=64,1690 'invoice_number': fields.char(string='Invoice number', size=64,
1701 help="Invoice Number. In case of use"1691 help="Invoice Number. In case of use" \
1702 " of fiscal printer this field will "1692 " of fiscal printer this field will" \
1703 " store the invoice number generate"1693 " store the invoice number generate" \
1704 " by the fiscal printer machine"),1694 " by the fiscal printer machine"),
1705 'imex_date': fields.date(string='Imex Date',1695 'imex_date': fields.date(string='Imex Date',
1706 help='Invoice Importation/Exportation Date'),1696 help='Invoice Importation/Exportation Date'),
@@ -1717,9 +1707,9 @@
1717 ('tp', 'Tax Payer'),1707 ('tp', 'Tax Payer'),
1718 ('ntp', 'No Tax Payer')],1708 ('ntp', 'No Tax Payer')],
1719 string = 'Transaction Type', required=True,1709 string = 'Transaction Type', required=True,
1720 help="Book line transtaction type: \1710 help="Book line transtaction type:" \
1721 - Purchase: Import or Domestic. \1711 " - Purchase: Import or Domestic." \
1722 - Sales: Expertation, Tax Payer, No Tax Payer."),1712 " - Sales: Expertation, Tax Payer, No Tax Payer."),
1723 'void_form': fields.char(string='Transaction type', size=192,1713 'void_form': fields.char(string='Transaction type', size=192,
1724 help="Operation Type"),1714 help="Operation Type"),
1725 'fiscal_printer': fields.char(string='Fiscal machine number',1715 'fiscal_printer': fields.char(string='Fiscal machine number',
@@ -1728,26 +1718,26 @@
1728 'custom_statement': fields.char(string="Custom Statement",1718 'custom_statement': fields.char(string="Custom Statement",
1729 size=192, help=""),1719 size=192, help=""),
1730 #~ -- taxes fields1720 #~ -- taxes fields
1731 'total_with_iva': fields.float('Total with IVA', help="Sub Total \1721 'total_with_iva': fields.float('Total with IVA', help="Sub Total of" \
1732 of the invoice (untaxed amount) plus \1722 " the invoice (untaxed amount) plus" \
1733 all tax amount of the related taxes"),1723 " all tax amount of the related taxes"),
1734 'vat_sdcf': fields.float("SDCF", help="Not entitled to tax credit \1724 'vat_sdcf': fields.float("SDCF", help="Not entitled to tax credit" \
1735 (The field name correspond to the spanih \1725 " (The field name correspond to the spanih" \
1736 acronym for 'Sin Derecho a Credito Fiscal')"),1726 " acronym for 'Sin Derecho a Credito Fiscal')"),
1737 'vat_exempt': fields.float("Exempt", help="Exempt is a Tax with 0 \1727 'vat_exempt': fields.float("Exempt", help="Exempt is a Tax with 0" \
1738 tax percentage"),1728 " tax percentage"),
1739 'vat_reduced_base': fields.float("RED BASE", help="Vat Reduced Base \1729 'vat_reduced_base': fields.float("RED BASE", help="Vat Reduced Base" \
1740 Amount"),1730 " Amount"),
1741 'vat_reduced_tax': fields.float("RED TAX", help="Vat Reduced Tax \1731 'vat_reduced_tax': fields.float("RED TAX", help="Vat Reduced Tax" \
1742 Amount"),1732 " Amount"),
1743 'vat_general_base': fields.float("GRAL BASE",help="Vat General Base \1733 'vat_general_base': fields.float("GRAL BASE",help="Vat General Base" \
1744 Amount"),1734 " Amount"),
1745 'vat_general_tax': fields.float("GRAL TAX", help="Vat General Tax \1735 'vat_general_tax': fields.float("GRAL TAX", help="Vat General Tax" \
1746 Amount"),1736 " Amount"),
1747 'vat_additional_base': fields.float("ADD BASE", help="Vat Generald \1737 'vat_additional_base': fields.float("ADD BASE", help="Vat Generald" \
1748 plus Additional Base Amount"),1738 " plus Additional Base Amount"),
1749 'vat_additional_tax': fields.float("ADD TAX", help="Vat General plus \1739 'vat_additional_tax': fields.float("ADD TAX", help="Vat General plus" \
1750 Additional Tax Amount"),1740 " Additional Tax Amount"),
1751 }1741 }
17521742
17531743
@@ -1803,9 +1793,9 @@
1803 ('tp', 'Tax Payer'),1793 ('tp', 'Tax Payer'),
1804 ('ntp', 'No Tax Payer')],1794 ('ntp', 'No Tax Payer')],
1805 string = 'Operation Type',1795 string = 'Operation Type',
1806 help="Operation Type: \1796 help="Operation Type:" \
1807 - Purchase: Import or Domestic. \1797 " - Purchase: Import or Domestic." \
1808 - Sales: Expertation, Tax Payer, No Tax Payer."),1798 " - Sales: Expertation, Tax Payer, No Tax Payer."),
1809 'base_amount_sum': fields.float('Taxable Amount Sum'),1799 'base_amount_sum': fields.float('Taxable Amount Sum'),
1810 'tax_amount_sum': fields.float('Taxed Amount Sum'),1800 'tax_amount_sum': fields.float('Taxed Amount Sum'),
1811 }1801 }
@@ -1839,8 +1829,8 @@
1839 'type_doc': fields.selection([1829 'type_doc': fields.selection([
1840 ('F', 'Invoice'), ('ND', 'Debit Note'), ('NC', 'Credit Note'), ],1830 ('F', 'Invoice'), ('ND', 'Debit Note'), ('NC', 'Credit Note'), ],
1841 'Document Type', select=True, required=True,1831 'Document Type', select=True, required=True,
1842 help="Type of Document for adjustment book: \1832 help="Type of Document for adjustment book:"
1843 -Invoice(F),-Debit Note(dn),-Credit Note(cn)"),1833 " -Invoice(F),-Debit Note(dn),-Credit Note(cn)"),
1844 'doc_affected': fields.char(1834 'doc_affected': fields.char(
1845 'Affected Document', size=256, required=True,1835 'Affected Document', size=256, required=True,
1846 help="Affected Document for adjustment book"),1836 help="Affected Document for adjustment book"),
18471837
=== modified file 'l10n_ve_fiscal_book/model/invoice.py'
--- l10n_ve_fiscal_book/model/invoice.py 2013-04-25 16:22:59 +0000
+++ l10n_ve_fiscal_book/model/invoice.py 2013-06-04 20:15:34 +0000
@@ -31,17 +31,18 @@
3131
32 _columns = {32 _columns = {
33 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',33 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
34 help='Fiscal Book where this line is \34 help="Fiscal Book where this line is" \
35 related to'),35 " related to"),
36 'issue_fb_id': fields.many2one('fiscal.book', 'Fiscal Book',36 'issue_fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
37 help='Fiscal Book where this invoice \37 help="Fiscal Book where this invoice" \
38 needs to be add'),38 " needs to be add"),
39 # TODO: THIS FIELD TO BE CHANGED TO A STORABLE FUNCTIONAL FIELD39 # TODO: THIS FIELD TO BE CHANGED TO A STORABLE FUNCTIONAL FIELD
40 # CHANGE EVEN FROM boolean to selection40 # CHANGE EVEN FROM boolean to selection
41 'fb_submitted': fields.boolean('Fiscal Book Submitted?',41 'fb_submitted': fields.boolean('Fiscal Book Submitted?',
42 help='Indicates if this invoice is in \42 help="Indicates if this invoice is in" \
43 a Fiscal Book which has being already \43 " a Fiscal Book which has being" \
44 submitted to the statutory institute'),44 " already submitted to the statutory" \
45 " institute"),
45 }46 }
4647
47inherited_invoice()48inherited_invoice()
4849
=== modified file 'l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py'
--- l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py 2013-04-16 16:53:35 +0000
+++ l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py 2013-06-04 20:15:34 +0000
@@ -44,8 +44,8 @@
44 ids = self.pool.get('account.period').search(44 ids = self.pool.get('account.period').search(
45 cr, uid, [('date_start', '<=', dt), ('date_stop', '>=', dt)])45 cr, uid, [('date_start', '<=', dt), ('date_stop', '>=', dt)])
46 if not ids:46 if not ids:
47 raise osv.except_osv(_('Error !'), _('No period defined for this \47 raise osv.except_osv(_('Error !'), _('No period defined for this' \
48 date !\nPlease create a fiscal year.'))48 ' date !\nPlease create a fiscal year.'))
49 return ids49 return ids
5050
51 def _same_account_period(self, cr, uid, admin_date, account_date, context=None):51 def _same_account_period(self, cr, uid, admin_date, account_date, context=None):
5252
=== modified file 'l10n_ve_fiscal_book/workflow/fb_workflow.xml'
--- l10n_ve_fiscal_book/workflow/fb_workflow.xml 2013-05-27 16:36:56 +0000
+++ l10n_ve_fiscal_book/workflow/fb_workflow.xml 2013-06-04 20:15:34 +0000
@@ -39,7 +39,8 @@
39 <field name="wkf_id" ref="fb_wkf"/>39 <field name="wkf_id" ref="fb_wkf"/>
40 <field name="name">cancel</field>40 <field name="name">cancel</field>
41 <field name="kind">function</field>41 <field name="kind">function</field>
42 <field name="action">write({'state':'cancel'})</field>42 <field name="action">clear_book()
43write({'state':'cancel'})</field>
43 </record>44 </record>
4445
45<!--46<!--