Merge lp:~vauxoo/openerp-venezuela-localization/7.0-pylint5-dev-sabrina into lp:openerp-venezuela-localization

Proposed by Sabrina Romero - http://www.vauxoo.com
Status: Merged
Merged at revision: 1045
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/7.0-pylint5-dev-sabrina
Merge into: lp:openerp-venezuela-localization
Diff against target: 10707 lines (+2306/-2410)
120 files modified
l10n_ve_fiscal_book/__init__.py (+3/-3)
l10n_ve_fiscal_book/__openerp__.py (+2/-2)
l10n_ve_fiscal_book/adjustment_book.py (+117/-126)
l10n_ve_fiscal_book/model/__init__.py (+5/-5)
l10n_ve_fiscal_book/model/customs_form.py (+1/-3)
l10n_ve_fiscal_book/model/fiscal_book.py (+237/-240)
l10n_ve_fiscal_book/model/invoice.py (+2/-2)
l10n_ve_fiscal_book/model/wh_iva.py (+7/-7)
l10n_ve_fiscal_book/wizard/__init__.py (+3/-3)
l10n_ve_fiscal_book/wizard/change_invoice_sin_cred.py (+1/-2)
l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py (+11/-14)
l10n_ve_fiscal_requirements/__init__.py (+3/-3)
l10n_ve_fiscal_requirements/__openerp__.py (+3/-3)
l10n_ve_fiscal_requirements/installer.py (+16/-15)
l10n_ve_fiscal_requirements/model/__init__.py (+9/-9)
l10n_ve_fiscal_requirements/model/account.py (+15/-14)
l10n_ve_fiscal_requirements/model/account_tax.py (+8/-8)
l10n_ve_fiscal_requirements/model/invoice.py (+42/-38)
l10n_ve_fiscal_requirements/model/l10n_ut.py (+1/-3)
l10n_ve_fiscal_requirements/model/partner.py (+74/-68)
l10n_ve_fiscal_requirements/model/res_company.py (+2/-5)
l10n_ve_fiscal_requirements/model/res_users.py (+10/-11)
l10n_ve_fiscal_requirements/model/seniat_url.py (+18/-22)
l10n_ve_fiscal_requirements/wizard/__init__.py (+8/-8)
l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py (+33/-38)
l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py (+96/-96)
l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py (+22/-22)
l10n_ve_fiscal_requirements/wizard/update_info_partner.py (+6/-8)
l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py (+32/-36)
l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py (+3/-5)
l10n_ve_fiscal_requirements/wizard/wizard_update_name.py (+6/-5)
l10n_ve_fiscal_requirements/wizard/wizard_url_seniat.py (+24/-28)
l10n_ve_generic/__init__.py (+1/-1)
l10n_ve_imex/__init__.py (+1/-1)
l10n_ve_imex/model/__init__.py (+3/-3)
l10n_ve_imex/model/customs_form.py (+2/-4)
l10n_ve_imex/model/customs_form_config.py (+4/-4)
l10n_ve_imex/model/invoice.py (+26/-26)
l10n_ve_sale_purchase/__init__.py (+2/-2)
l10n_ve_sale_purchase/__openerp__.py (+1/-1)
l10n_ve_sale_purchase/model/__init__.py (+5/-5)
l10n_ve_sale_purchase/model/product.py (+10/-14)
l10n_ve_sale_purchase/model/purchase.py (+15/-17)
l10n_ve_sale_purchase/model/sale.py (+10/-14)
l10n_ve_sale_purchase/model/stock.py (+8/-13)
l10n_ve_split_invoice/__init__.py (+1/-1)
l10n_ve_split_invoice/model/__init__.py (+3/-3)
l10n_ve_split_invoice/model/installer.py (+10/-9)
l10n_ve_split_invoice/model/invoice.py (+15/-16)
l10n_ve_split_invoice/model/res_company.py (+5/-6)
l10n_ve_vat_write_off/__init__.py (+1/-1)
l10n_ve_vat_write_off/__openerp__.py (+1/-1)
l10n_ve_vat_write_off/model/__init__.py (+1/-1)
l10n_ve_vat_write_off/model/l10n_ve_vat_write_off.py (+99/-99)
l10n_ve_withholding/__init__.py (+2/-2)
l10n_ve_withholding/__openerp__.py (+4/-4)
l10n_ve_withholding/model/__init__.py (+3/-3)
l10n_ve_withholding/model/account.py (+47/-44)
l10n_ve_withholding/model/invoice.py (+43/-42)
l10n_ve_withholding_islr/__init__.py (+3/-3)
l10n_ve_withholding_islr/edi/__init__.py (+2/-2)
l10n_ve_withholding_islr/edi/islr_wh_doc.py (+10/-13)
l10n_ve_withholding_islr/model/__init__.py (+9/-9)
l10n_ve_withholding_islr/model/installer.py (+9/-9)
l10n_ve_withholding_islr/model/invoice.py (+12/-10)
l10n_ve_withholding_islr/model/islr_wh_concept.py (+11/-17)
l10n_ve_withholding_islr/model/islr_wh_doc.py (+78/-90)
l10n_ve_withholding_islr/model/islr_xml_wh.py (+78/-80)
l10n_ve_withholding_islr/model/partner.py (+4/-4)
l10n_ve_withholding_islr/model/product.py (+11/-13)
l10n_ve_withholding_islr/model/rates.py (+23/-27)
l10n_ve_withholding_islr/model/res_company.py (+6/-10)
l10n_ve_withholding_islr/report/__init__.py (+2/-2)
l10n_ve_withholding_islr/report/list_wh_islr.py (+2/-2)
l10n_ve_withholding_islr/report/wh_islr.py (+14/-14)
l10n_ve_withholding_islr/wizard/__init__.py (+4/-4)
l10n_ve_withholding_islr/wizard/account_invoice_refund.py (+5/-7)
l10n_ve_withholding_islr/wizard/employee_income_wh.py (+13/-13)
l10n_ve_withholding_islr/wizard/income_wh_change_concept.py (+3/-2)
l10n_ve_withholding_islr/wizard/partner_income_wh_print.py (+9/-9)
l10n_ve_withholding_iva/__init__.py (+4/-4)
l10n_ve_withholding_iva/__openerp__.py (+2/-2)
l10n_ve_withholding_iva/model/__init__.py (+8/-8)
l10n_ve_withholding_iva/model/account.py (+2/-2)
l10n_ve_withholding_iva/model/generate_txt.py (+106/-110)
l10n_ve_withholding_iva/model/installer.py (+37/-37)
l10n_ve_withholding_iva/model/invoice.py (+68/-70)
l10n_ve_withholding_iva/model/partner.py (+2/-1)
l10n_ve_withholding_iva/model/res_company.py (+4/-3)
l10n_ve_withholding_iva/model/wh_iva.py (+158/-147)
l10n_ve_withholding_iva/report/__init__.py (+2/-2)
l10n_ve_withholding_iva/report/list_wh_iva.py (+41/-43)
l10n_ve_withholding_iva/report/withholding_vat.py (+71/-78)
l10n_ve_withholding_iva/wizard/__init__.py (+4/-4)
l10n_ve_withholding_iva/wizard/account_invoice_refund.py (+5/-7)
l10n_ve_withholding_iva/wizard/wizard_retention.py (+6/-8)
l10n_ve_withholding_iva/wizard/wizard_wh_nro.py (+6/-5)
l10n_ve_withholding_muni/__init__.py (+2/-2)
l10n_ve_withholding_muni/model/__init__.py (+4/-4)
l10n_ve_withholding_muni/model/invoice.py (+23/-24)
l10n_ve_withholding_muni/model/partner.py (+1/-0)
l10n_ve_withholding_muni/model/wh_muni.py (+16/-16)
l10n_ve_withholding_muni/report/__init__.py (+2/-2)
l10n_ve_withholding_muni/report/wh_muni_report.py (+10/-12)
l10n_ve_withholding_src/__init__.py (+4/-4)
l10n_ve_withholding_src/__openerp__.py (+5/-5)
l10n_ve_withholding_src/model/__init__.py (+5/-5)
l10n_ve_withholding_src/model/invoice.py (+56/-56)
l10n_ve_withholding_src/model/partner.py (+3/-4)
l10n_ve_withholding_src/model/res_company.py (+3/-5)
l10n_ve_withholding_src/model/wh_src.py (+144/-153)
l10n_ve_withholding_src/report/__init__.py (+2/-2)
l10n_ve_withholding_src/report/wh_src_report.py (+19/-23)
l10n_ve_withholding_src/wizard/__init__.py (+2/-2)
l10n_ve_withholding_src/wizard/wizard_retention.py (+8/-10)
ovl/__init__.py (+1/-1)
ovl/__openerp__.py (+13/-13)
ovl/model/__init__.py (+1/-1)
ovl/model/account.py (+3/-4)
ovl_all/__openerp__.py (+2/-2)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/7.0-pylint5-dev-sabrina
Reviewer Review Type Date Requested Status
hbto [Vauxoo] http://www.vauxoo.com Approve
Jorge Angel Naranjo Rogel - http://www.vauxoo.com Pending
Review via email: mp+237828@code.launchpad.net

Description of the change

Pylint relative import fixed.

To post a comment you must log in.
1045. By Sabrina Romero - http://www.vauxoo.com

[FIX] Pylint unused import fixed.

1046. By Sabrina Romero - http://www.vauxoo.com

[FIX] Pylint unused variable fixed.

1047. By Sabrina Romero - http://www.vauxoo.com

[FIX] Pylint autopep8 fixed.

1048. By Sabrina Romero - http://www.vauxoo.com

[FIX] Pylint trailing whitespace fixed.

1049. By Sabrina Romero - http://www.vauxoo.com

[FIX] Pylint W0104 fixed.

1050. By Sabrina Romero - http://www.vauxoo.com

[FIX] Pylint relative import fixed.

Revision history for this message
Sabrina Romero - http://www.vauxoo.com (sabrina) wrote :

Hbto, requiero su "approve" para subir estos cambios!

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

LGTM

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/__init__.py'
2--- l10n_ve_fiscal_book/__init__.py 2013-04-30 18:17:08 +0000
3+++ l10n_ve_fiscal_book/__init__.py 2014-10-11 00:06:17 +0000
4@@ -4,7 +4,7 @@
5 # Copyright (c) 2010 Vauxoo C.A. (http://openerp.com.ve/) All Rights Reserved.
6 # Javier Duran <javier@vauxoo.com>
7 # Nhomar Hernandéz <nhomar@vauxoo.com>
8-#
9+#
10 #
11 # WARNING: This program as such is intended to be used by professional
12 # programmers who take the whole responsability of assessing all potential
13@@ -29,5 +29,5 @@
14 #
15 ##############################################################################
16
17-import model
18-import wizard
19+from . import model
20+from . import wizard
21
22=== modified file 'l10n_ve_fiscal_book/__openerp__.py'
23--- l10n_ve_fiscal_book/__openerp__.py 2014-09-19 15:18:43 +0000
24+++ l10n_ve_fiscal_book/__openerp__.py 2014-10-11 00:06:17 +0000
25@@ -4,7 +4,7 @@
26 # Copyright (c) 2011 Vauxoo C.A. (http://openerp.com.ve/) All Rights Reserved.
27 # Luis Escobar <luis@vauxoo.com>
28 # Tulio Ruiz <tulio@vauxoo.com>
29-#
30+#
31 #
32 # WARNING: This program as such is intended to be used by professional
33 # programmers who take the whole responsability of assessing all potential
34@@ -40,7 +40,7 @@
35 Build all Fiscal Reports for Law in Venezuela.
36 Add 2 new columns because of:
37
38-Según Articulo 77 del Reglamento de la Ley del IVA No.5.363 del 12 de Julio de 1999.
39+Según Articulo 77 del Reglamento de la Ley del IVA No.5.363 del 12 de Julio de 1999.
40 Parágrafo Segundo: El registro de las operaciones contenidas en el reporte global diario generado por las máquinas fiscales, se reflejarán en el Libro de Ventas del mismo modo que se establece respecto de los comprobantes que se emiten a no contibuyentes, indicando el número de registro de la máquina.
41
42 .. note::
43
44=== modified file 'l10n_ve_fiscal_book/adjustment_book.py'
45--- l10n_ve_fiscal_book/adjustment_book.py 2014-01-08 20:42:28 +0000
46+++ l10n_ve_fiscal_book/adjustment_book.py 2014-10-11 00:06:17 +0000
47@@ -7,7 +7,7 @@
48 ###############Credits######################################################
49 # Coded by: Humberto Arocha <humberto@openerp.com.ve>
50 # María Gabriela Quilarque <gabrielaquilarque97@gmail.com>
51-# Javier Duran <javier@vauxoo.com>
52+# Javier Duran <javier@vauxoo.com>
53 # Planified by: Nhomar Hernandez
54 # Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
55 # Audited by: Humberto Arocha humberto@openerp.com.ve
56@@ -25,29 +25,25 @@
57 # You should have received a copy of the GNU Affero General Public License
58 # along with this program. If not, see <http://www.gnu.org/licenses/>.
59 ##############################################################################
60-from openerp.osv import osv
61-from openerp.osv import fields
62-from openerp.tools.translate import _
63-from openerp.tools import config
64-import time
65-import datetime
66+from openerp.osv import osv, fields
67 from openerp.addons import decimal_precision as dp
68
69+
70 class adjustment_book(osv.osv):
71
72- def _get_amount_total(self,cr,uid,ids,name,args,context=None):
73+ def _get_amount_total(self, cr, uid, ids, name, args, context=None):
74 res = {}
75- for adj in self.browse(cr,uid,ids,context):
76+ for adj in self.browse(cr, uid, ids, context):
77 res[adj.id] = {
78 'amount_total': 0.0,
79- 'amount_untaxed_n_total' : 0.0,
80+ 'amount_untaxed_n_total': 0.0,
81 'amount_with_vat_n_total': 0.0,
82- 'amount_untaxed_i_total' : 0.0,
83+ 'amount_untaxed_i_total': 0.0,
84 'amount_with_vat_i_total': 0.0,
85- 'uncredit_fiscal_total' : 0.0,
86- 'amount_with_vat_total' : 0.0,
87- 'amount_base_total' : 0.0,
88- 'amount_percent_total' : 0.0,
89+ 'uncredit_fiscal_total': 0.0,
90+ 'amount_with_vat_total': 0.0,
91+ 'amount_base_total': 0.0,
92+ 'amount_percent_total': 0.0,
93 }
94 for line in adj.adjustment_ids:
95 res[adj.id]['amount_total'] += line.amount
96@@ -57,134 +53,129 @@
97 res[adj.id]['amount_with_vat_i_total'] += line.amount_with_vat_i
98 res[adj.id]['uncredit_fiscal_total'] += line.uncredit_fiscal
99 res[adj.id]['amount_with_vat_total'] += line.amount_with_vat
100- res[adj.id]['amount_base_total'] += adj.vat_general_i+adj.vat_general_add_i+adj.vat_reduced_i+adj.vat_general_n+\
101- adj.vat_general_add_n+adj.vat_reduced_n+adj.adjustment+adj.no_grav+adj.sale_export
102- res[adj.id]['amount_percent_total'] += adj.vat_general_icf+adj.vat_general_add_icf+adj.vat_reduced_icf+adj.vat_general_ncf+\
103- adj.vat_general_add_ncf+adj.vat_reduced_ncf+adj.adjustment_cf+adj.sale_export_cf
104-
105+ res[adj.id]['amount_base_total'] += adj.vat_general_i + adj.vat_general_add_i + adj.vat_reduced_i + adj.vat_general_n +\
106+ adj.vat_general_add_n + adj.vat_reduced_n + adj.adjustment + adj.no_grav + adj.sale_export
107+ res[adj.id]['amount_percent_total'] += adj.vat_general_icf + adj.vat_general_add_icf + adj.vat_reduced_icf + adj.vat_general_ncf +\
108+ adj.vat_general_add_ncf + adj.vat_reduced_ncf + adj.adjustment_cf + adj.sale_export_cf
109+
110 return res
111
112- _name='adjustment.book'
113- _columns={
114- 'name':fields.char('Description', size=256,required=True,help="Description of adjustment book"),
115- 'period_id':fields.many2one('account.period','Period',required=True,help="Period of adjustment book"),
116- 'adjustment_ids': fields.one2many('adjustment.book.line','adjustment_id','Adjustment Book Line'),
117- 'note': fields.text('Note',required=True),
118+ _name = 'adjustment.book'
119+ _columns = {
120+ 'name': fields.char('Description', size=256, required=True, help="Description of adjustment book"),
121+ 'period_id': fields.many2one('account.period', 'Period', required=True, help="Period of adjustment book"),
122+ 'adjustment_ids': fields.one2many('adjustment.book.line', 'adjustment_id', 'Adjustment Book Line'),
123+ 'note': fields.text('Note', required=True),
124 'type': fields.selection([
125- ('sale','Sale'),
126+ ('sale', 'Sale'),
127 ('purchase', 'Purchase'),
128- ],'Type', select=True, required=True, help="Type of adjustment book: Sale or Purchase"),
129- 'amount_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='VAT Withholding Total Amount',readonly=True,help="Total Amount for adjustment book of invoice"),
130- 'amount_untaxed_n_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='Amount Untaxed National',readonly=True,help="Amount Total Untaxed for adjustment book of nacional operations"),
131- 'amount_with_vat_n_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='Amount Withheld National',readonly=True,help="Amount Total Withheld for adjustment book of national operations"),
132- 'amount_untaxed_i_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='Amount Untaxed International',readonly=True,help="Amount Total Untaxed for adjustment book of internacional operations"),
133- 'amount_with_vat_i_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='Amount Withheld International',readonly=True,help="Amount Total Withheld for adjustment book of international operations"),
134- 'uncredit_fiscal_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='Sin derecho a credito fiscal',readonly=True,help="Sin derecho a credito fiscal"),
135- 'amount_with_vat_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='VAT Withholding Total Amount',readonly=True,help="VAT Withholding total amount for adjustment book"),
136- 'no_grav': fields.float('Compras/Ventas no Gravadas y/o SDCF', digits_compute=dp.get_precision('Account'),help="Compras/Ventas no gravadas y/o sin derecho a credito fiscal/ Ventas Internas no grabadas"),
137- 'vat_general_i': fields.float('Alicuota general', digits_compute=dp.get_precision('Account'), help="Importaciones gravadas por alicuota general"),
138- 'vat_general_add_i': fields.float('Alicuota general + Alicuota adicional', digits_compute=dp.get_precision('Account'),help="Importaciones gravadas por alicuota general mas alicuota adicional"),
139- 'vat_reduced_i': fields.float('Alicuota Reducida', digits_compute=dp.get_precision('Account'),help="Importaciones gravadas por alicuota reducida"),
140- 'vat_general_n': fields.float('Alicuota general', digits_compute=dp.get_precision('Account'),help="Compras gravadas por alicuota general/Ventas internas gravadas por alicuota general"),
141- 'vat_general_add_n': fields.float('Alicuota general + Alicuota adicional', digits_compute=dp.get_precision('Account'),help="Compras/Ventas internas gravadas por alicuota general mas alicuota adicional"),
142- 'vat_reduced_n': fields.float('Alicuota Reducida', digits_compute=dp.get_precision('Account'),help="Compras/Ventas Internas gravadas por alicuota reducida"),
143- 'adjustment': fields.float('Ajustes', digits_compute=dp.get_precision('Account'),help="Ajustes a los creditos/debitos fiscales de los periodos anteriores"),
144- 'vat_general_icf': fields.float('Alicuota general', digits_compute=dp.get_precision('Account'), help="Importaciones gravadas por alicuota general"),
145- 'vat_general_add_icf': fields.float('Alicuota general + Alicuota adicional', digits_compute=dp.get_precision('Account'),help="Importaciones gravadas por alicuota general mas alicuota adicional"),
146- 'vat_reduced_icf': fields.float('Alicuota Reducida', digits_compute=dp.get_precision('Account'),help="Importaciones gravadas por alicuota reducida"),
147- 'vat_general_ncf': fields.float('Alicuota general', digits_compute=dp.get_precision('Account'),help="Compras gravadas por alicuota general/Ventas internas gravadas por alicuota general"),
148- 'vat_general_add_ncf': fields.float('Alicuota general + Alicuota adicional', digits_compute=dp.get_precision('Account'),help="Compras/Ventas internas gravadas por alicuota general mas alicuota adicional"),
149- 'vat_reduced_ncf': fields.float('Alicuota Reducida', digits_compute=dp.get_precision('Account'),help="Compras/Ventas Internas gravadas por alicuota reducida"),
150- 'adjustment_cf': fields.float('Ajustes', digits_compute=dp.get_precision('Account'),help="Ajustes a los creditos/debitos fiscales de los periodos anteriores"),
151- 'amount_base_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='Total Base Imponible',readonly=True,help="TOTAL COMPRAS DEL PERIODO/TOTAL VENTAS PARA EFECTOS DE DETERMINACION"),
152- 'amount_percent_total':fields.function(_get_amount_total,multi='all',method=True, digits_compute=dp.get_precision('Account'),string='Total % Fiscal',readonly=True,help="TOTALCREDITOS FISCALES DEL PERIODO/TOTAL DEBITOS FISCALES PARA EFECTOS DE DETERMINACION"),
153- 'sale_export':fields.float('Ventas de Exportacion', digits_compute=dp.get_precision('Account'),help="Ventas de Exportacion"),
154- 'sale_export_cf':fields.float('Ventas de Exportacion', digits_compute=dp.get_precision('Account'),help="Ventas de Exportacion"),
155+ ], 'Type', select=True, required=True, help="Type of adjustment book: Sale or Purchase"),
156+ 'amount_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='VAT Withholding Total Amount', readonly=True, help="Total Amount for adjustment book of invoice"),
157+ 'amount_untaxed_n_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='Amount Untaxed National', readonly=True, help="Amount Total Untaxed for adjustment book of nacional operations"),
158+ 'amount_with_vat_n_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='Amount Withheld National', readonly=True, help="Amount Total Withheld for adjustment book of national operations"),
159+ 'amount_untaxed_i_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='Amount Untaxed International', readonly=True, help="Amount Total Untaxed for adjustment book of internacional operations"),
160+ 'amount_with_vat_i_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='Amount Withheld International', readonly=True, help="Amount Total Withheld for adjustment book of international operations"),
161+ 'uncredit_fiscal_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='Sin derecho a credito fiscal', readonly=True, help="Sin derecho a credito fiscal"),
162+ 'amount_with_vat_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='VAT Withholding Total Amount', readonly=True, help="VAT Withholding total amount for adjustment book"),
163+ 'no_grav': fields.float('Compras/Ventas no Gravadas y/o SDCF', digits_compute=dp.get_precision('Account'), help="Compras/Ventas no gravadas y/o sin derecho a credito fiscal/ Ventas Internas no grabadas"),
164+ 'vat_general_i': fields.float('Alicuota general', digits_compute=dp.get_precision('Account'), help="Importaciones gravadas por alicuota general"),
165+ 'vat_general_add_i': fields.float('Alicuota general + Alicuota adicional', digits_compute=dp.get_precision('Account'), help="Importaciones gravadas por alicuota general mas alicuota adicional"),
166+ 'vat_reduced_i': fields.float('Alicuota Reducida', digits_compute=dp.get_precision('Account'), help="Importaciones gravadas por alicuota reducida"),
167+ 'vat_general_n': fields.float('Alicuota general', digits_compute=dp.get_precision('Account'), help="Compras gravadas por alicuota general/Ventas internas gravadas por alicuota general"),
168+ 'vat_general_add_n': fields.float('Alicuota general + Alicuota adicional', digits_compute=dp.get_precision('Account'), help="Compras/Ventas internas gravadas por alicuota general mas alicuota adicional"),
169+ 'vat_reduced_n': fields.float('Alicuota Reducida', digits_compute=dp.get_precision('Account'), help="Compras/Ventas Internas gravadas por alicuota reducida"),
170+ 'adjustment': fields.float('Ajustes', digits_compute=dp.get_precision('Account'), help="Ajustes a los creditos/debitos fiscales de los periodos anteriores"),
171+ 'vat_general_icf': fields.float('Alicuota general', digits_compute=dp.get_precision('Account'), help="Importaciones gravadas por alicuota general"),
172+ 'vat_general_add_icf': fields.float('Alicuota general + Alicuota adicional', digits_compute=dp.get_precision('Account'), help="Importaciones gravadas por alicuota general mas alicuota adicional"),
173+ 'vat_reduced_icf': fields.float('Alicuota Reducida', digits_compute=dp.get_precision('Account'), help="Importaciones gravadas por alicuota reducida"),
174+ 'vat_general_ncf': fields.float('Alicuota general', digits_compute=dp.get_precision('Account'), help="Compras gravadas por alicuota general/Ventas internas gravadas por alicuota general"),
175+ 'vat_general_add_ncf': fields.float('Alicuota general + Alicuota adicional', digits_compute=dp.get_precision('Account'), help="Compras/Ventas internas gravadas por alicuota general mas alicuota adicional"),
176+ 'vat_reduced_ncf': fields.float('Alicuota Reducida', digits_compute=dp.get_precision('Account'), help="Compras/Ventas Internas gravadas por alicuota reducida"),
177+ 'adjustment_cf': fields.float('Ajustes', digits_compute=dp.get_precision('Account'), help="Ajustes a los creditos/debitos fiscales de los periodos anteriores"),
178+ 'amount_base_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='Total Base Imponible', readonly=True, help="TOTAL COMPRAS DEL PERIODO/TOTAL VENTAS PARA EFECTOS DE DETERMINACION"),
179+ 'amount_percent_total': fields.function(_get_amount_total, multi='all', method=True, digits_compute=dp.get_precision('Account'), string='Total % Fiscal', readonly=True, help="TOTALCREDITOS FISCALES DEL PERIODO/TOTAL DEBITOS FISCALES PARA EFECTOS DE DETERMINACION"),
180+ 'sale_export': fields.float('Ventas de Exportacion', digits_compute=dp.get_precision('Account'), help="Ventas de Exportacion"),
181+ 'sale_export_cf': fields.float('Ventas de Exportacion', digits_compute=dp.get_precision('Account'), help="Ventas de Exportacion"),
182 }
183
184 _sql_constraints = [
185 ('period_id_type_uniq', 'unique (period_id,type)', 'The period and type combination must be unique!')
186 ]
187-
188-
189+
190 #~ def action_set_totals(self,cr,uid,ids, *args):
191- #~ self.write(cr, uid, ids, {'vat_general_i':0.00,
192- #~ 'vat_general_add_i':0.00,'vat_reduced_i':0.00,
193- #~ 'vat_general_n':0.00,'vat_general_add_n':0.00,
194- #~ 'vat_reduced_n':0.00,'sale_export':0.00,
195- #~ })
196- #~ total={'amount_untaxed_n':0.0,'amount_untaxed_n_scdf':0.0,
197- #~ 'amount_untaxed_i':0.0,'amount_untaxed_i_scdf':0.0,
198- #~ 'vat_general_ncf':0.0,'vat_general_ncf':0.0,
199- #~ 'vat_add_ncf':0.0}
200-#~
201- #~ for adj in self.browse(cr, uid, ids):
202- #~ if adj.type=='purchase':
203- #~ self.write(cr, uid, ids, {'vat_general_i':adj.amount_untaxed_i_total,
204- #~ 'vat_general_add_i':adj.amount_untaxed_i_total,
205- #~ 'vat_reduced_i':adj.amount_untaxed_i_total,})
206- #~ else:
207- #~ self.write(cr, uid, ids, {'sale_export':adj.amount_untaxed_n_total,})
208- #~ self.write(cr, uid, ids, {'vat_general_n':adj.amount_untaxed_n_total,
209- #~ 'vat_general_add_n':adj.amount_untaxed_n_total,
210- #~ 'vat_reduced_n':adj.amount_untaxed_n_total,
211- #~ })
212- #~ for line in adj.adjustment_ids:
213- #~
214- #~ if 0==line.percent_with_vat_n:
215- #~ total['amount_untaxed_n_scdf']+=line.amount_untaxed_n
216- #~ total['amount_untaxed_i_scdf']+=line.amount_untaxed_i
217- #~ else:
218- #~ total['amount_untaxed_n']+=line.amount_untaxed_n
219- #~ total['amount_untaxed_i']+=line.amount_untaxed_i
220- #~ if 12 == line.percent_with_vat_n:
221- #~ total['vat_general_ncf']+=12.0
222- #~ if 8 == line.percent_with_vat_n:
223- #~ total['vat_reduced_ncf']+=8.0
224- #~ if 22 == line.percent_with_vat_n:
225- #~ total['vat_additional_ncf']+=22.0
226- #~ self.write(cr, uid, ids, {'vat_general_ncf':total['vat_general_ncf'],
227- #~ 'vat_general_add_ncf':total['vat_general_ncf']+total['vat_add_ncf'],
228- #~ 'vat_reduced_n':total['vat_reduced_n'],
229- #~ })
230- #~ return True
231-
232-
233-
234+ #~ self.write(cr, uid, ids, {'vat_general_i':0.00,
235+ #~ 'vat_general_add_i':0.00,'vat_reduced_i':0.00,
236+ #~ 'vat_general_n':0.00,'vat_general_add_n':0.00,
237+ #~ 'vat_reduced_n':0.00,'sale_export':0.00,
238+ #~ })
239+ #~ total={'amount_untaxed_n':0.0,'amount_untaxed_n_scdf':0.0,
240+ #~ 'amount_untaxed_i':0.0,'amount_untaxed_i_scdf':0.0,
241+ #~ 'vat_general_ncf':0.0,'vat_general_ncf':0.0,
242+ #~ 'vat_add_ncf':0.0}
243+#~
244+ #~ for adj in self.browse(cr, uid, ids):
245+ #~ if adj.type=='purchase':
246+ #~ self.write(cr, uid, ids, {'vat_general_i':adj.amount_untaxed_i_total,
247+ #~ 'vat_general_add_i':adj.amount_untaxed_i_total,
248+ #~ 'vat_reduced_i':adj.amount_untaxed_i_total,})
249+ #~ else:
250+ #~ self.write(cr, uid, ids, {'sale_export':adj.amount_untaxed_n_total,})
251+ #~ self.write(cr, uid, ids, {'vat_general_n':adj.amount_untaxed_n_total,
252+ #~ 'vat_general_add_n':adj.amount_untaxed_n_total,
253+ #~ 'vat_reduced_n':adj.amount_untaxed_n_total,
254+ #~ })
255+ #~ for line in adj.adjustment_ids:
256+ #~
257+ #~ if 0==line.percent_with_vat_n:
258+ #~ total['amount_untaxed_n_scdf']+=line.amount_untaxed_n
259+ #~ total['amount_untaxed_i_scdf']+=line.amount_untaxed_i
260+ #~ else:
261+ #~ total['amount_untaxed_n']+=line.amount_untaxed_n
262+ #~ total['amount_untaxed_i']+=line.amount_untaxed_i
263+ #~ if 12 == line.percent_with_vat_n:
264+ #~ total['vat_general_ncf']+=12.0
265+ #~ if 8 == line.percent_with_vat_n:
266+ #~ total['vat_reduced_ncf']+=8.0
267+ #~ if 22 == line.percent_with_vat_n:
268+ #~ total['vat_additional_ncf']+=22.0
269+ #~ self.write(cr, uid, ids, {'vat_general_ncf':total['vat_general_ncf'],
270+ #~ 'vat_general_add_ncf':total['vat_general_ncf']+total['vat_add_ncf'],
271+ #~ 'vat_reduced_n':total['vat_reduced_n'],
272+ #~ })
273+ #~ return True
274+
275+
276 adjustment_book()
277
278
279 class adjustment_book_line(osv.osv):
280-
281- _name='adjustment.book.line'
282- _columns={
283- 'date_accounting': fields.date('Date Accounting', required=True,help="Date accounting for adjustment book"),
284- 'date_admin': fields.date('Date Administrative',required=True, help="Date administrative for adjustment book"),
285- 'vat':fields.char('Vat', size=10,required=True,help="Vat of partner for adjustment book"),
286- 'partner':fields.char('Partner', size=256,required=True,help="Partner for adjustment book"),
287- 'invoice_number':fields.char('Invoice Number', size=256,required=True,help="Invoice number for adjustment book"),
288- 'control_number':fields.char('Invoice Control', size=256,required=True,help="Invoice control for adjustment book"),
289- 'amount':fields.float('Amount Document at VAT Withholding', digits_compute=dp.get_precision('Account'),required=True,help="Amount document for adjustment book"),
290+
291+ _name = 'adjustment.book.line'
292+ _columns = {
293+ 'date_accounting': fields.date('Date Accounting', required=True, help="Date accounting for adjustment book"),
294+ 'date_admin': fields.date('Date Administrative', required=True, help="Date administrative for adjustment book"),
295+ 'vat': fields.char('Vat', size=10, required=True, help="Vat of partner for adjustment book"),
296+ 'partner': fields.char('Partner', size=256, required=True, help="Partner for adjustment book"),
297+ 'invoice_number': fields.char('Invoice Number', size=256, required=True, help="Invoice number for adjustment book"),
298+ 'control_number': fields.char('Invoice Control', size=256, required=True, help="Invoice control for adjustment book"),
299+ 'amount': fields.float('Amount Document at VAT Withholding', digits_compute=dp.get_precision('Account'), required=True, help="Amount document for adjustment book"),
300 'type_doc': fields.selection([
301- ('F','Invoice'),
302+ ('F', 'Invoice'),
303 ('ND', 'Debit Note'),
304 ('NC', 'Credit Note'),
305- ],'Document Type', select=True, required=True, help="Type of Document for adjustment book: -Invoice(F),-Debit Note(dn),-Credit Note(cn)"),
306- 'doc_affected':fields.char('Affected Document', size=256,required=True,help="Affected Document for adjustment book"),
307- 'uncredit_fiscal':fields.float('Sin derecho a Credito Fiscal', digits_compute=dp.get_precision('Account'),required=True,help="Sin derechoa credito fiscal"),
308- 'amount_untaxed_n': fields.float('Amount Untaxed', digits_compute=dp.get_precision('Account'),required=True,help="Amount untaxed for national operations"),
309- 'percent_with_vat_n': fields.float('VAT Withholding (%)', digits_compute=dp.get_precision('Account'),required=True,help="VAT Percent(%) for national operations"),
310- 'amount_with_vat_n': fields.float('VAT Withholding Amount', digits_compute=dp.get_precision('Account'),required=True,help="VAT Amount for national operations"),
311- 'amount_untaxed_i': fields.float('Amount Untaxed', digits_compute=dp.get_precision('Account'),required=True,help="Amount untaxed for international operations"),
312- 'percent_with_vat_i': fields.float('VAT Withholding (%)', digits_compute=dp.get_precision('Account'),required=True,help="VAT Percent(%) for international operations"),
313- 'amount_with_vat_i': fields.float('VAT Withholding Amount', digits_compute=dp.get_precision('Account'),required=True,help="VAT Amount for international operations"),
314- 'amount_with_vat': fields.float('VAT Withholding Total Amount', digits_compute=dp.get_precision('Account'),required=True,help="VAT withholding total amount"),
315- 'voucher': fields.char('VAT Withholding Voucher', size=256,required=True,help="VAT withholding voucher"),
316- 'adjustment_id':fields.many2one('adjustment.book','Adjustment Book')
317+ ], 'Document Type', select=True, required=True, help="Type of Document for adjustment book: -Invoice(F),-Debit Note(dn),-Credit Note(cn)"),
318+ 'doc_affected': fields.char('Affected Document', size=256, required=True, help="Affected Document for adjustment book"),
319+ 'uncredit_fiscal': fields.float('Sin derecho a Credito Fiscal', digits_compute=dp.get_precision('Account'), required=True, help="Sin derechoa credito fiscal"),
320+ 'amount_untaxed_n': fields.float('Amount Untaxed', digits_compute=dp.get_precision('Account'), required=True, help="Amount untaxed for national operations"),
321+ 'percent_with_vat_n': fields.float('VAT Withholding (%)', digits_compute=dp.get_precision('Account'), required=True, help="VAT Percent(%) for national operations"),
322+ 'amount_with_vat_n': fields.float('VAT Withholding Amount', digits_compute=dp.get_precision('Account'), required=True, help="VAT Amount for national operations"),
323+ 'amount_untaxed_i': fields.float('Amount Untaxed', digits_compute=dp.get_precision('Account'), required=True, help="Amount untaxed for international operations"),
324+ 'percent_with_vat_i': fields.float('VAT Withholding (%)', digits_compute=dp.get_precision('Account'), required=True, help="VAT Percent(%) for international operations"),
325+ 'amount_with_vat_i': fields.float('VAT Withholding Amount', digits_compute=dp.get_precision('Account'), required=True, help="VAT Amount for international operations"),
326+ 'amount_with_vat': fields.float('VAT Withholding Total Amount', digits_compute=dp.get_precision('Account'), required=True, help="VAT withholding total amount"),
327+ 'voucher': fields.char('VAT Withholding Voucher', size=256, required=True, help="VAT withholding voucher"),
328+ 'adjustment_id': fields.many2one('adjustment.book', 'Adjustment Book')
329 }
330 _rec_rame = 'partner'
331-
332+
333 adjustment_book_line()
334-
335-
336-
337
338=== modified file 'l10n_ve_fiscal_book/model/__init__.py'
339--- l10n_ve_fiscal_book/model/__init__.py 2013-06-10 19:36:18 +0000
340+++ l10n_ve_fiscal_book/model/__init__.py 2014-10-11 00:06:17 +0000
341@@ -4,7 +4,7 @@
342 # Copyright (c) 2010 Vauxoo C.A. (http://openerp.com.ve/) All Rights Reserved.
343 # Javier Duran <javier@vauxoo.com>
344 # Nhomar Hernandéz <nhomar@vauxoo.com>
345-#
346+#
347 #
348 # WARNING: This program as such is intended to be used by professional
349 # programmers who take the whole responsability of assessing all potential
350@@ -29,8 +29,8 @@
351 #
352 ##############################################################################
353
354-import invoice
355-import fiscal_book
356-import wh_iva
357-import customs_form
358+from . import invoice
359+from . import fiscal_book
360+from . import wh_iva
361+from . import customs_form
362
363
364=== modified file 'l10n_ve_fiscal_book/model/customs_form.py'
365--- l10n_ve_fiscal_book/model/customs_form.py 2013-06-10 19:36:18 +0000
366+++ l10n_ve_fiscal_book/model/customs_form.py 2014-10-11 00:06:17 +0000
367@@ -24,14 +24,12 @@
368 # along with this program. If not, see <http://www.gnu.org/licenses/>.
369 ###############################################################################
370 from openerp.osv import fields, osv
371-import openerp.pooler
372
373
374 class customs_form(osv.osv):
375 _inherit = 'customs.form'
376 _columns = {
377 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
378- help='Fiscal Book where this customs form' \
379+ help='Fiscal Book where this customs form'
380 ' is srelated to'),
381 }
382-
383
384=== modified file 'l10n_ve_fiscal_book/model/fiscal_book.py'
385--- l10n_ve_fiscal_book/model/fiscal_book.py 2014-10-07 06:41:36 +0000
386+++ l10n_ve_fiscal_book/model/fiscal_book.py 2014-10-11 00:06:17 +0000
387@@ -67,7 +67,7 @@
388 #~ TODO: ASK: what company, fisal.book.company_id?
389 ru_obj = self.pool.get('res.users')
390 rc_brw = ru_obj.browse(cr, uid, uid, context=context).company_id
391- addr = rp_obj._find_accounting_partner(rc_brw.partner_id)
392+ addr = rp_obj._find_accounting_partner(rc_brw.partner_id)
393 for fb_id in ids:
394 if addr:
395 res[fb_id] = (addr.street or '') + \
396@@ -88,8 +88,8 @@
397 "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]
398 res = {}.fromkeys(ids, '')
399 for fb_brw in self.browse(cr, uid, ids, context=context):
400- month = months[time.strptime(fb_brw.period_id.date_start,"%Y-%m-%d")[1]-1]
401- year = time.strptime(fb_brw.period_id.date_start,"%Y-%m-%d")[0]
402+ month = months[time.strptime(fb_brw.period_id.date_start, "%Y-%m-%d")[1] - 1]
403+ year = time.strptime(fb_brw.period_id.date_start, "%Y-%m-%d")[0]
404 res[fb_brw.id] = "Correspodiente al Mes de " + str(month) + " del año " + str(year)
405 return res
406
407@@ -115,8 +115,8 @@
408 fbl_brw.total_with_iva
409
410 res[fb_brw.id]['get_total_with_iva_sum'] = \
411- sum( [ res[fb_brw.id]["get_total_with_iva_" + optype + "_sum"]
412- for optype in op_types ] )
413+ sum([res[fb_brw.id]["get_total_with_iva_" + optype + "_sum"]
414+ for optype in op_types])
415 return res
416
417 def _get_vat_sdcf_sum(self, cr, uid, ids, field_name, arg, context=None):
418@@ -147,14 +147,14 @@
419 tax_types = ['reduced', 'general', 'additional']
420
421 res[fb_brw.id]['get_total_tax_credit_debit_base_sum'] += \
422- sum( [ getattr(fb_brw, op + '_' + ttax + '_vat_base_sum')
423- for ttax in tax_types
424- for op in op_types ] )
425+ sum([getattr(fb_brw, op + '_' + ttax + '_vat_base_sum')
426+ for ttax in tax_types
427+ for op in op_types])
428
429 res[fb_brw.id]['get_total_tax_credit_debit_tax_sum'] += \
430- sum( [ getattr(fb_brw, op + '_' + ttax + '_vat_tax_sum')
431- for ttax in tax_types
432- for op in op_types ] )
433+ sum([getattr(fb_brw, op + '_' + ttax + '_vat_tax_sum')
434+ for ttax in tax_types
435+ for op in op_types])
436 return res
437
438 def _get_wh(self, cr, uid, ids, field_names, arg, context=None):
439@@ -220,7 +220,7 @@
440 string='Status', required=True, readonly=True),
441 'type': fields.selection([('sale', 'Sale Book'),
442 ('purchase', 'Purchase Book')],
443- help="Select Sale for Customers and" \
444+ help="Select Sale for Customers and"
445 " Purchase for Suppliers",
446 string='Book Type', required=True),
447 'base_amount': fields.float('Taxable Amount',
448@@ -234,47 +234,47 @@
449 'fbts_ids': fields.one2many('fiscal.book.taxes.summary', 'fb_id',
450 'Tax Summary'),
451 'invoice_ids': fields.one2many('account.invoice', 'fb_id', 'Invoices',
452- help="Invoices being recorded in a" \
453+ help="Invoices being recorded in a"
454 " Fiscal Book"),
455 'issue_invoice_ids': fields.one2many('account.invoice', 'issue_fb_id',
456 'Issue Invoices',
457- help="Invoices that are in" \
458+ help="Invoices that are in"
459 " pending state cancel or draft"),
460 'iwdl_ids': fields.one2many('account.wh.iva.line', 'fb_id',
461 'Vat Withholdings',
462- help="Vat Withholdings being recorded" \
463+ help="Vat Withholdings being recorded"
464 " in a Fiscal Book"),
465 'cf_ids': fields.one2many('customs.form', 'fb_id', 'Customs Form',
466- help="Customs Form being recorded in the" \
467+ help="Customs Form being recorded in the"
468 " Fiscal Book"),
469 'abl_ids': fields.one2many('adjustment.book.line', 'fb_id',
470 'Adjustment Lines',
471- help="Adjustment Lines being recorded in " \
472+ help="Adjustment Lines being recorded in "
473 " a Fiscal Book"),
474 'note': fields.text('Note'),
475 'article_number': fields.selection(
476 _get_article_number_types,
477- string = "Article Number",
478+ string="Article Number",
479 required=True,
480- help="Article number describing the fiscal book special features" \
481- " according to the Venezuelan RLIVA statement for fiscal" \
482- " accounting books. Options:" \
483- " - Art. 75: Pruchase Book." \
484- " - Art. 76: Sale Book. Reflects every individual operation detail." \
485- " - Art. 77: Sale Book. Groups Non-Tax Payer operations in one " \
486- " consolidated line. Only fiscal billing." \
487- " - Art. 78: Sale Book. Hybrid for 76 and 77 article. Show" \
488- " automatic and mechanized operations in individual way, and " \
489- " groups fiscal billing operationss in one consolidated line." ),
490+ help="Article number describing the fiscal book special features"
491+ " according to the Venezuelan RLIVA statement for fiscal"
492+ " accounting books. Options:"
493+ " - Art. 75: Pruchase Book."
494+ " - Art. 76: Sale Book. Reflects every individual operation detail."
495+ " - Art. 77: Sale Book. Groups Non-Tax Payer operations in one "
496+ " consolidated line. Only fiscal billing."
497+ " - Art. 78: Sale Book. Hybrid for 76 and 77 article. Show"
498+ " automatic and mechanized operations in individual way, and "
499+ " groups fiscal billing operationss in one consolidated line."),
500
501 #~ Withholding fields
502 'get_wh_sum': fields.function(
503 _get_wh,
504 type="float", method=True, store=True, multi="get_wh",
505 string="Current Period Withholding",
506- help="Used at" \
507- " 1. Totalization row in Fiscal Book Line block at Withholding" \
508- " VAT Column" \
509+ help="Used at"
510+ " 1. Totalization row in Fiscal Book Line block at Withholding"
511+ " VAT Column"
512 " 2. Second row at the Withholding Summary block"),
513 'get_previous_wh_sum': fields.function(
514 _get_wh,
515@@ -290,7 +290,7 @@
516 _get_wh,
517 type="float", method=True, store=True, multi="get_wh",
518 string="Based Tax Debit Sum",
519- help="Totalization row in Fiscal Book Line block at" \
520+ help="Totalization row in Fiscal Book Line block at"
521 " Based Tax Debit Column"),
522
523 #~ Printable report data
524@@ -309,21 +309,21 @@
525 type="float", method=True, store=True,
526 multi="get_total_with_iva",
527 string='Total amount with VAT',
528- help="Total with VAT Sum (Import/Export, Domestic, Tax Payer and" \
529+ help="Total with VAT Sum (Import/Export, Domestic, Tax Payer and"
530 " Non-Tax Payer"),
531 'get_vat_sdcf_sum': fields.function(
532 _get_vat_sdcf_sum,
533 type="float", method=True, store=True,
534 string="Exempt and SDCF Tax Sum",
535- help="Exempt and Non entitled to tax credit totalization. Sum of" \
536- " SDCF and Exempt Tax Totalization columns for all transaction" \
537+ help="Exempt and Non entitled to tax credit totalization. Sum of"
538+ " SDCF and Exempt Tax Totalization columns for all transaction"
539 " types"),
540 'get_total_tax_credit_debit_base_sum': fields.function(
541 _get_total_tax_credit_debit,
542 type="float", method=True, store=True,
543 multi="get_total_tax_credit_debit",
544 string="Tax Credit Total Base Amount",
545- help="Uses at 1. purchase: total row at summary taxes." \
546+ help="Uses at 1. purchase: total row at summary taxes."
547 " 2. sales: row at summary taxes."),
548 'get_total_tax_credit_debit_tax_sum': fields.function(
549 _get_total_tax_credit_debit,
550@@ -333,8 +333,8 @@
551 'do_sdcf_and_exempt_sum': fields.float(
552 digits_compute=dp.get_precision('Account'),
553 string="Domestic Untaxed VAT Sum",
554- help="SDCF and Exempt sum for domestict transanctions." \
555- " At Sale book represent the sum of Tax Payer and Non-Tax Payer" \
556+ help="SDCF and Exempt sum for domestict transanctions."
557+ " At Sale book represent the sum of Tax Payer and Non-Tax Payer"
558 " transactions."),
559
560 #~ Totalization fields for international transactions
561@@ -347,48 +347,48 @@
562 'imex_vat_base_sum': fields.float(
563 digits_compute=dp.get_precision('Account'),
564 string="International Taxable Amount",
565- help="Sum of International Tax Base Amounts (reduced, general" \
566- " and additional). Used at 2nd row in thw Sale book's summary" \
567+ help="Sum of International Tax Base Amounts (reduced, general"
568+ " and additional). Used at 2nd row in thw Sale book's summary"
569 " with Exports Sales title"),
570 'imex_exempt_vat_sum': fields.float(
571 digits_compute=dp.get_precision('Account'),
572 string="Exempt Tax",
573- help="Import/Export Exempt Tax Totalization: Sum of Exempt" \
574+ help="Import/Export Exempt Tax Totalization: Sum of Exempt"
575 " column for international transactions"),
576 'imex_sdcf_vat_sum': fields.float(
577 digits_compute=dp.get_precision('Account'),
578 string="SDCF Tax",
579- help="Import/Export SDCF Tax Totalization: Sum of SDCF column" \
580+ help="Import/Export SDCF Tax Totalization: Sum of SDCF column"
581 " for international transactions"),
582 'imex_general_vat_base_sum': fields.float(
583 digits_compute=dp.get_precision('Account'),
584 string="General VAT Taxable Amount",
585- help="General VAT Taxed Imports/Exports Base Amount. Sum of" \
586+ help="General VAT Taxed Imports/Exports Base Amount. Sum of"
587 " General VAT Base column for international transactions"),
588 'imex_general_vat_tax_sum': fields.float(
589 digits_compute=dp.get_precision('Account'),
590 string="General VAT Taxed Amount",
591- help="General VAT Taxed Imports/Exports Tax Amount. Sum of" \
592+ help="General VAT Taxed Imports/Exports Tax Amount. Sum of"
593 " General VAT Tax column for international transactions"),
594 'imex_additional_vat_base_sum': fields.float(
595 digits_compute=dp.get_precision('Account'),
596 string="Additional VAT Taxable Amount",
597- help="Additional VAT Taxed Imports/Exports Base Amount. Sum of" \
598+ help="Additional VAT Taxed Imports/Exports Base Amount. Sum of"
599 " Additional VAT Base column for international transactions"),
600 'imex_additional_vat_tax_sum': fields.float(
601 digits_compute=dp.get_precision('Account'),
602 string="Additional VAT Taxed Amount",
603- help="Additional VAT Taxed Imports/Exports Tax Amount. Sum of " \
604+ help="Additional VAT Taxed Imports/Exports Tax Amount. Sum of "
605 " Additional VAT Tax column for international transactions"),
606 'imex_reduced_vat_base_sum': fields.float(
607 digits_compute=dp.get_precision('Account'),
608 string="Reduced VAT Taxable Amount",
609- help="Reduced VAT Taxed Imports/Exports Base Amount. Sum of " \
610+ help="Reduced VAT Taxed Imports/Exports Base Amount. Sum of "
611 " Reduced VAT Base column for international transactions"),
612 'imex_reduced_vat_tax_sum': fields.float(
613 digits_compute=dp.get_precision('Account'),
614 string="Reduced VAT Taxed Amount",
615- help="Reduced VAT Taxed Imports/Exports Tax Amount. Sum of " \
616+ help="Reduced VAT Taxed Imports/Exports Tax Amount. Sum of "
617 " Reduced VAT Tax column for international transactions"),
618
619 #~ Totalization fields for domestic transactions
620@@ -401,61 +401,61 @@
621 'do_vat_base_sum': fields.float(
622 digits_compute=dp.get_precision('Account'),
623 string="Domestic Taxable Amount",
624- help="Sum of all domestic transaction base amounts (reduced," \
625+ help="Sum of all domestic transaction base amounts (reduced,"
626 " general and additional)"),
627 'do_exempt_vat_sum': fields.float(
628 digits_compute=dp.get_precision('Account'),
629 string="Exempt Tax",
630- help="Domestic Exempt Tax Totalization. For Purchase Book it" \
631- " sums Exempt column for domestic transactions. For Sale Book it" \
632+ help="Domestic Exempt Tax Totalization. For Purchase Book it"
633+ " sums Exempt column for domestic transactions. For Sale Book it"
634 " sums Tax Payer and Non-Tax Payer Exempt columns"),
635 'do_sdcf_vat_sum': fields.float(
636 digits_compute=dp.get_precision('Account'),
637 string="SDCF Tax",
638- help="Domestic SDCF Tax Totalization. For Purchase Book it sums" \
639- " SDCF column for domestic transactions. For Sale Book it sums" \
640+ help="Domestic SDCF Tax Totalization. For Purchase Book it sums"
641+ " SDCF column for domestic transactions. For Sale Book it sums"
642 " Tax Payer and Non-Tax Payer SDCF columns"),
643 'do_general_vat_base_sum': fields.float(
644 digits_compute=dp.get_precision('Account'),
645 string="General VAT Taxable Amount",
646- help="General VAT Taxed Domestic Base Amount Totalization." \
647- " For Purchase Book it sums General VAT Base column for domestic" \
648- " transactions. For Sale Book it sums Tax Payer and Non-Tax Payer" \
649+ help="General VAT Taxed Domestic Base Amount Totalization."
650+ " For Purchase Book it sums General VAT Base column for domestic"
651+ " transactions. For Sale Book it sums Tax Payer and Non-Tax Payer"
652 " General VAT Base columns"),
653 'do_general_vat_tax_sum': fields.float(
654 digits_compute=dp.get_precision('Account'),
655 string="General VAT Taxed Amount",
656- help="General VAT Taxed Domestic Tax Amount Totalization." \
657- " For Purchase Book it sums General VAT Tax column for domestic" \
658- " transactions. For Sale Book it sums Tax Payer and Non-Tax Payer" \
659+ help="General VAT Taxed Domestic Tax Amount Totalization."
660+ " For Purchase Book it sums General VAT Tax column for domestic"
661+ " transactions. For Sale Book it sums Tax Payer and Non-Tax Payer"
662 " General VAT Tax columns"),
663 'do_additional_vat_base_sum': fields.float(
664 digits_compute=dp.get_precision('Account'),
665 string="Additional VAT Taxable Amount",
666- help="Additional VAT Taxed Domestic Base Amount Totalization." \
667- " For Purchase Book it sums Additional VAT Base column for" \
668- " domestic transactions. For Sale Book it sums Tax Payer and No" \
669+ help="Additional VAT Taxed Domestic Base Amount Totalization."
670+ " For Purchase Book it sums Additional VAT Base column for"
671+ " domestic transactions. For Sale Book it sums Tax Payer and No"
672 " Tax Payer Additional VAT Base columns"),
673 'do_additional_vat_tax_sum': fields.float(
674 digits_compute=dp.get_precision('Account'),
675 string="Additional VAT Taxed Amount",
676- help="Additional VAT Taxed Domestic Tax Amount Totalization." \
677- " For Purchase Book it sums Additional VAT Tax column for" \
678- " domestic transactions. For Sale Book it sums Tax Payer and No" \
679+ help="Additional VAT Taxed Domestic Tax Amount Totalization."
680+ " For Purchase Book it sums Additional VAT Tax column for"
681+ " domestic transactions. For Sale Book it sums Tax Payer and No"
682 " Tax Payer Additional VAT Tax columns"),
683 'do_reduced_vat_base_sum': fields.float(
684 digits_compute=dp.get_precision('Account'),
685 string="Reduced VAT Taxable Amount",
686- help="Reduced VAT Taxed Domestic Base Amount Totalization." \
687- " For Purchase Book it sums Reduced VAT Base column for domestic" \
688- " transactions. For Sale Book it sums Tax Payer and Non-Tax Payer" \
689+ help="Reduced VAT Taxed Domestic Base Amount Totalization."
690+ " For Purchase Book it sums Reduced VAT Base column for domestic"
691+ " transactions. For Sale Book it sums Tax Payer and Non-Tax Payer"
692 " Reduced VAT Base columns"),
693 'do_reduced_vat_tax_sum': fields.float(
694 digits_compute=dp.get_precision('Account'),
695 string="Reduced VAT Taxed Amount",
696- help="Reduced VAT Taxed Domestic Tax Amount Totalization." \
697- " For Purchase Book it sums Reduced VAT Tax column for domestic" \
698- " transactions. For Sale Book it sums Tax Payer and Non-Tax Payer" \
699+ help="Reduced VAT Taxed Domestic Tax Amount Totalization."
700+ " For Purchase Book it sums Reduced VAT Tax column for domestic"
701+ " transactions. For Sale Book it sums Tax Payer and Non-Tax Payer"
702 " Reduced VAT Tax columns"),
703 'do_adjustment_vat_tax_sum': fields.function(
704 _get_do_adjustment_vat_tax_sum, method=True, type='float',
705@@ -464,10 +464,10 @@
706 #~ Apply only for sale book
707 #~ Totalization fields for tax payer and Non-Tax Payer transactions
708 'ntp_fbl_ids': fields.one2many("fiscal.book.line", "ntp_fb_id",
709- string = "Non-Tax Payer Detail Lines",
710- help="Non-Tax Payer Lines that are" \
711- " grouped by the statement law that" \
712- " represent the data of are" \
713+ string="Non-Tax Payer Detail Lines",
714+ help="Non-Tax Payer Lines that are"
715+ " grouped by the statement law that"
716+ " represent the data of are"
717 " consolidate book lines"),
718 'get_total_with_iva_tp_sum': fields.function(
719 _get_total_with_iva_sum,
720@@ -478,47 +478,47 @@
721 'tp_vat_base_sum': fields.float(
722 digits_compute=dp.get_precision('Account'),
723 string="Tax Payer Taxable Amount",
724- help="Sum of all Tax Payer Grand Base Sum (reduced, general and" \
725+ help="Sum of all Tax Payer Grand Base Sum (reduced, general and"
726 " additional taxes)"),
727 'tp_exempt_vat_sum': fields.float(
728 digits_compute=dp.get_precision('Account'),
729 string="Exempt Tax",
730- help="Tax Payer Exempt Tax Totalization. Sum of Exempt column" \
731+ help="Tax Payer Exempt Tax Totalization. Sum of Exempt column"
732 " for tax payer transactions"),
733 'tp_sdcf_vat_sum': fields.float(
734 digits_compute=dp.get_precision('Account'),
735 string="SDCF Tax",
736- help="Tax Payer SDCF Tax Totalization. Sum of SDCF column for" \
737+ help="Tax Payer SDCF Tax Totalization. Sum of SDCF column for"
738 " tax payer transactions"),
739 'tp_general_vat_base_sum': fields.float(
740 digits_compute=dp.get_precision('Account'),
741 string="General VAT Taxable Amount",
742- help="General VAT Taxed Tax Payer Base Amount Totalization." \
743+ help="General VAT Taxed Tax Payer Base Amount Totalization."
744 " Sum of General VAT Base column for taxy payer transactions"),
745 'tp_general_vat_tax_sum': fields.float(
746 digits_compute=dp.get_precision('Account'),
747 string="General VAT Taxed Amount",
748- help="General VAT Taxed Tax Payer Tax Amount Totalization." \
749+ help="General VAT Taxed Tax Payer Tax Amount Totalization."
750 " Sum of General VAT Tax column for tax payer transactions"),
751 'tp_additional_vat_base_sum': fields.float(
752 digits_compute=dp.get_precision('Account'),
753 string="Additional VAT Taxable Amount",
754- help="Additional VAT Taxed Tax Payer Base Amount Totalization." \
755+ help="Additional VAT Taxed Tax Payer Base Amount Totalization."
756 " Sum of Additional VAT Base column for tax payer transactions"),
757 'tp_additional_vat_tax_sum': fields.float(
758 digits_compute=dp.get_precision('Account'),
759 string="Additional VAT Taxed Amount",
760- help="Additional VAT Taxed Tax Payer Tax Amount Totalization." \
761+ help="Additional VAT Taxed Tax Payer Tax Amount Totalization."
762 " Sum of Additional VAT Tax column for tax payer transactions"),
763 'tp_reduced_vat_base_sum': fields.float(
764 digits_compute=dp.get_precision('Account'),
765 string="Reduced VAT Taxable Amount",
766- help="Reduced VAT Taxed Tax Payer Base Amount Totalization." \
767+ help="Reduced VAT Taxed Tax Payer Base Amount Totalization."
768 " Sum of Reduced VAT Base column for tax payer transactions"),
769 'tp_reduced_vat_tax_sum': fields.float(
770 digits_compute=dp.get_precision('Account'),
771 string="Reduced VAT Taxed Amount",
772- help="Reduced VAT Taxed Tax Payer Tax Amount Totalization." \
773+ help="Reduced VAT Taxed Tax Payer Tax Amount Totalization."
774 " Sum of Reduced VAT Tax column for tax payer transactions"),
775
776 'get_total_with_iva_ntp_sum': fields.function(
777@@ -530,55 +530,55 @@
778 'ntp_vat_base_sum': fields.float(
779 digits_compute=dp.get_precision('Account'),
780 string="Non-Tax Payer Taxable Amount",
781- help="Non-Tax Payer Grand Base Totalization. Sum of all no tax" \
782+ help="Non-Tax Payer Grand Base Totalization. Sum of all no tax"
783 " payer tax bases (reduced, general and additional)"),
784 'ntp_exempt_vat_sum': fields.float(
785 digits_compute=dp.get_precision('Account'),
786 string="Exempt Tax",
787- help="Non-Tax Payer Exempt Tax Totalization. Sum of Exempt" \
788+ help="Non-Tax Payer Exempt Tax Totalization. Sum of Exempt"
789 " column for Non-Tax Payer transactions"),
790 'ntp_sdcf_vat_sum': fields.float(
791 digits_compute=dp.get_precision('Account'),
792 string="SDCF Tax",
793- help="Non-Tax Payer SDCF Tax Totalization. Sum of SDCF column" \
794+ help="Non-Tax Payer SDCF Tax Totalization. Sum of SDCF column"
795 " for Non-Tax Payer transactions"),
796 'ntp_general_vat_base_sum': fields.float(
797 digits_compute=dp.get_precision('Account'),
798 string="General VAT Taxable Amount",
799- help="General VAT Taxed Non-Tax Payer Base Amount Totalization." \
800+ help="General VAT Taxed Non-Tax Payer Base Amount Totalization."
801 " Sum of General VAT Base column for taxy payer transactions"),
802 'ntp_general_vat_tax_sum': fields.float(
803 digits_compute=dp.get_precision('Account'),
804 string="General VAT Taxed Amount",
805- help="General VAT Taxed Non-Tax Payer Tax Amount Totalization." \
806+ help="General VAT Taxed Non-Tax Payer Tax Amount Totalization."
807 " Sum of General VAT Tax column for Non-Tax Payer transactions"),
808 'ntp_additional_vat_base_sum': fields.float(
809 digits_compute=dp.get_precision('Account'),
810 string="Additional VAT Taxable Amount",
811- help="Additional VAT Taxed Non-Tax Payer Base Amount Totalization." \
812+ help="Additional VAT Taxed Non-Tax Payer Base Amount Totalization."
813 " Sum of Additional VAT Base column for Non-Tax Payer transactions"),
814 'ntp_additional_vat_tax_sum': fields.float(
815 digits_compute=dp.get_precision('Account'),
816 string="Additional VAT Taxed Amount",
817- help="Additional VAT Taxed Non-Tax Payer Tax Amount Totalization." \
818+ help="Additional VAT Taxed Non-Tax Payer Tax Amount Totalization."
819 " Sum of Additional VAT Tax column for Non-Tax Payer transactions"),
820 'ntp_reduced_vat_base_sum': fields.float(
821 digits_compute=dp.get_precision('Account'),
822 string="Reduced VAT Taxable Amount",
823- help="Reduced VAT Taxed Non-Tax Payer Base Amount Totalization." \
824+ help="Reduced VAT Taxed Non-Tax Payer Base Amount Totalization."
825 " Sum of Reduced VAT Base column for Non-Tax Payer transactions"),
826 'ntp_reduced_vat_tax_sum': fields.float(
827 digits_compute=dp.get_precision('Account'),
828 string="Reduced VAT Taxed Amount",
829- help="Reduced VAT Taxed Non-Tax Payer Tax Amount Totalization." \
830+ help="Reduced VAT Taxed Non-Tax Payer Tax Amount Totalization."
831 " Sum of Reduced VAT Tax column for Non-Tax Payer transactions"),
832 }
833
834 _defaults = {
835 'state': 'draft',
836 'type': _get_type,
837- 'company_id': lambda s, c, u, ctx: \
838- s.pool.get('res.users').browse(c, u, u, context=ctx).company_id.id,
839+ 'company_id': lambda s, c, u, ctx:
840+ s.pool.get('res.users').browse(c, u, u, context=ctx).company_id.id,
841 'article_number': _get_article_number,
842 'fortnight': None,
843 }
844@@ -595,7 +595,7 @@
845 """ It make clear all stuff of book. """
846 context = context or {}
847 self.clear_book(cr, uid, ids, context=context)
848- return {'value':{}}
849+ return {'value': {}}
850
851 #~ update book methods
852
853@@ -717,7 +717,7 @@
854 ['|',
855 '&', ('fb_id', '=', fb_brw.id), ('period_id', '!=', fb_brw.period_id.id),
856 '&', '&', ('period_id', '=', fb_brw.period_id.id), ('type', 'in', inv_type),
857- ('state', 'not in', inv_state)],
858+ ('state', 'not in', inv_state)],
859 order='date_invoice asc', context=context)
860 if fb_brw.fortnight:
861 issue_inv_ids = self.get_invoices_from_fortnight(
862@@ -752,8 +752,8 @@
863 awil_obj = self.pool.get('account.wh.iva.line')
864 fb_brw = self.browse(cr, uid, fb_id, context=context)
865 awil_type = fb_brw.type == 'sale' \
866- and ['out_invoice', 'out_refund'] \
867- or ['in_invoice', 'in_refund']
868+ and ['out_invoice', 'out_refund'] \
869+ or ['in_invoice', 'in_refund']
870 #~ pull wh iva line data
871 awil_ids = []
872 awi_ids = awi_obj.search(cr, uid,
873@@ -763,7 +763,7 @@
874 context=context)
875 if fb_brw.fortnight:
876 awi_ids = self.get_awi_from_fortnight(
877- cr, uid, fb_id, awi_ids, context=context)
878+ cr, uid, fb_id, awi_ids, context=context)
879
880 for awi_id in awi_ids:
881 list_ids = awil_obj.search(cr, uid,
882@@ -868,7 +868,6 @@
883 and 'accounting_date asc, invoice_number asc' \
884 or 'emission_date asc, invoice_number asc'
885
886-
887 def order_book_lines(self, cr, uid, fb_id, context=None):
888 """ It orders book lines by a set of criteria:
889 - chronologically ascendant date (For purchase book by
890@@ -885,16 +884,15 @@
891
892 ajst_order_criteria = self.get_order_criteria_adjustment(cr, uid, fb_brw.type, context=context)
893 ajst_ordered_fbl_ids = \
894- fbl_obj.search(cr, uid, [('id', 'in', fbl_ids),('doc_type', '=', 'AJST')],
895+ fbl_obj.search(cr, uid, [('id', 'in', fbl_ids), ('doc_type', '=', 'AJST')],
896 order=ajst_order_criteria, context=context)
897
898 for rank, fbl_id in enumerate(ajst_ordered_fbl_ids, 1):
899 fbl_obj.write(cr, uid, fbl_id, {'rank': rank}, context=context)
900
901-
902 order_criteria = self.get_order_criteria(cr, uid, fb_brw.type, context=context)
903 ordered_fbl_ids = \
904- fbl_obj.search(cr, uid, [('id', 'in', fbl_ids),('doc_type', '!=', 'AJST')],
905+ fbl_obj.search(cr, uid, [('id', 'in', fbl_ids), ('doc_type', '!=', 'AJST')],
906 order=order_criteria, context=context)
907
908 for rank, fbl_id in enumerate(ordered_fbl_ids, len(ajst_ordered_fbl_ids) + 1):
909@@ -917,7 +915,7 @@
910 context=context)
911 if iwdl_id:
912 if inv_brw.date_invoice != \
913- iwdl_obj.browse(cr, uid, iwdl_id, context=context).date_ret:
914+ iwdl_obj.browse(cr, uid, iwdl_id, context=context).date_ret:
915 res.append(iwdl_id)
916 return res
917
918@@ -927,7 +925,6 @@
919 """
920 # TODO: make this method aware of fortnight.
921 context = context or {}
922- per_obj = self.pool.get('account.period')
923 cf_obj = self.pool.get('customs.form')
924
925 ids = isinstance(ids, (int, long)) and [ids] or ids
926@@ -936,9 +933,9 @@
927 continue
928 add_cf_ids = cf_obj.search(
929 cr, uid,
930- [('state','=', 'done'),
931- ('date_liq','>=', fb_brw.period_id.date_start),
932- ('date_liq','<=', fb_brw.period_id.date_stop)],
933+ [('state', '=', 'done'),
934+ ('date_liq', '>=', fb_brw.period_id.date_start),
935+ ('date_liq', '<=', fb_brw.period_id.date_stop)],
936 context=context)
937 add_cf_ids and self.write(
938 cr, uid, fb_brw.id, {'cf_ids': [(4, cf) for cf in add_cf_ids]},
939@@ -953,7 +950,6 @@
940 context = context or {}
941 data = []
942 iwdl_obj = self.pool.get('account.wh.iva.line')
943- cf_obj = self.pool.get('customs.form')
944 fb_brw = self.browse(cr, uid, fb_id, context=context)
945 rp_obj = self.pool.get('res.partner')
946
947@@ -968,7 +964,7 @@
948 t_type = fb_brw.type == 'sale' and 'tp' or 'do'
949 for iwdl_brw in iwdl_obj.browse(cr, uid, iwdl_ids,
950 context=context):
951- rp_brw = rp_obj._find_accounting_partner(iwdl_brw.retention_id.partner_id)
952+ rp_brw = rp_obj._find_accounting_partner(iwdl_brw.retention_id.partner_id)
953 values = {
954 'iwdl_id': iwdl_brw.id,
955 'type': t_type,
956@@ -980,12 +976,12 @@
957 'partner_name': rp_brw.name or 'N/A',
958 'partner_vat': rp_brw.vat or 'N/A',
959 'affected_invoice': iwdl_brw.invoice_id.fiscal_printer
960- and iwdl_brw.invoice_id.invoice_printer
961- or (fb_brw.type == 'sale'
962- and iwdl_brw.invoice_id.number
963- or iwdl_brw.invoice_id.supplier_invoice_number),
964- 'affected_invoice_date': iwdl_brw.invoice_id.date_document \
965- or iwdl_brw.invoice_id.date_invoice,
966+ and iwdl_brw.invoice_id.invoice_printer
967+ or (fb_brw.type == 'sale'
968+ and iwdl_brw.invoice_id.number
969+ or iwdl_brw.invoice_id.supplier_invoice_number),
970+ 'affected_invoice_date': iwdl_brw.invoice_id.date_document
971+ or iwdl_brw.invoice_id.date_invoice,
972 'wh_rate': iwdl_brw.wh_iva_rate,
973 }
974 data.append((0, 0, values))
975@@ -1000,45 +996,45 @@
976 doc_type = self.get_doc_type(cr, uid, inv_id=inv_brw.id,
977 fb_id=fb_id, context=context)
978
979- rp_brw = rp_obj._find_accounting_partner(inv_brw.partner_id)
980+ rp_brw = rp_obj._find_accounting_partner(inv_brw.partner_id)
981
982 iwdl_brw = iwdl_obj.browse(cr, uid, iwdl_id, context=context) if \
983 iwdl_id and iwdl_id not in no_match_dt_iwdl_ids else False
984
985 values = {
986 'invoice_id': inv_brw.id,
987- 'emission_date': (not imex_invoice) \
988- and (inv_brw.date_document or inv_brw.date_invoice) \
989- or False,
990- 'accounting_date': (not imex_invoice) and \
991- inv_brw.date_invoice or False,
992+ 'emission_date': (not imex_invoice)
993+ and (inv_brw.date_document or inv_brw.date_invoice)
994+ or False,
995+ 'accounting_date': (not imex_invoice) and
996+ inv_brw.date_invoice or False,
997 'imex_date': imex_invoice and inv_brw.customs_form_id.date_liq or False,
998 'type': self.get_transaction_type(cr, uid, fb_id, inv_brw.id,
999 context=context),
1000- 'debit_affected': inv_brw.parent_id \
1001- and inv_brw.parent_id.type in ['in_invoice', 'out_invoice'] \
1002- and inv_brw.parent_id.parent_id \
1003- and inv_brw.parent_id.number or False,
1004- 'credit_affected': inv_brw.parent_id and \
1005- inv_brw.parent_id.type in ['in_refund', 'out_refund'] \
1006- and inv_brw.parent_id.number or False,
1007+ 'debit_affected': inv_brw.parent_id
1008+ and inv_brw.parent_id.type in ['in_invoice', 'out_invoice']
1009+ and inv_brw.parent_id.parent_id
1010+ and inv_brw.parent_id.number or False,
1011+ 'credit_affected': inv_brw.parent_id and
1012+ inv_brw.parent_id.type in ['in_refund', 'out_refund']
1013+ and inv_brw.parent_id.number or False,
1014 'ctrl_number': not inv_brw.fiscal_printer and inv_brw.nro_ctrl or False,
1015- 'affected_invoice': (doc_type == "N/DE" or doc_type == "N/CR") \
1016- and (inv_brw.parent_id and inv_brw.parent_id.number or False) \
1017- or False,
1018+ 'affected_invoice': (doc_type == "N/DE" or doc_type == "N/CR")
1019+ and (inv_brw.parent_id and inv_brw.parent_id.number or False)
1020+ or False,
1021 'partner_name': rp_brw.name or 'N/A',
1022- 'partner_vat': rp_brw.vat \
1023- and rp_brw.vat[2:] or 'N/A',
1024+ 'partner_vat': rp_brw.vat
1025+ and rp_brw.vat[2:] or 'N/A',
1026 'invoice_number': inv_brw.fiscal_printer
1027- and inv_brw.invoice_printer
1028- or (fb_brw.type == 'sale'
1029- and inv_brw.number
1030- or inv_brw.supplier_invoice_number),
1031+ and inv_brw.invoice_printer
1032+ or (fb_brw.type == 'sale'
1033+ and inv_brw.number
1034+ or inv_brw.supplier_invoice_number),
1035 'doc_type': doc_type,
1036- 'void_form': inv_brw.name and \
1037- (inv_brw.name.find('PAPELANULADO') >= 0 \
1038- and '03-ANU' or '01-REG') \
1039- or '01-REG',
1040+ 'void_form': inv_brw.name and
1041+ (inv_brw.name.find('PAPELANULADO') >= 0
1042+ and '03-ANU' or '01-REG')
1043+ or '01-REG',
1044 'fiscal_printer': inv_brw.fiscal_printer or False,
1045 'z_report': inv_brw.z_report or False,
1046 'custom_statement': inv_brw.customs_form_id.name or False,
1047@@ -1068,7 +1064,7 @@
1048 values = common_values.copy()
1049 values['partner_name'] = partner_brw.name or 'N/A'
1050 values['partner_vat'] = partner_brw.vat \
1051- and partner_brw.vat[2:] or 'N/A'
1052+ and partner_brw.vat[2:] or 'N/A'
1053 values['total_with_iva'] = \
1054 self.get_cfl_sum(cr, uid, cf_brw.id, partner_brw.id,
1055 context=context)
1056@@ -1094,14 +1090,14 @@
1057 @param cf_id: customs form id
1058 @param partner_id: partner id
1059 """
1060- #KEEP AN EYE ON HERE, No check has been made on accounting partner
1061+ # KEEP AN EYE ON HERE, No check has been made on accounting partner
1062 context = context or {}
1063 cf_obj = self.pool.get('customs.form')
1064 cfl_brws = cf_obj.browse(cr, uid, cf_id, context=context).cfl_ids
1065 amount = sum([cfl_brw.amount
1066 for cfl_brw in cfl_brws
1067 if cfl_brw.tax_code.partner_id.id == partner_id
1068- and not cfl_brw.tax_code.vat_detail ])
1069+ and not cfl_brw.tax_code.vat_detail])
1070 return amount
1071
1072 def get_grouped_consecutive_lines_ids(self, cr, uid, lines_ids, context=None):
1073@@ -1131,15 +1127,15 @@
1074 group_list.append(line_brw)
1075 else:
1076 if group_list:
1077- res.append( (group_list[0].invoice_number, group_list[-1].invoice_number, group_value, group_list) )
1078+ res.append((group_list[0].invoice_number, group_list[-1].invoice_number, group_value, group_list))
1079 group_value = line_brw.type
1080 group_list = [line_brw]
1081 else:
1082- res.append( (line_brw.invoice_number, line_brw.invoice_number, group_value, [line_brw]) )
1083+ res.append((line_brw.invoice_number, line_brw.invoice_number, group_value, [line_brw]))
1084 group_value = False
1085
1086 if group_list:
1087- res.append( (group_list[0].invoice_number, group_list[-1].invoice_number, group_value, group_list) )
1088+ res.append((group_list[0].invoice_number, group_list[-1].invoice_number, group_value, group_list))
1089
1090 return res
1091
1092@@ -1157,35 +1153,35 @@
1093 #~ separating groups
1094 lines_brws = fb_brw.fbl_ids
1095 order_dict = dict()
1096- date_values = list(set([ line_brw.emission_date for line_brw in lines_brws ]))
1097+ date_values = list(set([line_brw.emission_date for line_brw in lines_brws]))
1098 date_values.sort()
1099 order_dict = {}.fromkeys(date_values)
1100 for date in date_values:
1101- date_records = [ line_brw
1102- for line_brw in lines_brws
1103- if line_brw.emission_date == date ]
1104- printers_values = list(set( [ line_brw.fiscal_printer for line_brw in date_records ] ))
1105+ date_records = [line_brw
1106+ for line_brw in lines_brws
1107+ if line_brw.emission_date == date]
1108+ printers_values = list(set([line_brw.fiscal_printer for line_brw in date_records]))
1109 printers_values.sort()
1110 order_dict[date] = {}.fromkeys(printers_values)
1111 for printer in printers_values:
1112- printer_records = [ line_brw
1113- for line_brw in date_records
1114- if line_brw.fiscal_printer == printer ]
1115- z_report_values = list(set( [ line_brw.z_report for line_brw in printer_records ] ))
1116+ printer_records = [line_brw
1117+ for line_brw in date_records
1118+ if line_brw.fiscal_printer == printer]
1119+ z_report_values = list(set([line_brw.z_report for line_brw in printer_records]))
1120 z_report_values.sort()
1121 order_dict[date][printer] = {}.fromkeys(z_report_values)
1122 for z_report in z_report_values:
1123 #~ this records needs to be order by invoice number
1124 z_records = \
1125- [ (line_brw.invoice_number, line_brw)
1126- for line_brw in printer_records
1127- if line_brw.z_report == z_report ]
1128+ [(line_brw.invoice_number, line_brw)
1129+ for line_brw in printer_records
1130+ if line_brw.z_report == z_report]
1131 z_records.sort()
1132- z_records = [ item[1] for item in z_records]
1133+ z_records = [item[1] for item in z_records]
1134 #~ group by type of line
1135 order_dict[date][printer][z_report] = \
1136 self.get_grouped_consecutive_lines_ids(
1137- cr, uid, [ item.id for item in z_records],
1138+ cr, uid, [item.id for item in z_records],
1139 context=context)
1140
1141 #~ import pprint
1142@@ -1216,14 +1212,14 @@
1143 elif line[0] != line[1] and len(line[3]) > 1:
1144 ntp_groups_list.append(
1145 (rank,
1146- 'Desde: '+line[0]+' ... Hasta: '+line[1],
1147+ 'Desde: ' + line[0] + ' ... Hasta: ' + line[1],
1148 line[3]))
1149 else:
1150 raise osv.except_osv(_("Error!"), _("This is a no valid line. Be sure you have two or more invoices with the same invoice number"))
1151 elif line[2] != 'ntp':
1152 order_no_group_list.append(
1153 (rank, line[3][0].id))
1154- rank+= 1
1155+ rank += 1
1156
1157 #~ import pprint
1158 #~ print '\n ntp_no_group_list'
1159@@ -1233,11 +1229,11 @@
1160 #~ print '\n order_no_group_list'
1161 #~ pprint.pprint(order_no_group_list)
1162
1163- #~ # rank lines that have nothing to do with ntp.
1164+ # ~ # rank lines that have nothing to do with ntp.
1165 for line in order_no_group_list:
1166 fbl_obj.write(cr, uid, line[1], {'rank': line[0]}, context=context)
1167
1168- #~ # rank ntp individual lines.
1169+ # ~ # rank ntp individual lines.
1170 for line in ntp_no_group_list:
1171 fbl_obj.write(
1172 cr, uid, line[1],
1173@@ -1258,7 +1254,7 @@
1174 {'fb_id': False,
1175 'ntp_fb_id': fb_id,
1176 'parent_id': consolidate_line_id,
1177- 'rank': -1 },
1178+ 'rank': -1},
1179 context=context)
1180
1181 return True
1182@@ -1278,8 +1274,8 @@
1183 'vat_general_base', 'vat_general_tax',
1184 'vat_additional_base', 'vat_additional_tax']
1185
1186- rank, invoice_number, child_brws = line_tuple
1187- child_ids = [ line_brw.id for line_brw in child_brws ]
1188+ rank, invoice_number, child_brws = line_tuple
1189+ child_ids = [line_brw.id for line_brw in child_brws]
1190 first_item_brw = fbl_obj.browse(cr, uid, child_brws[0].id,
1191 context=context)
1192 # fill common value
1193@@ -1299,7 +1295,7 @@
1194 # fill totalization values
1195 for col in float_colums:
1196 values[col] = \
1197- sum([ getattr(line_brw, col) for line_brw in child_brws ])
1198+ sum([getattr(line_brw, col) for line_brw in child_brws])
1199
1200 return fbl_obj.create(cr, uid, values, context=context)
1201
1202@@ -1321,7 +1317,7 @@
1203 for fbl in self.browse(cr, uid, fb_id, context=context).fbl_ids:
1204 if fbl.invoice_id:
1205 sign = 1 if fbl.doc_type != 'N/CR' else -1
1206- tax_lines = fbl.type in ['im','ex'] \
1207+ tax_lines = fbl.type in ['im', 'ex'] \
1208 and fbl.invoice_id.imex_tax_line \
1209 or fbl.invoice_id.tax_line
1210 for ait in tax_lines:
1211@@ -1331,20 +1327,20 @@
1212 tax_sum[fbl.type][ait.tax_id.appl_type] += \
1213 ait.tax_amount * sign
1214 else:
1215- raise osv.except_osv(_('Error!'),_('You must assign the Aliquot Type to: %s')%(ait.tax_id.name))
1216+ raise osv.except_osv(_('Error!'), _('You must assign the Aliquot Type to: %s') % (ait.tax_id.name))
1217 elif fbl.cf_id:
1218 if fbl.type != 'do':
1219 raise osv.except_osv(_('Programing Error!'),
1220 _("Customs form lines are domestic transactions"))
1221 base_sum['do']['sdcf'] += fbl.vat_sdcf
1222
1223- data = [ (0, 0, {'tax_type': ttype, 'op_type': optype,
1224- 'base_amount_sum': base_sum[optype][ttype],
1225- 'tax_amount_sum': tax_sum[optype][ttype]
1226+ data = [(0, 0, {'tax_type': ttype, 'op_type': optype,
1227+ 'base_amount_sum': base_sum[optype][ttype],
1228+ 'tax_amount_sum': tax_sum[optype][ttype]
1229 })
1230- for ttype in tax_types
1231- for optype in op_types
1232- ]
1233+ for ttype in tax_types
1234+ for optype in op_types
1235+ ]
1236 return data and self.write(cr, uid, fb_id, {'fbts_ids': data},
1237 context=context)
1238
1239@@ -1361,9 +1357,9 @@
1240 for fbl_brw in self.browse(cr, uid, fb_id, context=context).fbl_ids:
1241 sign = 1 if fbl_brw.doc_type != 'N/CR' else -1
1242 if fbl_brw.invoice_id:
1243- taxes = fbl_brw.type in ['im','ex'] \
1244- and fbl_brw.invoice_id.imex_tax_line \
1245- or fbl_brw.invoice_id.tax_line
1246+ taxes = fbl_brw.type in ['im', 'ex'] \
1247+ and fbl_brw.invoice_id.imex_tax_line \
1248+ or fbl_brw.invoice_id.tax_line
1249 for ait in taxes:
1250 if ait.tax_id:
1251 base_amount += ait.base_amount * sign
1252@@ -1408,7 +1404,7 @@
1253 'ntp_additional_vat_tax_sum',
1254 'ntp_reduced_vat_base_sum',
1255 'ntp_reduced_vat_tax_sum',
1256- ]
1257+ ]
1258 for field_name in vat_fields:
1259 data[field_name] = \
1260 self.update_vat_fields(cr, uid, fb_id, field_name,
1261@@ -1418,14 +1414,14 @@
1262 fb_brw = self.browse(cr, uid, fb_id, context=context)
1263
1264 data['do_sdcf_and_exempt_sum'] = fb_brw.type == 'sale' \
1265- and ( data['tp_exempt_vat_sum'] + data['tp_sdcf_vat_sum'] + \
1266+ and (data['tp_exempt_vat_sum'] + data['tp_sdcf_vat_sum'] +
1267 data['ntp_exempt_vat_sum'] + data['ntp_sdcf_vat_sum'] ) \
1268- or ( data['do_exempt_vat_sum'] + data['do_sdcf_vat_sum'] )
1269+ or (data['do_exempt_vat_sum'] + data['do_sdcf_vat_sum'])
1270
1271 for optype in ['imex', 'do', 'tp', 'ntp']:
1272 data[optype + '_vat_base_sum'] = \
1273- sum( [ data[optype + '_' + ttax + "_vat_base_sum"]
1274- for ttax in ["general", "additional", "reduced"] ] )
1275+ sum([data[optype + '_' + ttax + "_vat_base_sum"]
1276+ for ttax in ["general", "additional", "reduced"]])
1277
1278 data['imex_vat_base_sum'] += \
1279 data['imex_exempt_vat_sum'] + data['imex_sdcf_vat_sum']
1280@@ -1439,14 +1435,14 @@
1281 for ttax in ["general", "additional", "reduced"]:
1282 for amttype in ["base", "tax"]:
1283 data['do_' + ttax + '_vat_' + amttype + '_sum'] = \
1284- sum( [ data[ optype + "_" + ttax + "_vat_" + amttype + "_sum"]
1285- for optype in ["ntp", "tp"]
1286- ] )
1287+ sum([data[optype + "_" + ttax + "_vat_" + amttype + "_sum"]
1288+ for optype in ["ntp", "tp"]
1289+ ])
1290 for ttax in ["exempt", "sdcf"]:
1291 data['do_' + ttax + '_vat_sum'] = \
1292- sum( [ data[ optype + "_" + ttax + "_vat_sum"]
1293- for optype in ["ntp", "tp"]
1294- ] )
1295+ sum([data[optype + "_" + ttax + "_vat_sum"]
1296+ for optype in ["ntp", "tp"]
1297+ ])
1298
1299 return self.write(cr, uid, fb_id, data, context=context)
1300
1301@@ -1534,9 +1530,9 @@
1302 fbl.invoice_id.date_invoice)
1303 sign = 1 if fbl.doc_type != 'N/CR' else -1
1304 amount_field_data = \
1305- { 'total_with_iva': f_xc(fbl.invoice_id.amount_untaxed) * sign,
1306- 'vat_sdcf': 0.0, 'vat_exempt': 0.0 }
1307- taxes = fbl.type in ['im','ex'] \
1308+ {'total_with_iva': f_xc(fbl.invoice_id.amount_untaxed) * sign,
1309+ 'vat_sdcf': 0.0, 'vat_exempt': 0.0}
1310+ taxes = fbl.type in ['im', 'ex'] \
1311 and fbl.invoice_id.imex_tax_line \
1312 or fbl.invoice_id.tax_line
1313 for ait in taxes:
1314@@ -1683,7 +1679,7 @@
1315 'ntp_additional_vat_tax_sum',
1316 'ntp_reduced_vat_base_sum',
1317 'ntp_reduced_vat_tax_sum',
1318- ]
1319+ ]
1320
1321 return self.write(cr, uid, fb_id, {}.fromkeys(vat_fields, 0.0),
1322 context=context)
1323@@ -1800,7 +1796,7 @@
1324 inv_obj = self.pool.get('account.invoice')
1325 rp_obj = self.pool.get('res.partner')
1326 inv_brw = inv_obj.browse(cr, uid, inv_id, context=context)
1327- rp_id = rp_obj._find_accounting_partner(inv_brw.partner_id)
1328+ rp_id = rp_obj._find_accounting_partner(inv_brw.partner_id)
1329 rp_brw = rp_obj.browse(cr, uid, rp_id, context=context)
1330 fb_brw = self.browse(cr, uid, fb_id, context=context)
1331 if inv_brw.customs_form_id:
1332@@ -1820,7 +1816,7 @@
1333 raise osv.except_osv("Invalid Procedure!!",
1334 "Your book needs to be in cancel state to be deleted.")
1335 else:
1336- super(fiscal_book,self).unlink(cr, uid, ids, context=context)
1337+ super(fiscal_book, self).unlink(cr, uid, ids, context=context)
1338 return True
1339
1340
1341@@ -1848,7 +1844,6 @@
1342 #~ TODO: for all taxes realted? only a tax type group?
1343 context = context or {}
1344 res = {}.fromkeys(ids, 0.0)
1345- awilt_obj = self.pool.get("account.wh.iva.line.tax")
1346 for fbl_brw in self.browse(cr, uid, ids, context=context):
1347 if fbl_brw.iwdl_id:
1348 sign = 1 if fbl_brw.doc_type != 'AJST' else -1
1349@@ -1861,12 +1856,12 @@
1350 for item in self.browse(cr, uid, ids, context=context):
1351 res[item.id] = {
1352 'vat_reduced_rate': item.vat_reduced_base and
1353- item.vat_reduced_tax * 100 / item.vat_reduced_base,
1354+ item.vat_reduced_tax * 100 / item.vat_reduced_base,
1355 'vat_general_rate': item.vat_general_base and
1356- item.vat_general_tax * 100 / item.vat_general_base,
1357+ item.vat_general_tax * 100 / item.vat_general_base,
1358 'vat_additional_rate': item.vat_additional_base and
1359- item.vat_additional_tax * 100 / item.vat_additional_base,
1360- }
1361+ item.vat_additional_tax * 100 / item.vat_additional_base,
1362+ }
1363 return res
1364
1365 _description = "Venezuela's Sale & Purchase Fiscal Book Lines"
1366@@ -1878,25 +1873,25 @@
1367 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
1368 help='Fiscal Book that owns this book line', ondelete='cascade'),
1369 'ntp_fb_id': fields.many2one("fiscal.book", "Non-Tax Payer Detail",
1370- help="Fiscal Book that owns this book line" \
1371+ help="Fiscal Book that owns this book line"
1372 " This Book is only for Non-Tax Payer lines"),
1373 'fbt_ids': fields.one2many('fiscal.book.taxes', 'fbl_id',
1374- string='Tax Lines', help="Tax Lines being" \
1375+ string='Tax Lines', help="Tax Lines being"
1376 " recorded in a Fiscal Book"),
1377 'invoice_id': fields.many2one('account.invoice', 'Invoice',
1378- help="Invoice related to this book" \
1379+ help="Invoice related to this book"
1380 " line"),
1381 'iwdl_id': fields.many2one('account.wh.iva.line', 'Vat Withholding',
1382- help="Withholding iva line related to" \
1383+ help="Withholding iva line related to"
1384 " this book line"),
1385 'cf_id': fields.many2one('customs.form', 'Customs Form',
1386- help="Customs Form being recorded to this" \
1387- " book line"),
1388+ help="Customs Form being recorded to this"
1389+ " book line"),
1390 'parent_id': fields.many2one(
1391 "fiscal.book.line",
1392 string="Consolidated Line",
1393 ondelete='cascade',
1394- help="Non-Tax Payer Consolidated Line. Indicate the id of the" \
1395+ help="Non-Tax Payer Consolidated Line. Indicate the id of the"
1396 " consolidated line where this Non-Tax Payer line belongs"),
1397 'parent_left': fields.integer('Left Parent', select=1),
1398 'parent_right': fields.integer('Right Parent', select=1),
1399@@ -1913,7 +1908,7 @@
1400 help='Invoice Document Date / Wh IVA Line Voucher Date'),
1401 'accounting_date': fields.date(
1402 string='Accounting Date',
1403- help="The day of the accounting record [(invoice, date_invoice)," \
1404+ help="The day of the accounting record [(invoice, date_invoice),"
1405 " (wh iva line, date_ret)]"),
1406 'doc_type': fields.char('Doc. Type', size=8, help='Document Type'),
1407 'partner_name': fields.char(size=128, string='Partner Name', help=''),
1408@@ -1921,8 +1916,8 @@
1409 'affected_invoice': fields.char(
1410 string='Affected Invoice',
1411 size=64,
1412- help="For an invoice line type means parent invoice for a Debit" \
1413- " or Credit Note. For an withholding line type means the invoice" \
1414+ help="For an invoice line type means parent invoice for a Debit"
1415+ " or Credit Note. For an withholding line type means the invoice"
1416 " number related to the withholding"),
1417 #~ Apply for wh iva lines
1418 'get_wh_vat': fields.function(_get_wh_vat,
1419@@ -1939,16 +1934,16 @@
1420 _get_based_tax_debit,
1421 type="float", method=True, store=True,
1422 string="Based Tax Debit",
1423- help="Sum of all tax amount for the taxes realeted to the wh iva" \
1424+ help="Sum of all tax amount for the taxes realeted to the wh iva"
1425 " line."),
1426
1427 #~ Apply for invoice lines
1428 'ctrl_number': fields.char(string='Invoice Control number', size=64,
1429 help=''),
1430 'invoice_number': fields.char(string='Invoice number', size=64,
1431- help="Invoice Number. In case of use" \
1432- " of fiscal printer this field will" \
1433- " store the invoice number generate" \
1434+ help="Invoice Number. In case of use"
1435+ " of fiscal printer this field will"
1436+ " store the invoice number generate"
1437 " by the fiscal printer machine"),
1438 'imex_date': fields.date(string='Imex Date',
1439 help='Invoice Imports/Exports Date'),
1440@@ -1964,9 +1959,9 @@
1441 ('ex', 'Exports'),
1442 ('tp', 'Tax Payer'),
1443 ('ntp', 'Non-Tax Payer')],
1444- string = 'Transaction Type', required=True,
1445- help="Book line transtaction type:" \
1446- " - Purchase: Import or Domestic." \
1447+ string='Transaction Type', required=True,
1448+ help="Book line transtaction type:"
1449+ " - Purchase: Import or Domestic."
1450 " - Sales: Expertation, Tax Payer, Non-Tax Payer."),
1451 'void_form': fields.char(string='Transaction type', size=192,
1452 help="Operation Type"),
1453@@ -1976,25 +1971,25 @@
1454 'custom_statement': fields.char(string="Custom Statement",
1455 size=192, help=""),
1456 #~ -- taxes fields
1457- 'total_with_iva': fields.float('Total with IVA', help="Sub Total of" \
1458- " the invoice (untaxed amount) plus" \
1459+ 'total_with_iva': fields.float('Total with IVA', help="Sub Total of"
1460+ " the invoice (untaxed amount) plus"
1461 " all tax amount of the related taxes"),
1462- 'vat_sdcf': fields.float("SDCF", help="Not entitled to tax credit" \
1463- " (The field name correspond to the spanih" \
1464+ 'vat_sdcf': fields.float("SDCF", help="Not entitled to tax credit"
1465+ " (The field name correspond to the spanih"
1466 " acronym for 'Sin Derecho a Credito Fiscal')"),
1467- 'vat_exempt': fields.float("Exempt", help="Exempt is a Tax with 0" \
1468+ 'vat_exempt': fields.float("Exempt", help="Exempt is a Tax with 0"
1469 " tax percentage"),
1470- 'vat_reduced_base': fields.float("RED BASE", help="Vat Reduced Base" \
1471- " Amount"),
1472- 'vat_reduced_tax': fields.float("RED TAX", help="Vat Reduced Tax" \
1473- " Amount"),
1474- 'vat_general_base': fields.float("GRAL BASE",help="Vat General Base" \
1475- " Amount"),
1476- 'vat_general_tax': fields.float("GRAL TAX", help="Vat General Tax" \
1477- " Amount"),
1478- 'vat_additional_base': fields.float("ADD BASE", help="Vat Generald" \
1479+ 'vat_reduced_base': fields.float("RED BASE", help="Vat Reduced Base"
1480+ " Amount"),
1481+ 'vat_reduced_tax': fields.float("RED TAX", help="Vat Reduced Tax"
1482+ " Amount"),
1483+ 'vat_general_base': fields.float("GRAL BASE", help="Vat General Base"
1484+ " Amount"),
1485+ 'vat_general_tax': fields.float("GRAL TAX", help="Vat General Tax"
1486+ " Amount"),
1487+ 'vat_additional_base': fields.float("ADD BASE", help="Vat Generald"
1488 " plus Additional Base Amount"),
1489- 'vat_additional_tax': fields.float("ADD TAX", help="Vat General plus" \
1490+ 'vat_additional_tax': fields.float("ADD TAX", help="Vat General plus"
1491 " Additional Tax Amount"),
1492 'vat_reduced_rate': fields.function(
1493 _compute_vat_rates, method=True, type='float',
1494@@ -2012,7 +2007,8 @@
1495
1496 _defaults = {
1497 'rank': 0,
1498- }
1499+ }
1500+
1501
1502 class fiscal_book_taxes(orm.Model):
1503
1504@@ -2065,14 +2061,15 @@
1505 ('ex', 'Exports'),
1506 ('tp', 'Tax Payer'),
1507 ('ntp', 'Non-Tax Payer')],
1508- string = 'Operation Type',
1509- help="Operation Type:" \
1510- " - Purchase: Import or Domestic." \
1511+ string='Operation Type',
1512+ help="Operation Type:"
1513+ " - Purchase: Import or Domestic."
1514 " - Sales: Expertation, Tax Payer, Non-Tax Payer."),
1515 'base_amount_sum': fields.float('Taxable Amount Sum'),
1516 'tax_amount_sum': fields.float('Taxed Amount Sum'),
1517 }
1518
1519+
1520 class adjustment_book_line(orm.Model):
1521
1522 _name = 'adjustment.book.line'
1523
1524=== modified file 'l10n_ve_fiscal_book/model/invoice.py'
1525--- l10n_ve_fiscal_book/model/invoice.py 2014-07-31 18:26:14 +0000
1526+++ l10n_ve_fiscal_book/model/invoice.py 2014-10-11 00:06:17 +0000
1527@@ -32,10 +32,10 @@
1528
1529 _columns = {
1530 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
1531- help='Fiscal Book where this line is ' \
1532+ help='Fiscal Book where this line is '
1533 'related to'),
1534 'issue_fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
1535- help='Fiscal Book where this invoice ' \
1536+ help='Fiscal Book where this invoice '
1537 'needs to be add'),
1538 }
1539
1540
1541=== modified file 'l10n_ve_fiscal_book/model/wh_iva.py'
1542--- l10n_ve_fiscal_book/model/wh_iva.py 2013-04-30 13:53:01 +0000
1543+++ l10n_ve_fiscal_book/model/wh_iva.py 2014-10-11 00:06:17 +0000
1544@@ -23,13 +23,14 @@
1545 # You should have received a copy of the GNU Affero General Public License
1546 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1547 ##############################################################################
1548-from openerp.osv import osv, orm, fields
1549-from openerp.tools.translate import _
1550+from openerp.osv import fields
1551+from openerp.osv import orm
1552+
1553
1554 class account_wh_iva_line(orm.Model):
1555- _inherit= "account.wh.iva.line"
1556+ _inherit = "account.wh.iva.line"
1557 _columns = {
1558- 'fb_id':fields.many2one('fiscal.book','Fiscal Book',
1559+ 'fb_id': fields.many2one('fiscal.book', 'Fiscal Book',
1560 help='Fiscal Book where this line is related to'),
1561 }
1562
1563@@ -41,7 +42,6 @@
1564 inv_obj = self.pool.get('account.invoice')
1565 inv = inv_obj.browse(cr, uid, inv_id, context=context)
1566 if inv.wh_iva and inv.wh_iva_id:
1567- awil_ids = self.search(cr, uid, ids, [('invoice_id' , '=', inv.id)], context=context)
1568- self.write(cr, uid, awil_ids, {'fb_id' : fb_id }, context=context)
1569+ awil_ids = self.search(cr, uid, ids, [('invoice_id', '=', inv.id)], context=context)
1570+ self.write(cr, uid, awil_ids, {'fb_id': fb_id}, context=context)
1571 return True
1572-
1573
1574=== modified file 'l10n_ve_fiscal_book/wizard/__init__.py'
1575--- l10n_ve_fiscal_book/wizard/__init__.py 2014-09-19 14:57:59 +0000
1576+++ l10n_ve_fiscal_book/wizard/__init__.py 2014-10-11 00:06:17 +0000
1577@@ -3,7 +3,7 @@
1578 #
1579 # Copyright (c) 2010 Vauxoo C.A. (http://openerp.com.ve/) All Rights Reserved.
1580 # Javier Duran <javier@vauxoo.com>
1581-#
1582+#
1583 #
1584 # WARNING: This program as such is intended to be used by professional
1585 # programmers who take the whole responsability of assessing all potential
1586@@ -28,5 +28,5 @@
1587 #
1588 ##############################################################################
1589
1590-import fiscal_book_wizard
1591-import change_invoice_sin_cred
1592+from . import fiscal_book_wizard
1593+from . import change_invoice_sin_cred
1594
1595=== modified file 'l10n_ve_fiscal_book/wizard/change_invoice_sin_cred.py'
1596--- l10n_ve_fiscal_book/wizard/change_invoice_sin_cred.py 2014-09-19 16:14:51 +0000
1597+++ l10n_ve_fiscal_book/wizard/change_invoice_sin_cred.py 2014-10-11 00:06:17 +0000
1598@@ -25,7 +25,6 @@
1599
1600 from openerp.osv import osv, fields
1601 from openerp.tools.translate import _
1602-import decimal_precision as dp
1603
1604
1605 class change_invoice_sin_credwizard(osv.TransientModel):
1606@@ -47,7 +46,7 @@
1607 def set_sin_cred(self, cr, uid, ids, context=None):
1608 """
1609 Change the sin cred field in the invoice
1610- @return
1611+ @return
1612 """
1613 context = context or {}
1614 ids = isinstance(ids, (int, long)) and [ids] or ids
1615
1616=== modified file 'l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py'
1617--- l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py 2014-10-07 22:02:14 +0000
1618+++ l10n_ve_fiscal_book/wizard/fiscal_book_wizard.py 2014-10-11 00:06:17 +0000
1619@@ -25,14 +25,13 @@
1620 # along with this program; if not, write to the Free Software
1621 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1622 ###############################################################################
1623-from openerp.osv import osv
1624-from openerp.osv import fields
1625-import sys
1626+from openerp.osv import osv, fields
1627 from openerp.tools.translate import _
1628 import time
1629
1630
1631 class fiscal_book_wizard(osv.osv_memory):
1632+
1633 """
1634 Sales book wizard implemented using the osv_memory wizard system
1635 """
1636@@ -44,7 +43,7 @@
1637 ids = self.pool.get('account.period').search(
1638 cr, uid, [('date_start', '<=', dt), ('date_stop', '>=', dt)])
1639 if not ids:
1640- raise osv.except_osv(_('Error !'), _('No period defined for this' \
1641+ raise osv.except_osv(_('Error !'), _('No period defined for this'
1642 ' date !\nPlease create a fiscal year.'))
1643 return ids
1644
1645@@ -88,7 +87,7 @@
1646 invoice = [i for i in inv_browse if i.nro_ctrl == control][0]
1647 amount = (invoice.amount_tax * invoice.p_ret) / 100
1648 rp_obj = self.pool.get('res.partner')
1649- rp_brw = rp_obj._find_accounting_partner(invoice.partner_id).id,
1650+ rp_brw = rp_obj._find_accounting_partner(invoice.partner_id).id,
1651 return (invoice.date_invoice,
1652 invoice.date_document,
1653 rp_brw.vat,
1654@@ -151,17 +150,17 @@
1655
1656 fiscal_book_obj = self.pool.get('fiscal.book')
1657 fiscal_book_o = fiscal_book_obj.search(cr, uid, [('id', '=', context['active_id'])])
1658- fiscal_book_o = fiscal_book_obj.browse(cr, uid, fiscal_book_o[0])
1659+ fiscal_book_o = fiscal_book_obj.browse(cr, uid, fiscal_book_o[0])
1660 res = super(fiscal_book_wizard, self).default_get(cr, uid, fields, context=context)
1661 res.update({'type': fiscal_book_o.type})
1662 res.update({'date_start': fiscal_book_o.period_id and fiscal_book_o.period_id.date_start or ''})
1663 res.update({'date_end': fiscal_book_o.period_id and fiscal_book_o.period_id.date_stop or ''})
1664 if fiscal_book_o.fortnight == 'first':
1665- date_obj = time.strptime(fiscal_book_o.period_id.date_stop,'%Y-%m-%d')
1666- res.update({'date_end': "%0004d-%02d-15"%(date_obj.tm_year, date_obj.tm_mon)})
1667+ date_obj = time.strptime(fiscal_book_o.period_id.date_stop, '%Y-%m-%d')
1668+ res.update({'date_end': "%0004d-%02d-15" % (date_obj.tm_year, date_obj.tm_mon)})
1669 elif fiscal_book_o.fortnight == 'second':
1670- date_obj = time.strptime(fiscal_book_o.period_id.date_start,'%Y-%m-%d')
1671- res.update({'date_start': "%0004d-%02d-16"%(date_obj.tm_year, date_obj.tm_mon)})
1672+ date_obj = time.strptime(fiscal_book_o.period_id.date_start, '%Y-%m-%d')
1673+ res.update({'date_start': "%0004d-%02d-16" % (date_obj.tm_year, date_obj.tm_mon)})
1674 return res
1675
1676 def check_report(self, cr, uid, ids, context=None):
1677@@ -190,14 +189,12 @@
1678 "control_start": fields.integer("Control Start"),
1679 "control_end": fields.integer("Control End"),
1680 "type": fields.selection([
1681- ("sale", _("Sale")),
1682- ("purchase", _("Purchase")),
1683+ ("sale", _("Sale")),
1684+ ("purchase", _("Purchase")),
1685 ], "Type", required=True,
1686 ),
1687 }
1688
1689-
1690-
1691 _defaults = {
1692 'date_start': lambda *a: time.strftime('%Y-%m-%d'),
1693 'date_end': lambda *a: time.strftime('%Y-%m-%d'),
1694
1695=== modified file 'l10n_ve_fiscal_requirements/__init__.py'
1696--- l10n_ve_fiscal_requirements/__init__.py 2012-11-29 21:05:06 +0000
1697+++ l10n_ve_fiscal_requirements/__init__.py 2014-10-11 00:06:17 +0000
1698@@ -5,7 +5,7 @@
1699 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
1700 # All Rights Reserved
1701 ###############Credits######################################################
1702-# Coded by: Vauxoo C.A.
1703+# Coded by: Vauxoo C.A.
1704 # Planified by: Nhomar Hernandez
1705 # Audited by: Vauxoo C.A.
1706 #############################################################################
1707@@ -22,6 +22,6 @@
1708 # You should have received a copy of the GNU Affero General Public License
1709 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1710 ################################################################################
1711-import model
1712-import wizard
1713+from . import model
1714+from . import wizard
1715 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1716
1717=== modified file 'l10n_ve_fiscal_requirements/__openerp__.py'
1718--- l10n_ve_fiscal_requirements/__openerp__.py 2014-04-21 20:00:21 +0000
1719+++ l10n_ve_fiscal_requirements/__openerp__.py 2014-10-11 00:06:17 +0000
1720@@ -5,7 +5,7 @@
1721 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
1722 # All Rights Reserved
1723 ###############Credits######################################################
1724-# Coded by: Vauxoo C.A.
1725+# Coded by: Vauxoo C.A.
1726 # Planified by: Nhomar Hernandez
1727 # Audited by: Vauxoo C.A.
1728 #############################################################################
1729@@ -50,7 +50,7 @@
1730 create the corresponding journal and account.
1731 TODO : Include this on wizard configuration.
1732
1733-If you install this module with invoice data on the database, the concept_id will be
1734+If you install this module with invoice data on the database, the concept_id will be
1735 Empty for all those invoices, so, when you try to modify them you have to add a value on
1736 that field
1737
1738@@ -65,7 +65,7 @@
1739 * Addons-vauxoo: lp:addons-vauxoo/7.0
1740 """,
1741 "depends" : [
1742- "account",
1743+ "account",
1744 "base_vat",
1745 "account_accountant",
1746 "account_voucher",
1747
1748=== modified file 'l10n_ve_fiscal_requirements/installer.py'
1749--- l10n_ve_fiscal_requirements/installer.py 2013-02-13 19:39:18 +0000
1750+++ l10n_ve_fiscal_requirements/installer.py 2014-10-11 00:06:17 +0000
1751@@ -5,7 +5,7 @@
1752 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
1753 # All Rights Reserved
1754 ###############Credits######################################################
1755-# Coded by: Vauxoo C.A.
1756+# Coded by: Vauxoo C.A.
1757 # Planified by: Nhomar Hernandez
1758 # Audited by: Vauxoo C.A.
1759 #############################################################################
1760@@ -23,45 +23,46 @@
1761 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1762 ################################################################################
1763 from openerp.osv import osv, fields
1764-from openerp.tools.translate import _
1765+
1766
1767 class fiscal_requirements_config(osv.osv_memory):
1768+
1769 """
1770 Fiscal Requirements installer wizard
1771 """
1772 _name = 'fiscal.requirements.config'
1773 _inherit = 'res.config'
1774- _description= __doc__
1775+ _description = __doc__
1776
1777 def onchange_update_rif(self, cr, uid, ids, vat):
1778 context = {'exec_wizard': True, 'vat': vat}
1779-
1780+
1781 partner_info = self.pool.get('seniat.url').update_rif(cr, uid, ids, context)
1782 v = {'name': partner_info.get('name'), 'vat_subjected': partner_info.get('vat_subjected')}
1783 return {'value': v}
1784
1785 def execute(self, cr, uid, ids, context=None):
1786 '''
1787- In this method I will configure all needs for work out of the box with
1788+ In this method I will configure all needs for work out of the box with
1789 fiscal requirement and Venezuela Laws
1790 and update all your partners information.
1791 '''
1792 wiz_data = self.browse(cr, uid, ids[0])
1793 partner = self.pool.get('res.users').browse(cr, uid, uid).company_id.partner_id
1794- #Data on res partner address - Invoice
1795- partner and partner.type == 'invoice' and self.pool.get('res.partner').write(cr, uid,[partner.id], {
1796- 'street':wiz_data.add,
1797- 'country_id':self.pool.get("res.country").search(cr,uid,[('code','=','VE')])[0],
1798- 'name': wiz_data.name,
1799- 'vat': "VE%s" % wiz_data.vat.upper(),
1800- 'vat_subjected': wiz_data.vat_subjected,
1801-
1802- })
1803+ # Data on res partner address - Invoice
1804+ partner and partner.type == 'invoice' and self.pool.get('res.partner').write(cr, uid, [partner.id], {
1805+ 'street': wiz_data.add,
1806+ 'country_id': self.pool.get("res.country").search(cr, uid, [('code', '=', 'VE')])[0],
1807+ 'name': wiz_data.name,
1808+ 'vat': "VE%s" % wiz_data.vat.upper(),
1809+ 'vat_subjected': wiz_data.vat_subjected,
1810+
1811+ })
1812
1813 _columns = {
1814 'vat': fields.char('VAT', 16, required=True, help='Partner\'s VAT to update the other fields'),
1815 'name': fields.char('Name', 64, help="The commercial name of the company"),
1816- 'add':fields.char('Invoice Address',64,help='Put Here the address declared on your VAT information on SENIAT',required=True),
1817+ 'add': fields.char('Invoice Address', 64, help='Put Here the address declared on your VAT information on SENIAT', required=True),
1818 'vat_subjected': fields.boolean("Apply VAT?"),
1819 }
1820 fiscal_requirements_config()
1821
1822=== modified file 'l10n_ve_fiscal_requirements/model/__init__.py'
1823--- l10n_ve_fiscal_requirements/model/__init__.py 2013-04-26 08:34:02 +0000
1824+++ l10n_ve_fiscal_requirements/model/__init__.py 2014-10-11 00:06:17 +0000
1825@@ -5,7 +5,7 @@
1826 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
1827 # All Rights Reserved
1828 ###############Credits######################################################
1829-# Coded by: Vauxoo C.A.
1830+# Coded by: Vauxoo C.A.
1831 # Planified by: Nhomar Hernandez
1832 # Audited by: Vauxoo C.A.
1833 #############################################################################
1834@@ -22,12 +22,12 @@
1835 # You should have received a copy of the GNU Affero General Public License
1836 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1837 ################################################################################
1838-import res_company
1839-import account
1840-import partner
1841-import invoice
1842-import res_users
1843-import seniat_url
1844-import l10n_ut
1845-import account_tax
1846+from . import res_company
1847+from . import account
1848+from . import partner
1849+from . import invoice
1850+from . import res_users
1851+from . import seniat_url
1852+from . import l10n_ut
1853+from . import account_tax
1854 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1855
1856=== modified file 'l10n_ve_fiscal_requirements/model/account.py'
1857--- l10n_ve_fiscal_requirements/model/account.py 2013-11-17 22:53:12 +0000
1858+++ l10n_ve_fiscal_requirements/model/account.py 2014-10-11 00:06:17 +0000
1859@@ -5,7 +5,7 @@
1860 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
1861 # All Rights Reserved
1862 ###############Credits######################################################
1863-# Coded by: Vauxoo C.A.
1864+# Coded by: Vauxoo C.A.
1865 # Planified by: Nhomar Hernandez
1866 # Audited by: Vauxoo C.A.
1867 #############################################################################
1868@@ -25,20 +25,21 @@
1869
1870 from openerp.osv import fields, osv
1871
1872+
1873 class account_journal(osv.osv):
1874 _inherit = 'account.journal'
1875
1876 _columns = {
1877-'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'),
1878- ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'),
1879- ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'),
1880- ('situation', 'Opening/Closing Situation'),('sale_debit', 'Sale Debit'),
1881- ('purchase_debit', 'Purchase Debit')], 'Type', size=32, required=True,
1882- help = "Select 'Sale' for customer invoices journals."\
1883- " Select 'Purchase' for supplier invoices journals."\
1884- " Select 'Cash' or 'Bank' for journals that are used in customer or supplier payments."\
1885- " Select 'General' for miscellaneous operations journals."\
1886- " Select 'Opening/Closing Situation' for entries generated for new fiscal years."\
1887- " Select 'Sale Debit' for customer debit note journals."\
1888- " Select 'Purchase Debit' for supplier debit note journals.")
1889- }
1890+ 'type': fields.selection([('sale', 'Sale'), ('sale_refund', 'Sale Refund'),
1891+ ('purchase', 'Purchase'), ('purchase_refund', 'Purchase Refund'),
1892+ ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'),
1893+ ('situation', 'Opening/Closing Situation'), ('sale_debit', 'Sale Debit'),
1894+ ('purchase_debit', 'Purchase Debit')], 'Type', size=32, required=True,
1895+ help="Select 'Sale' for customer invoices journals."
1896+ " Select 'Purchase' for supplier invoices journals."
1897+ " Select 'Cash' or 'Bank' for journals that are used in customer or supplier payments."
1898+ " Select 'General' for miscellaneous operations journals."
1899+ " Select 'Opening/Closing Situation' for entries generated for new fiscal years."
1900+ " Select 'Sale Debit' for customer debit note journals."
1901+ " Select 'Purchase Debit' for supplier debit note journals.")
1902+ }
1903
1904=== modified file 'l10n_ve_fiscal_requirements/model/account_tax.py'
1905--- l10n_ve_fiscal_requirements/model/account_tax.py 2013-11-21 04:33:16 +0000
1906+++ l10n_ve_fiscal_requirements/model/account_tax.py 2014-10-11 00:06:17 +0000
1907@@ -5,7 +5,7 @@
1908 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
1909 # All Rights Reserved
1910 ###############Credits######################################################
1911-# Coded by: Vauxoo C.A.
1912+# Coded by: Vauxoo C.A.
1913 # Planified by: Nhomar Hernandez
1914 # Audited by: Vauxoo C.A.
1915 #############################################################################
1916@@ -30,12 +30,12 @@
1917 _inherit = 'account.tax'
1918 _columns = {
1919 'appl_type': fields.selection(
1920- [('exento', 'Exempt'),
1921- ('sdcf', 'Not entitled to tax credit'),
1922+ [('exento', 'Exempt'),
1923+ ('sdcf', 'Not entitled to tax credit'),
1924 ('general', 'General Aliquot'),
1925 ('reducido', 'Reducted Aliquot'),
1926- ('adicional', 'General Aliquot + Additional')],
1927- 'Aliquot Type',
1928- required=False,
1929- help='Specify the aliquote type for the tax so it can be processed accrordly when the sale/purchase book is generatred'),
1930- }
1931+ ('adicional', 'General Aliquot + Additional')],
1932+ 'Aliquot Type',
1933+ required=False,
1934+ help='Specify the aliquote type for the tax so it can be processed accrordly when the sale/purchase book is generatred'),
1935+ }
1936
1937=== modified file 'l10n_ve_fiscal_requirements/model/invoice.py'
1938--- l10n_ve_fiscal_requirements/model/invoice.py 2014-09-19 16:34:33 +0000
1939+++ l10n_ve_fiscal_requirements/model/invoice.py 2014-10-11 00:06:17 +0000
1940@@ -5,7 +5,7 @@
1941 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
1942 # All Rights Reserved
1943 ###############Credits######################################################
1944-# Coded by: Vauxoo C.A.
1945+# Coded by: Vauxoo C.A.
1946 # Planified by: Nhomar Hernandez
1947 # Audited by: Vauxoo C.A.
1948 #############################################################################
1949@@ -25,45 +25,49 @@
1950
1951 from openerp.osv import fields, osv
1952 from openerp.tools.translate import _
1953+
1954+
1955 class account_invoice(osv.osv):
1956
1957 def _get_journal(self, cr, uid, context=None):
1958- """ Return the journal which is
1959+ """ Return the journal which is
1960 used in the current user's company, otherwise
1961 it does not exist, return false
1962 """
1963-
1964+
1965 context = context or {}
1966 res = super(account_invoice, self)._get_journal(cr, uid, context=context)
1967- if res: return res
1968+ if res:
1969+ return res
1970 type_inv = context.get('type', 'sale')
1971 if type_inv in ('sale_debit', 'purchase_debit'):
1972 user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
1973 company_id = context.get('company_id', user.company_id.id)
1974 journal_obj = self.pool.get('account.journal')
1975- domain = [('company_id', '=', company_id),('type', '=',type_inv)]
1976+ domain = [('company_id', '=', company_id), ('type', '=', type_inv)]
1977 res = journal_obj.search(cr, uid, domain, limit=1)
1978 return res and res[0] or False
1979
1980 def _unique_invoice_per_partner(self, cr, uid, ids, context=None):
1981- """ Return false when it is found
1982+ """ Return false when it is found
1983 that the bill is not out_invoice or out_refund,
1984 and it is not unique to the partner.
1985 """
1986-
1987- if context is None: context={}
1988+
1989+ if context is None:
1990+ context = {}
1991 inv_brw = self.browse(cr, uid, ids, context=context)
1992 ids_ivo = []
1993 for inv in inv_brw:
1994 ids_ivo.append(inv.id)
1995- if inv.type in ('out_invoice','out_refund'):
1996+ if inv.type in ('out_invoice', 'out_refund'):
1997 return True
1998- inv_ids = inv.nro_ctrl is not '' and inv.nro_ctrl is not False and inv.supplier_invoice_number is not False and self.search(cr,uid,
1999- ['|',('nro_ctrl','=',inv.nro_ctrl and inv.nro_ctrl.strip() ),('supplier_invoice_number','=',inv.supplier_invoice_number and inv.supplier_invoice_number.strip()),
2000- ('type','=',inv.type),
2001- ('partner_id','=',inv.partner_id.id)],
2002- context=context) or []
2003- if [True for i in inv_ids if i not in ids_ivo ] and inv_ids:
2004+ inv_ids = inv.nro_ctrl is not '' and inv.nro_ctrl is not False and inv.supplier_invoice_number is not False and self.search(cr, uid,
2005+ ['|', ('nro_ctrl', '=', inv.nro_ctrl and inv.nro_ctrl.strip()), ('supplier_invoice_number', '=', inv.supplier_invoice_number and inv.supplier_invoice_number.strip()),
2006+ ('type', '=', inv.type),
2007+ ('partner_id', '=', inv.partner_id.id)],
2008+ context=context) or []
2009+ if [True for i in inv_ids if i not in ids_ivo] and inv_ids:
2010 return False
2011 return True
2012
2013@@ -73,36 +77,35 @@
2014 """
2015 context = context or {}
2016 res = True
2017- ru_brw = self.pool.get('res.users').browse(cr,uid,uid,context=context)
2018+ ru_brw = self.pool.get('res.users').browse(cr, uid, uid, context=context)
2019 rc_obj = self.pool.get('res.company')
2020 rc_brw = rc_obj.browse(cr, uid, ru_brw.company_id.id, context=context)
2021-
2022+
2023 if rc_brw.country_id and rc_brw.country_id.code == 'VE' and rc_brw.printer_fiscal:
2024 res = False
2025 return res
2026
2027 _inherit = 'account.invoice'
2028 _columns = {
2029- 'nro_ctrl': fields.char('Control Number', size=32, readonly=True, states={'draft':[('readonly',False)]}, help="Number used to manage pre-printed invoices, by law you will need to put here this number to be able to declarate on Fiscal reports correctly."),
2030+ 'nro_ctrl': fields.char('Control Number', size=32, readonly=True, states={'draft': [('readonly', False)]}, help="Number used to manage pre-printed invoices, by law you will need to put here this number to be able to declarate on Fiscal reports correctly."),
2031 'sin_cred': fields.boolean('Exclude this document from fiscal book',
2032 readonly=False,
2033 help="Set it true if the invoice is VAT excempt (Tax Exempt)"),
2034- 'date_document': fields.date("Document Date", states={'draft':[('readonly',False)]}, help="Administrative date, generally is the date printed on invoice, this date is used to show in the Purchase Fiscal book", select=True),
2035- 'invoice_printer' : fields.char('Fiscal printer invoice number', size=64, required=False,help="Fiscal printer invoice number, is the number of the invoice on the fiscal printer"),
2036- #TODO": maybe it must be a many2one to declared FiscalPrinter when FiscalV is ready
2037- 'fiscal_printer' : fields.char('Fiscal printer number', size=64, required=False,help="Fiscal printer number, generally is the id number of the printer."),
2038- 'loc_req':fields.boolean('Required by Localization', help='This fields is for technical use'),
2039+ 'date_document': fields.date("Document Date", states={'draft': [('readonly', False)]}, help="Administrative date, generally is the date printed on invoice, this date is used to show in the Purchase Fiscal book", select=True),
2040+ 'invoice_printer': fields.char('Fiscal printer invoice number', size=64, required=False, help="Fiscal printer invoice number, is the number of the invoice on the fiscal printer"),
2041+ # TODO": maybe it must be a many2one to declared FiscalPrinter when FiscalV is ready
2042+ 'fiscal_printer': fields.char('Fiscal printer number', size=64, required=False, help="Fiscal printer number, generally is the id number of the printer."),
2043+ 'loc_req': fields.boolean('Required by Localization', help='This fields is for technical use'),
2044 'z_report': fields.char(string='Report Z', size=64, help=""),
2045 }
2046
2047- _defaults ={
2048+ _defaults = {
2049 'loc_req': _get_loc_req
2050- }
2051-
2052+ }
2053
2054 _constraints = [
2055- (_unique_invoice_per_partner, _('The Document you have been entering for this Partner has already been recorded'),['Control Number (nro_ctrl)','Reference (reference)']),
2056- ]
2057+ (_unique_invoice_per_partner, _('The Document you have been entering for this Partner has already been recorded'), ['Control Number (nro_ctrl)', 'Reference (reference)']),
2058+ ]
2059
2060 def copy(self, cr, uid, id, default={}, context=None):
2061 """ Allows you to duplicate a record,
2062@@ -112,33 +115,34 @@
2063 if context is None:
2064 context = {}
2065 default.update({
2066- 'nro_ctrl':None,
2067- 'supplier_invoice_number':None,
2068+ 'nro_ctrl': None,
2069+ 'supplier_invoice_number': None,
2070 'sin_cred': False,
2071 # No cleaned in this copy because it is related to the previous
2072 # document, if previous document says so this too
2073 'date_document': False,
2074- 'invoice_printer' : '',
2075- 'fiscal_printer' : '',
2076+ 'invoice_printer': '',
2077+ 'fiscal_printer': '',
2078 # No cleaned in this copy because it is related to the previous
2079 # document, if previous document says so this too
2080- #'loc_req':False,
2081+ #'loc_req':False,
2082 'z_report': '',
2083 })
2084 return super(account_invoice, self).copy(cr, uid, id, default, context)
2085
2086 def write(self, cr, uid, ids, vals, context=None):
2087 context = context or {}
2088- if vals.get('type') in ('out_invoice','out_refund') and \
2089- vals.get('date_invoice') and not vals.get('date_document'):
2090- vals['date_document']=vals['date_invoice']
2091+ if vals.get('type') in ('out_invoice', 'out_refund') and \
2092+ vals.get('date_invoice') and not vals.get('date_document'):
2093+ vals['date_document'] = vals['date_invoice']
2094 return super(account_invoice, self).write(cr, uid, ids, vals,
2095- context=context)
2096+ context=context)
2097+
2098
2099 class account_invoice_tax(osv.osv):
2100 _inherit = 'account.invoice.tax'
2101 _columns = {
2102- 'tax_id': fields.many2one('account.tax', 'Tax', required=False, ondelete='set null',
2103+ 'tax_id': fields.many2one('account.tax', 'Tax', required=False, ondelete='set null',
2104 help="Tax relation to original tax, to be able to take off all data from invoices."),
2105 }
2106
2107
2108=== modified file 'l10n_ve_fiscal_requirements/model/l10n_ut.py'
2109--- l10n_ve_fiscal_requirements/model/l10n_ut.py 2014-09-24 04:18:40 +0000
2110+++ l10n_ve_fiscal_requirements/model/l10n_ut.py 2014-10-11 00:06:17 +0000
2111@@ -24,8 +24,6 @@
2112 # along with this program. If not, see <http://www.gnu.org/licenses/>.
2113 ##############################################################################
2114 from openerp.osv import osv, fields
2115-from openerp.tools import config
2116-from openerp.tools.translate import _
2117 import time
2118 from openerp.addons import decimal_precision as dp
2119
2120@@ -46,7 +44,7 @@
2121 help="Amount of the tax unit in bs", required=True),
2122 'user_id': fields.many2one('res.users', 'Salesman',
2123 readonly=True, states={'draft': [('readonly', False)]},
2124- help="Vendor user"),
2125+ help="Vendor user"),
2126 }
2127 _defaults = {
2128 'name': lambda *a: None,
2129
2130=== modified file 'l10n_ve_fiscal_requirements/model/partner.py'
2131--- l10n_ve_fiscal_requirements/model/partner.py 2014-09-04 19:22:17 +0000
2132+++ l10n_ve_fiscal_requirements/model/partner.py 2014-10-11 00:06:17 +0000
2133@@ -1,12 +1,12 @@
2134 # -*- coding: utf-8 -*-
2135 ##############################################################################
2136 #
2137-#
2138+#
2139 # Programmed by: Alexander Olivares <olivaresa@gmail.com>
2140 #
2141-# This the script to connect with Seniat website
2142+# This the script to connect with Seniat website
2143 # for consult the rif asociated with a partner was taken from:
2144-#
2145+#
2146 # http://siv.cenditel.gob.ve/svn/sigesic/ramas/sigesic-1.1.x/sigesic/apps/comun/seniat.py
2147 #
2148 # This script was modify by:
2149@@ -38,6 +38,7 @@
2150 from openerp.addons import decimal_precision as dp
2151 import re
2152
2153+
2154 class res_partner(osv.osv):
2155 _inherit = 'res.partner'
2156
2157@@ -47,14 +48,14 @@
2158 context = context or {}
2159 user_company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
2160 return user_company.partner_id and user_company.partner_id.country_id \
2161- and user_company.partner_id.country_id.code or 'XX'
2162+ and user_company.partner_id.country_id.code or 'XX'
2163
2164 def default_get(self, cr, uid, fields, context=None):
2165 """ Load the country code of the user company to form to be created.
2166 """
2167 context = context or {}
2168 res = super(res_partner, self).default_get(cr, uid, fields, context=context)
2169- res.update({'uid_country': self._get_country_code(cr,uid,context=context)})
2170+ res.update({'uid_country': self._get_country_code(cr, uid, context=context)})
2171 return res
2172
2173 def _get_uid_country(self, cr, uid, ids, field_name, args, context=None):
2174@@ -62,9 +63,9 @@
2175 of the user company.
2176 """
2177 context = context or {}
2178- res= {}.fromkeys(ids,self._get_country_code(cr,uid,context=context))
2179+ res = {}.fromkeys(ids, self._get_country_code(cr, uid, context=context))
2180 return res
2181-
2182+
2183 _columns = {
2184 'seniat_updated': fields.boolean('Seniat Updated', help="This field indicates if partner was updated using SENIAT button"),
2185 'uid_country': fields.function(_get_uid_country, type='char', string="uid_country", size=20, help="country code of the current company"),
2186@@ -72,57 +73,59 @@
2187 string='Rate',
2188 digits_compute=dp.get_precision('Withhold'),
2189 help="Vat Withholding rate"),
2190- 'wh_iva_agent': fields.boolean('Wh. Agent',
2191+ 'wh_iva_agent': fields.boolean('Wh. Agent',
2192 help="Indicate if the partner is a withholding vat agent"),
2193 }
2194-
2195+
2196 _default = {
2197 'seniat_updated': False,
2198 }
2199
2200- def name_search(self,cr,uid,name='',args=[],operator='ilike',context=None,limit=80):
2201+ def name_search(self, cr, uid, name='', args=[], operator='ilike', context=None, limit=80):
2202 """ Gets el id of the partner with the vat or the name and return the name
2203 """
2204- if context is None:
2205- context={}
2206- ids= []
2207+ if context is None:
2208+ context = {}
2209+ ids = []
2210 if len(name) >= 2:
2211- ids = self.search(cr, uid, [('vat',operator,name)] + args, limit=limit, context=context)
2212+ ids = self.search(cr, uid, [('vat', operator, name)] + args, limit=limit, context=context)
2213 if not ids:
2214- ids = self.search(cr,uid,[('name',operator,name)] + args, limit=limit, context=context)
2215- return self.name_get(cr,uid,ids,context=context)
2216-
2217+ ids = self.search(cr, uid, [('name', operator, name)] + args, limit=limit, context=context)
2218+ return self.name_get(cr, uid, ids, context=context)
2219+
2220 '''
2221 Required Invoice Address
2222 '''
2223- def _check_partner_invoice_addr(self,cr,uid,ids,context={}):
2224+
2225+ def _check_partner_invoice_addr(self, cr, uid, ids, context={}):
2226 """ Return true if the partner is a company of Venezuela and if the
2227 address is for billing.
2228 """
2229- partner_obj = self.browse(cr,uid,ids[0])
2230+ partner_obj = self.browse(cr, uid, ids[0])
2231 if partner_obj.vat and partner_obj.vat[:2].upper() == 'VE' and not partner_obj.parent_id:
2232- res = partner_obj.type == 'invoice'
2233- if res:
2234- return True
2235- else:
2236- return False
2237- else:
2238+ res = partner_obj.type == 'invoice'
2239+ if res:
2240 return True
2241+ else:
2242+ return False
2243+ else:
2244+ return True
2245 return True
2246
2247 def _check_vat_uniqueness(self, cr, uid, ids, context=None):
2248 """ Check that the vat is unique in the level where the partner in the tree
2249 """
2250- if context is None: context = {}
2251-
2252+ if context is None:
2253+ context = {}
2254+
2255 user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id
2256 acc_part_brw = self._find_accounting_partner(user_company.partner_id)
2257-
2258- #User must be of VE
2259+
2260+ # User must be of VE
2261 if acc_part_brw.country_id and acc_part_brw.country_id.code != 'VE':
2262 return True
2263-
2264- for rp_brw in self.browse(cr, uid,ids):
2265+
2266+ for rp_brw in self.browse(cr, uid, ids):
2267 acc_part_brw = self._find_accounting_partner(rp_brw)
2268 if acc_part_brw.country_id and acc_part_brw.country_id.code != 'VE':
2269 continue
2270@@ -131,39 +134,41 @@
2271 if rp_brw.id == acc_part_brw.id and not acc_part_brw.vat:
2272 return False
2273 elif rp_brw.id == acc_part_brw.id and acc_part_brw.vat:
2274- duplicates = self.search(cr, uid, [ ('vat', '=', rp_brw.vat), ('parent_id','=',False), ('id','!=',rp_brw.id) ])
2275- if duplicates: return False
2276+ duplicates = self.search(cr, uid, [('vat', '=', rp_brw.vat), ('parent_id', '=', False), ('id', '!=', rp_brw.id)])
2277+ if duplicates:
2278+ return False
2279 continue
2280- return True
2281+ return True
2282
2283 def _check_vat_mandatory(self, cr, uid, ids, context=None):
2284 """ This method will check the vat mandatoriness in partners
2285 for those user logged on with a Venezuelan Company
2286-
2287+
2288 The method will return True when:
2289 *) The user's company is not from Venezuela
2290 *) The partner being created is the one for the a company being created [TODO]
2291-
2292+
2293 The method will return False when:
2294 *) The user's company is from Venezuela AND the vat field is empty AND:
2295 +) partner is_company=True AND parent_id is not NULL
2296- +) partner with parent_id is NULL
2297- +) partner with parent_id is NOT NULL AND type of address is invoice
2298+ +) partner with parent_id is NULL
2299+ +) partner with parent_id is NOT NULL AND type of address is invoice
2300 """
2301- if context is None: context = {}
2302+ if context is None:
2303+ context = {}
2304 # Avoiding Egg-Chicken Syndrome
2305 # TODO: Refine this approach this is big exception
2306 # One that can be handle by end user, I hope so!!!
2307- if context.get('create_company',False):
2308+ if context.get('create_company', False):
2309 return True
2310-
2311+
2312 user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id
2313 acc_part_brw = self._find_accounting_partner(user_company.partner_id)
2314- #Check if the user is not from a VE Company
2315+ # Check if the user is not from a VE Company
2316 if acc_part_brw.country_id and acc_part_brw.country_id.code != 'VE':
2317 return True
2318-
2319- for rp_brw in self.browse(cr, uid,ids):
2320+
2321+ for rp_brw in self.browse(cr, uid, ids):
2322 acc_part_brw = self._find_accounting_partner(rp_brw)
2323 if acc_part_brw.country_id and acc_part_brw.country_id.code != 'VE':
2324 continue
2325@@ -176,11 +181,11 @@
2326 def _validate(self, cr, uid, ids, context=None):
2327 """ Validates the fields
2328 """
2329-
2330- #In the original orm.py openerp does not allow using
2331- #context within the constraint because we have to yield
2332+
2333+ # In the original orm.py openerp does not allow using
2334+ # context within the constraint because we have to yield
2335 # the same result always,
2336- # we have overridden this behaviour
2337+ # we have overridden this behaviour
2338 # TO ALLOW PASSING CONTEXT TO THE RESTRICTION IN RES.PARTNER
2339 context = context or {}
2340 lng = context.get('lang')
2341@@ -203,7 +208,7 @@
2342 else:
2343 translated_msg = trans._get_source(cr, uid, self._name, 'constraint', lng, msg)
2344 error_msgs.append(
2345- _("Error occurred while validating the field(s) %s: %s") % (','.join(fields), translated_msg)
2346+ _("Error occurred while validating the field(s) %s: %s") % (','.join(fields), translated_msg)
2347 )
2348 self._invalids.update(fields)
2349 if error_msgs:
2350@@ -216,34 +221,34 @@
2351 (_check_vat_uniqueness, _("Error ! Partner's VAT must be a unique value or empty"), []),
2352 #~ (_check_partner_invoice_addr, _('Error ! The partner does not have an invoice address.'), []),
2353 ]
2354-
2355+
2356 def vat_change_fiscal_requirements(self, cr, uid, ids, value, context=None):
2357 """ Checks the syntax of the vat
2358 """
2359 if context is None:
2360- context={}
2361+ context = {}
2362 if not value:
2363- return super(res_partner,self).vat_change(cr, uid, ids, value, context=context)
2364+ return super(res_partner, self).vat_change(cr, uid, ids, value, context=context)
2365 res = self.search(cr, uid, [('vat', 'ilike', value)])
2366 if res:
2367- rp = self.browse(cr, uid, res[0],context=context)
2368- return {'warning': {
2369- 'title':_('Vat Error !'),
2370- 'message':_('The VAT [%s] looks like '%value +
2371- '[%s] which is'%rp.vat.upper()+
2372- ' already being used by: %s'%rp.name.upper())
2373- }
2374- }
2375+ rp = self.browse(cr, uid, res[0], context=context)
2376+ return {'warning': {
2377+ 'title': _('Vat Error !'),
2378+ 'message': _('The VAT [%s] looks like ' % value +
2379+ '[%s] which is' % rp.vat.upper() +
2380+ ' already being used by: %s' % rp.name.upper())
2381+ }
2382+ }
2383 else:
2384- return super(res_partner,self).vat_change(cr, uid, ids, value, context=context)
2385+ return super(res_partner, self).vat_change(cr, uid, ids, value, context=context)
2386
2387- def check_vat_ve(self, vat, context = None):
2388+ def check_vat_ve(self, vat, context=None):
2389 """ Check Venezuelan VAT number, locally called RIF.
2390 RIF: JXXXXXXXXX RIF VENEZOLAN IDENTIFICATION CARD: VXXXXXXXXX FOREIGN IDENTIFICATION CARD: EXXXXXXXXX
2391 """
2392
2393 if context is None:
2394- context={}
2395+ context = {}
2396 if re.search(r'^[VJEGP][0-9]{9}$', vat):
2397 return True
2398 if re.search(r'^([VE][0-9]{1,8}|[D][0-9]{9})$', vat):
2399@@ -255,10 +260,10 @@
2400 Validate against VAT Information Exchange System (VIES)
2401 """
2402 if country_code.upper() != "VE":
2403- return super(res_partner, self).vies_vat_check(cr, uid, country_code, vat_number,context=context)
2404+ return super(res_partner, self).vies_vat_check(cr, uid, country_code, vat_number, context=context)
2405 else:
2406 return super(res_partner, self).simple_vat_check(cr, uid, country_code, vat_number, context=context)
2407-
2408+
2409 def update_rif(self, cr, uid, ids, context=None):
2410 """ Load the rif and name of the partner from the database seniat
2411 """
2412@@ -268,11 +273,12 @@
2413 return su_obj.update_rif(cr, uid, ids, context=context)
2414
2415 def button_check_vat(self, cr, uid, ids, context=None):
2416- """ Is called by the button that load information of the partner from database
2417+ """ Is called by the button that load information of the partner from database
2418 SENIAT
2419 """
2420- if context is None: context = {}
2421- context.update({'update_fiscal_information':True})
2422+ if context is None:
2423+ context = {}
2424+ context.update({'update_fiscal_information': True})
2425 super(res_partner, self).check_vat(cr, uid, ids, context=context)
2426 user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id
2427 if user_company.vat_check_vies:
2428
2429=== modified file 'l10n_ve_fiscal_requirements/model/res_company.py'
2430--- l10n_ve_fiscal_requirements/model/res_company.py 2013-04-26 23:55:44 +0000
2431+++ l10n_ve_fiscal_requirements/model/res_company.py 2014-10-11 00:06:17 +0000
2432@@ -26,9 +26,6 @@
2433 ##############################################################################
2434
2435 from openerp.osv import fields, osv
2436-import openerp.tools
2437-from openerp.tools.translate import _
2438-from openerp.tools import config
2439
2440
2441 class res_company(osv.osv):
2442@@ -36,8 +33,8 @@
2443 _columns = {
2444 'jour_id': fields.many2one('account.journal', 'Journal', required=False, help="Default journal for damaged invoices"),
2445 'acc_id': fields.many2one('account.account', 'Account', required=False, help="Default account used for invoices and lines from damaged invoices"),
2446- 'printer_fiscal' : fields.boolean('Manages fiscal printer', help='Indicates that the company can operate a fiscal printer'),
2447- }
2448+ 'printer_fiscal': fields.boolean('Manages fiscal printer', help='Indicates that the company can operate a fiscal printer'),
2449+ }
2450
2451 def create(self, cr, uid, vals, context=None):
2452 """ To create a new record,
2453
2454=== modified file 'l10n_ve_fiscal_requirements/model/res_users.py'
2455--- l10n_ve_fiscal_requirements/model/res_users.py 2013-04-10 17:33:44 +0000
2456+++ l10n_ve_fiscal_requirements/model/res_users.py 2014-10-11 00:06:17 +0000
2457@@ -26,30 +26,29 @@
2458 # along with this program. If not, see <http://www.gnu.org/licenses/>.
2459 ##############################################################################
2460
2461-from openerp.osv import fields, osv
2462-import openerp.tools
2463-from openerp.tools.translate import _
2464-from openerp.tools import config
2465+from openerp.osv import osv
2466+
2467
2468 class res_users(osv.osv):
2469 _inherit = 'res.users'
2470-
2471+
2472 def create(self, cr, uid, vals, context=None):
2473 """ To create a new record,
2474- adds a Boolean field to true
2475+ adds a Boolean field to true
2476 indicates that the partner is a company
2477 """
2478- if context is None: context = {}
2479- context.update({'create_company':True})
2480+ if context is None:
2481+ context = {}
2482+ context.update({'create_company': True})
2483 return super(res_users, self).create(cr, uid, vals, context=context)
2484-
2485+
2486 def write(self, cr, uid, ids, values, context=None):
2487 """ To write a new record,
2488- adds a Boolean field to true
2489+ adds a Boolean field to true
2490 indicates that the partner is a company
2491 """
2492 context = context or {}
2493- context.update({'create_company':True})
2494+ context.update({'create_company': True})
2495 return super(res_users, self).write(cr, uid, ids, values, context=context)
2496
2497 res_users()
2498
2499=== modified file 'l10n_ve_fiscal_requirements/model/seniat_url.py'
2500--- l10n_ve_fiscal_requirements/model/seniat_url.py 2013-12-17 02:32:33 +0000
2501+++ l10n_ve_fiscal_requirements/model/seniat_url.py 2014-10-11 00:06:17 +0000
2502@@ -23,9 +23,7 @@
2503 ##########################################################################
2504
2505 from openerp.osv import fields, osv
2506-import openerp.tools
2507 from openerp.tools.translate import _
2508-from openerp.tools import config
2509 import urllib
2510 from xml.dom.minidom import parseString
2511 import re
2512@@ -33,6 +31,7 @@
2513
2514
2515 class seniat_url(osv.osv):
2516+
2517 """ OpenERP Model : seniat_url
2518 """
2519 _name = 'seniat.url'
2520@@ -54,32 +53,32 @@
2521 }
2522
2523 # Update Partner Information
2524-
2525- def _get_valid_digit(self, cr, uid,vat, context=None):
2526+
2527+ def _get_valid_digit(self, cr, uid, vat, context=None):
2528 '''
2529 @param vat: string
2530 returns validating digit
2531 '''
2532 divisor = 11
2533- vat_type = {'V':1, 'E':2, 'J':3, 'P':4, 'G':5}
2534- mapper = {1:3, 2:2, 3:7, 4:6, 5:5, 6:4, 7:3, 8:2}
2535+ vat_type = {'V': 1, 'E': 2, 'J': 3, 'P': 4, 'G': 5}
2536+ mapper = {1: 3, 2: 2, 3: 7, 4: 6, 5: 5, 6: 4, 7: 3, 8: 2}
2537 valid_digit = None
2538
2539 vat_type = vat_type.get(vat[0].upper())
2540 if vat_type:
2541 sum = vat_type * 4
2542 for i in range(8):
2543- sum += int(vat[i+1]) * mapper[i+1]
2544+ sum += int(vat[i + 1]) * mapper[i + 1]
2545
2546- valid_digit = divisor - sum%divisor
2547+ valid_digit = divisor - sum % divisor
2548 if valid_digit >= 10:
2549 valid_digit = 0
2550- return valid_digit
2551+ return valid_digit
2552
2553- def _validate_rif(self, cr, uid,vat, context=None):
2554- '''validates if the VE VAT NUMBER is right
2555+ def _validate_rif(self, cr, uid, vat, context=None):
2556+ '''validates if the VE VAT NUMBER is right
2557 @param vat: string: Vat number to Check
2558- returns vat when right otherwise returns False
2559+ returns vat when right otherwise returns False
2560
2561 '''
2562 if not vat:
2563@@ -89,17 +88,17 @@
2564 vat = vat[2:]
2565
2566 if re.search(r'^[VJEGP][0-9]{9}$', vat):
2567- valid_digit = self._get_valid_digit(cr, uid,vat,
2568+ valid_digit = self._get_valid_digit(cr, uid, vat,
2569 context=context)
2570 if valid_digit is None:
2571 return False
2572- if int(vat[9])==valid_digit:
2573+ if int(vat[9]) == valid_digit:
2574 return vat
2575 else:
2576 self._print_error(_('Vat Error !'), _('Invalid VAT!'))
2577 elif re.search(r'^([VE][0-9]{1,8})$', vat):
2578 vat = vat[0] + vat[1:].rjust(8, '0')
2579- valid_digit = self._get_valid_digit(cr, uid,vat,
2580+ valid_digit = self._get_valid_digit(cr, uid, vat,
2581 context=context)
2582 vat += str(valid_digit)
2583 return vat
2584@@ -119,7 +118,6 @@
2585 return r
2586 except:
2587 self.logger.warning("Url could not be loaded %s" % str_error)
2588- pass
2589 retries -= 1
2590 return str_error
2591
2592@@ -169,7 +167,7 @@
2593 else:
2594 return False
2595
2596- def _get_rif(self, cr, uid, vat, url1, url2, context=None):
2597+ def _get_rif(self, cr, uid, vat, url1, url2, context=None):
2598 """ Partner information transforms XML to string and returns.
2599 """
2600 if context is None:
2601@@ -179,7 +177,7 @@
2602 if not self._eval_seniat_data(xml_data, vat, context=context):
2603 dom = parseString(xml_data)
2604 return self._parse_dom(cr, uid, dom, vat, url2, context=context)
2605-
2606+
2607 def check_rif(self, cr, uid, vat, context=None):
2608 context = context or {}
2609 return self._dom_giver(cr, uid, vat, context=context)
2610@@ -195,13 +193,12 @@
2611 url_obj = self.browse(cr, uid, self.search(cr, uid, []))[0]
2612 url1 = url_obj.name + '%s'
2613 url2 = url_obj.url_seniat + '%s'
2614- url3 = url_obj.url_seniat2 + '%s'
2615- vat = self._validate_rif(cr, uid,vat,context=None)
2616+ vat = self._validate_rif(cr, uid, vat, context=None)
2617 if vat:
2618 return self._get_rif(cr, uid, vat, url1, url2, context=context)
2619 else:
2620 return False
2621-
2622+
2623 def _update_partner(self, cr, uid, id, context=None):
2624 """ Indicates that the partner was updated with information provided by seniat
2625 """
2626@@ -211,7 +208,6 @@
2627 def update_rif(self, cr, uid, ids, context={}):
2628 """ Updates the partner info if it have a vat
2629 """
2630- aux = []
2631 rp_obj = self.pool.get('res.partner')
2632 if context.get('exec_wizard'):
2633 res = self._dom_giver(cr, uid, context['vat'], context=context)
2634
2635=== modified file 'l10n_ve_fiscal_requirements/wizard/__init__.py'
2636--- l10n_ve_fiscal_requirements/wizard/__init__.py 2014-01-20 13:03:50 +0000
2637+++ l10n_ve_fiscal_requirements/wizard/__init__.py 2014-10-11 00:06:17 +0000
2638@@ -23,11 +23,11 @@
2639 # You should have received a copy of the GNU Affero General Public License
2640 # along with this program. If not, see <http://www.gnu.org/licenses/>.
2641 ##############################################################################
2642-import wizard_nro_ctrl
2643-import wizard_invoice_nro_ctrl
2644-import wizard_url_seniat
2645-import wizard_update_name
2646-import update_info_partner
2647-import account_invoice_refund
2648-import account_invoice_debit
2649-import search_info_partner_seniat
2650+from . import wizard_nro_ctrl
2651+from . import wizard_invoice_nro_ctrl
2652+from . import wizard_url_seniat
2653+from . import wizard_update_name
2654+from . import update_info_partner
2655+from . import account_invoice_refund
2656+from . import account_invoice_debit
2657+from . import search_info_partner_seniat
2658
2659=== modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py'
2660--- l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py 2013-05-10 17:56:25 +0000
2661+++ l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py 2014-10-11 00:06:17 +0000
2662@@ -25,6 +25,7 @@
2663 from openerp.tools.translate import _
2664 from openerp import netsvc
2665
2666+
2667 class account_invoice_debit(osv.osv_memory):
2668
2669 """Debits Note from Invoice"""
2670@@ -32,11 +33,11 @@
2671 _name = "account.invoice.debit"
2672 _description = "Invoice Debit Note"
2673 _columns = {
2674- 'date': fields.date('Operation date', help='This date will be used as the invoice date for Refund Invoice and Period will be chosen accordingly!'),
2675- 'period': fields.many2one('account.period', 'Force period', help='Fiscal period to assign to the invoice. Keep empty to use the period of the current date.'),
2676- 'journal_id': fields.many2one('account.journal', 'Debits Journal', help='You can select here the journal to use for the debit note that will be created. If you leave that field empty, it will use the same journal as the current invoice.'),
2677- 'description': fields.char('Description', size=128, required=True, help='Name or reference of the invoice'),
2678- 'comment': fields.text('Comment', required=True, help='Additional Information'),
2679+ 'date': fields.date('Operation date', help='This date will be used as the invoice date for Refund Invoice and Period will be chosen accordingly!'),
2680+ 'period': fields.many2one('account.period', 'Force period', help='Fiscal period to assign to the invoice. Keep empty to use the period of the current date.'),
2681+ 'journal_id': fields.many2one('account.journal', 'Debits Journal', help='You can select here the journal to use for the debit note that will be created. If you leave that field empty, it will use the same journal as the current invoice.'),
2682+ 'description': fields.char('Description', size=128, required=True, help='Name or reference of the invoice'),
2683+ 'comment': fields.text('Comment', required=True, help='Additional Information'),
2684 }
2685
2686 def _get_journal(self, cr, uid, context=None):
2687@@ -49,11 +50,11 @@
2688 company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
2689 company_id = context.get('company_id', company_id)
2690 if context.get('type', False) in ('out_invoice', 'out_refund'):
2691- journal = obj_journal.search(cr, uid, [('type', '=', 'sale_debit'),('company_id','=',company_id)])
2692+ journal = obj_journal.search(cr, uid, [('type', '=', 'sale_debit'), ('company_id', '=', company_id)])
2693 elif context.get('type', False) in ('in_invoice', 'in_refund'):
2694- journal = obj_journal.search(cr, uid, [('type', '=', 'purchase_debit'),('company_id','=',company_id)])
2695+ journal = obj_journal.search(cr, uid, [('type', '=', 'purchase_debit'), ('company_id', '=', company_id)])
2696 if not journal:
2697- raise osv.except_osv(_('No Debit Journal !'),_("You must define a debit journal"))
2698+ raise osv.except_osv(_('No Debit Journal !'), _("You must define a debit journal"))
2699 return journal[0]
2700
2701 _defaults = {
2702@@ -63,14 +64,14 @@
2703 }
2704
2705 def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
2706- """ Change fields position in the view
2707+ """ Change fields position in the view
2708 """
2709 if context is None:
2710 context = {}
2711-
2712+
2713 journal_obj = self.pool.get('account.journal')
2714- res = super(account_invoice_debit,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
2715- #Debit note only from customer o purchase invoice
2716+ res = super(account_invoice_debit, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
2717+ # Debit note only from customer o purchase invoice
2718 #type = context.get('journal_type', 'sale_refund')
2719 type = context.get('journal_type', 'sale')
2720 if type in ('sale', 'sale_refund'):
2721@@ -81,7 +82,7 @@
2722 company_id = context.get('company_id', company_id)
2723 for field in res['fields']:
2724 if field == 'journal_id':
2725- journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type),('company_id','=',company_id)], context=context, limit=None, name_get_uid=1)
2726+ journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type), ('company_id', '=', company_id)], context=context, limit=None, name_get_uid=1)
2727 res['fields'][field]['selection'] = journal_select
2728 return res
2729
2730@@ -93,7 +94,7 @@
2731 nro_ref = ref
2732 if inv.type == 'out_invoice':
2733 nro_ref = inv.number
2734- orig = 'FACT:' +(nro_ref or '') + '- DE FECHA:' + (inv.date_invoice or '') + (' TOTAL:' + str(inv.amount_total) or '')
2735+ orig = 'FACT:' + (nro_ref or '') + '- DE FECHA:' + (inv.date_invoice or '') + (' TOTAL:' + str(inv.amount_total) or '')
2736 return orig
2737
2738 def compute_debit(self, cr, uid, ids, context=None):
2739@@ -103,29 +104,23 @@
2740 @param ids: The account invoice refund’s ID or list of IDs
2741 """
2742 inv_obj = self.pool.get('account.invoice')
2743- reconcile_obj = self.pool.get('account.move.reconcile')
2744- account_m_line_obj = self.pool.get('account.move.line')
2745 mod_obj = self.pool.get('ir.model.data')
2746 act_obj = self.pool.get('ir.actions.act_window')
2747- wf_service = netsvc.LocalService('workflow')
2748- inv_tax_obj = self.pool.get('account.invoice.tax')
2749- inv_line_obj = self.pool.get('account.invoice.line')
2750- res_users_obj = self.pool.get('res.users')
2751 if context is None:
2752 context = {}
2753
2754- form = self.browse(cr, uid, ids[0], context = context)
2755+ form = self.browse(cr, uid, ids[0], context=context)
2756 created_inv = []
2757 date = False
2758 period = False
2759 description = False
2760
2761- journal_id = form.journal_id and form.journal_id.id or False
2762+ journal_id = form.journal_id and form.journal_id.id or False
2763 inv = inv_obj.browse(cr, uid, context.get('active_ids')[0], context=context)
2764 #~ TODOK: no seria mejor ids=context.get(active_id)
2765
2766 company_id = inv.company_id.id
2767- context.update({'company_id':company_id})
2768+ context.update({'company_id': company_id})
2769
2770 if inv.state in ['draft', 'proforma2', 'cancel']:
2771 raise osv.except_osv(_('Error !'), _('Can not create a debit note from draft/proforma/cancel invoice.'))
2772@@ -134,18 +129,18 @@
2773 if inv.type not in ['in_invoice', 'out_invoice']:
2774 raise osv.except_osv(_('Error !'), _('Can not make a debit note on a refund invoice.'))
2775
2776- #Check for the form fields
2777+ # Check for the form fields
2778
2779 if form.period:
2780 period = form.period.id
2781 else:
2782- #Take period from the current date
2783+ # Take period from the current date
2784 period = self.pool.get('account.period').find(cr, uid, context=context)
2785 period = period and period[0] or False
2786 if not period:
2787- raise osv.except_osv(_('No Pediod Defined'), \
2788- _('You have been left empty the period field that automatically fill with the current period. However there is not period defined for the current company. Please check in Accounting/Configuration/Periods'))
2789- self.write(cr, uid, ids, {'period': period }, context=context)
2790+ raise osv.except_osv(_('No Pediod Defined'),
2791+ _('You have been left empty the period field that automatically fill with the current period. However there is not period defined for the current company. Please check in Accounting/Configuration/Periods'))
2792+ self.write(cr, uid, ids, {'period': period}, context=context)
2793
2794 if not journal_id:
2795 journal_id = inv.journal_id.id
2796@@ -153,7 +148,7 @@
2797 if form.date:
2798 date = form.date
2799 else:
2800- #Take current date
2801+ # Take current date
2802 #date = inv.date_invoice
2803 date = time.strftime('%Y-%m-%d')
2804 if form.description:
2805@@ -161,7 +156,7 @@
2806 else:
2807 description = inv.name
2808
2809- #we get original data of invoice to create a new invoice that is the copy of the original
2810+ # we get original data of invoice to create a new invoice that is the copy of the original
2811 invoice = inv_obj.read(cr, uid, [inv.id],
2812 ['name', 'type', 'number', 'supplier_invoice_number',
2813 'comment', 'date_due', 'partner_id',
2814@@ -173,7 +168,7 @@
2815 del invoice['id']
2816 invoice_lines = []
2817 tax_lines = []
2818- #Add origin, parent and comment values
2819+ # Add origin, parent and comment values
2820 orig = self._get_orig(cr, uid, inv, invoice['supplier_invoice_number'], context)
2821 invoice.update({
2822 'type': inv.type,
2823@@ -183,16 +178,16 @@
2824 'invoice_line': invoice_lines,
2825 'tax_line': tax_lines,
2826 'period_id': period,
2827- 'parent_id':inv.id,
2828+ 'parent_id': inv.id,
2829 'name': description,
2830 'origin': orig,
2831- 'comment':form.comment,
2832- 'journal_id':journal_id
2833+ 'comment': form.comment,
2834+ 'journal_id': journal_id
2835 })
2836- #take the id part of the tuple returned for many2one fields
2837+ # take the id part of the tuple returned for many2one fields
2838 for field in ('partner_id',
2839 'account_id', 'currency_id', 'payment_term'):
2840- invoice[field] = invoice[field] and invoice[field][0]
2841+ invoice[field] = invoice[field] and invoice[field][0]
2842 # create the new invoice
2843 inv_id = inv_obj.create(cr, uid, invoice, {})
2844 # we compute due date
2845@@ -201,12 +196,12 @@
2846 if 'value' in data and data['value']:
2847 inv_obj.write(cr, uid, [inv_id], data['value'])
2848 created_inv.append(inv_id)
2849- #we get the view id
2850+ # we get the view id
2851 if inv.type in ('out_invoice', 'out_refund'):
2852 xml_id = 'action_sale_debit_tree'
2853 else:
2854 xml_id = 'action_purchase_debit_tree'
2855- #we get the model
2856+ # we get the model
2857 result = mod_obj.get_object_reference(cr, uid, 'l10n_ve_fiscal_requirements', xml_id)
2858 id = result and result[1] or False
2859 # we read the act window
2860
2861=== modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py'
2862--- l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py 2014-01-13 19:38:55 +0000
2863+++ l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py 2014-10-11 00:06:17 +0000
2864@@ -25,11 +25,13 @@
2865 from openerp.tools.translate import _
2866 from openerp import netsvc
2867
2868+
2869 class account_invoice_refund(osv.osv_memory):
2870+
2871 """Refunds invoice"""
2872
2873 _inherit = 'account.invoice.refund'
2874-
2875+
2876 def default_get(self, cr, uid, fields, context=None):
2877 """ Get default values
2878 @param fields: List of fields for default value
2879@@ -40,12 +42,12 @@
2880 if context.get('active_id'):
2881 code = datetime.datetime.today().strftime('%m/%Y')
2882 period_obj = self.pool.get('account.period')
2883- period_ids = period_obj.search(cr,uid,[('code','=',code)],context=context)
2884+ period_ids = period_obj.search(cr, uid, [('code', '=', code)], context=context)
2885 period_id = period_ids and period_ids[0]
2886-
2887+
2888 res.update({'period': period_id})
2889 return res
2890-
2891+
2892 def _get_loc_req(self, cr, uid, context=None):
2893 """Get if a field is required or not by a Localization
2894 @param uid: Integer value of the user
2895@@ -56,18 +58,17 @@
2896 u = self.pool.get('res.users').browse(cr, uid, uid, context=context)
2897 rc_brw = rc_obj.browse(cr, uid, u.company_id.id, context=context)
2898 if rc_brw.country_id and rc_brw.country_id.code == 'VE':
2899- res= True
2900+ res = True
2901 return res
2902-
2903-
2904+
2905 _columns = {
2906- 'nro_ctrl': fields.char('Control Number', size=32, help="Code used for intern invoice control"),
2907- 'loc_req':fields.boolean('Required by Localization', help='This fields is for technical use'),
2908+ 'nro_ctrl': fields.char('Control Number', size=32, help="Code used for intern invoice control"),
2909+ 'loc_req': fields.boolean('Required by Localization', help='This fields is for technical use'),
2910 }
2911
2912- _defaults ={
2913+ _defaults = {
2914 'loc_req': _get_loc_req
2915- }
2916+ }
2917
2918 def _get_journal(self, cr, uid, context=None):
2919 """ Return journal depending of the invoice type
2920@@ -86,9 +87,9 @@
2921 """
2922 if context is None:
2923 context = {}
2924-
2925+
2926 journal_obj = self.pool.get('account.journal')
2927- res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
2928+ res = super(account_invoice_refund, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
2929 type = context.get('journal_type', 'sale_refund')
2930 if type in ('sale', 'sale_refund'):
2931 type = 'sale_refund'
2932@@ -106,48 +107,47 @@
2933 nro_ref = ref
2934 if inv.type == 'out_invoice':
2935 nro_ref = inv.number
2936- orig = 'Devolucion FACT:' +(nro_ref or '') + '- DE FECHA:' + (inv.date_invoice or '') + (' TOTAL:' + str(inv.amount_total) or '')
2937+ orig = 'Devolucion FACT:' + (nro_ref or '') + '- DE FECHA:' + (inv.date_invoice or '') + (' TOTAL:' + str(inv.amount_total) or '')
2938 return orig
2939
2940-
2941- def cn_iva_validate(self, cr, uid,invoice,context=None):
2942+ def cn_iva_validate(self, cr, uid, invoice, context=None):
2943 """ Validates if retentions have been changes to move the state confirmed and done
2944 """
2945 if context is None:
2946- context={}
2947- ret_iva_id=False
2948- ret_islr_id=False
2949- im_obj=self.pool.get('ir.model')
2950- res = im_obj.browse(cr,uid,im_obj.search(cr, uid, [('model', '=','account.invoice')], context=context),context=context)[0].field_id
2951+ context = {}
2952+ ret_iva_id = False
2953+ ret_islr_id = False
2954+ im_obj = self.pool.get('ir.model')
2955+ res = im_obj.browse(cr, uid, im_obj.search(cr, uid, [('model', '=', 'account.invoice')], context=context), context=context)[0].field_id
2956 for i in res:
2957 if i.name == 'wh_iva_id':
2958- if invoice.wh_iva_id:
2959- ret_iva_id = invoice.wh_iva_id.id
2960+ if invoice.wh_iva_id:
2961+ ret_iva_id = invoice.wh_iva_id.id
2962 if i.name == 'islr_wh_doc_id':
2963 if invoice.islr_wh_doc_id:
2964- ret_islr_id = invoice.islr_wh_doc_id.id
2965-
2966- awi_obj=self.pool.get('account.wh.iva')
2967- iwd_obj=self.pool.get('islr.wh.doc')
2968+ ret_islr_id = invoice.islr_wh_doc_id.id
2969+
2970+ awi_obj = self.pool.get('account.wh.iva')
2971+ iwd_obj = self.pool.get('islr.wh.doc')
2972 wf_service = netsvc.LocalService("workflow")
2973-
2974+
2975 if ret_iva_id:
2976- awi_obj.compute_amount_wh(cr,uid,[ret_iva_id],context=context)
2977+ awi_obj.compute_amount_wh(cr, uid, [ret_iva_id], context=context)
2978 wf_service.trg_validate(uid, 'account.wh.iva', ret_iva_id, 'wh_iva_confirmed', cr)
2979 wf_service.trg_validate(uid, 'account.wh.iva', ret_iva_id, 'wh_iva_done', cr)
2980-
2981+
2982 if ret_islr_id:
2983- iwd_obj.action_confirm1(cr,uid,[ret_islr_id],context=context)
2984+ iwd_obj.action_confirm1(cr, uid, [ret_islr_id], context=context)
2985 wf_service.trg_validate(uid, 'islr.wh.doc', ret_islr_id, 'act_done', cr)
2986-
2987+
2988 return True
2989
2990 def compute_refund(self, cr, uid, ids, mode='refund', context=None):
2991- """
2992+ """
2993 @param ids: the account invoice refund’s ID or list of IDs
2994 """
2995- wzd_brw = self.browse(cr,uid,ids[0],context=context)
2996- brw = self.browse(cr,uid,ids[0],context=context)
2997+ wzd_brw = self.browse(cr, uid, ids[0], context=context)
2998+ brw = self.browse(cr, uid, ids[0], context=context)
2999 inv_obj = self.pool.get('account.invoice')
3000 reconcile_obj = self.pool.get('account.move.reconcile')
3001 account_m_line_obj = self.pool.get('account.move.line')
3002@@ -159,7 +159,7 @@
3003 res_users_obj = self.pool.get('res.users')
3004 if context is None:
3005 context = {}
3006- for form in self.read(cr, uid, ids, context=context):
3007+ for form in self.read(cr, uid, ids, context=context):
3008 created_inv = []
3009 date = False
3010 period = False
3011@@ -174,65 +174,65 @@
3012 raise osv.except_osv(_('Error !'), _('Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice') % (mode))
3013 period = form.get('period') and form.get('period')[0] or False
3014 if not period:
3015- #Take period from the current date
3016+ # Take period from the current date
3017 period = self.pool.get('account.period').find(cr, uid, context=context)
3018 period = period and period[0] or False
3019 if not period:
3020- raise osv.except_osv(_('No Pediod Defined'), \
3021+ raise osv.except_osv(_('No Pediod Defined'),
3022 _('You have been left empty the period field that automatically fill with the current period. However there is not period defined for the current company. Please check in Accounting/Configuration/Periods'))
3023- self.write(cr, uid, ids, {'period': period }, context=context)
3024+ self.write(cr, uid, ids, {'period': period}, context=context)
3025
3026 if not journal_brw:
3027 journal_id = inv.journal_id.id
3028 else:
3029- journal_id=journal_brw[0]
3030+ journal_id = journal_brw[0]
3031
3032 if form['date']:
3033 date = form['date']
3034 if not form['period']:
3035- cr.execute("select name from ir_model_fields \
3036+ cr.execute("select name from ir_model_fields \
3037 where model = 'account.period' \
3038 and name = 'company_id'")
3039- result_query = cr.fetchone()
3040- if result_query:
3041- cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \
3042+ result_query = cr.fetchone()
3043+ if result_query:
3044+ cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \
3045 and date(%s) between p.date_start AND p.date_stop and y.company_id = %s limit 1""", (date, company.id,))
3046- else:
3047- cr.execute("""SELECT id
3048+ else:
3049+ cr.execute("""SELECT id
3050 from account_period where date(%s)
3051 between date_start AND date_stop \
3052 limit 1 """, (date,))
3053- res = cr.fetchone()
3054- if res:
3055- period = res[0]
3056+ res = cr.fetchone()
3057+ if res:
3058+ period = res[0]
3059 else:
3060- #Take current date
3061+ # Take current date
3062 #date = inv.date_invoice
3063 date = time.strftime('%Y-%m-%d')
3064 if form['description']:
3065 description = form['description']
3066 else:
3067 description = inv.name
3068-
3069- if inv.type in ('in_invoice','in_refund'):
3070+
3071+ if inv.type in ('in_invoice', 'in_refund'):
3072 if form['nro_ctrl']:
3073 nroctrl = form['nro_ctrl']
3074 else:
3075- raise osv.except_osv(_('Control Number !'), \
3076+ raise osv.except_osv(_('Control Number !'),
3077 _('Missing Control Number on Invoice Refund!'))
3078
3079 if not period:
3080- raise osv.except_osv(_('Data Insufficient !'), \
3081- _('No Period found on Invoice!'))
3082-
3083+ raise osv.except_osv(_('Data Insufficient !'),
3084+ _('No Period found on Invoice!'))
3085+
3086 refund_id = inv_obj.refund(cr, uid, [inv.id], date, period, description, journal_id)
3087-
3088+
3089 refund = inv_obj.browse(cr, uid, refund_id[0], context=context)
3090- #Add parent invoice
3091+ # Add parent invoice
3092 cr.execute("update account_invoice set date_due='%s',nro_ctrl='%s', check_total='%s', \
3093- parent_id=%s where id =%s"%(date,nroctrl,inv.check_total,inv.id,refund.id))
3094+ parent_id=%s where id =%s" % (date, nroctrl, inv.check_total, inv.id, refund.id))
3095 inv_obj.button_compute(cr, uid, refund_id)
3096-
3097+
3098 created_inv.append(refund_id[0])
3099 if mode in ('cancel', 'modify'):
3100 movelines = inv.move_id.line_id
3101@@ -242,21 +242,21 @@
3102 to_reconcile_ids[line.account_id.id] = [line.id]
3103 if type(line.reconcile_id) != osv.orm.browse_null:
3104 reconcile_obj.unlink(cr, uid, line.reconcile_id.id)
3105- wf_service.trg_validate(uid, 'account.invoice', \
3106+ wf_service.trg_validate(uid, 'account.invoice',
3107 refund.id, 'invoice_open', cr)
3108-
3109+
3110 refund = inv_obj.browse(cr, uid, refund_id[0], context=context)
3111- self.cn_iva_validate(cr,uid,refund,context=context)
3112-
3113- for tmpline in refund.move_id.line_id:
3114+ self.cn_iva_validate(cr, uid, refund, context=context)
3115+
3116+ for tmpline in refund.move_id.line_id:
3117 if tmpline.account_id.id == inv.account_id.id:
3118 to_reconcile_ids[tmpline.account_id.id].append(tmpline.id)
3119 for account in to_reconcile_ids:
3120 account_m_line_obj.reconcile(cr, uid, to_reconcile_ids[account],
3121 writeoff_period_id=period,
3122- writeoff_journal_id = inv.journal_id.id,
3123+ writeoff_journal_id=inv.journal_id.id,
3124 writeoff_acc_id=inv.account_id.id
3125- )
3126+ )
3127 if mode == 'modify':
3128 invoice = inv_obj.read(cr, uid, [inv.id],
3129 ['name', 'type', 'number', 'supplier_invoice_number',
3130@@ -272,7 +272,7 @@
3131 invoice_lines = inv_obj._refund_cleanup_lines(cr, uid, invoice_lines)
3132 tax_lines = inv_tax_obj.browse(cr, uid, invoice['tax_line'], context=context)
3133 tax_lines = inv_obj._refund_cleanup_lines(cr, uid, tax_lines)
3134- #Add origin value
3135+ # Add origin value
3136 orig = self._get_orig(cr, uid, inv, invoice['supplier_invoice_number'], context)
3137 invoice.update({
3138 'type': inv.type,
3139@@ -284,26 +284,26 @@
3140 'period_id': period,
3141 'name': description,
3142 'origin': orig,
3143-
3144+
3145 })
3146- for field in ( 'partner_id',
3147+ for field in ('partner_id',
3148 'account_id', 'currency_id', 'payment_term', 'journal_id'):
3149- invoice[field] = invoice[field] and invoice[field][0]
3150+ invoice[field] = invoice[field] and invoice[field][0]
3151 inv_id = inv_obj.create(cr, uid, invoice, {})
3152 if inv.payment_term.id:
3153 data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], inv.payment_term.id, date)
3154 if 'value' in data and data['value']:
3155 inv_obj.write(cr, uid, [inv_id], data['value'])
3156 created_inv.append(inv_id)
3157-
3158- new_inv_brw = inv_obj.browse(cr,uid,created_inv[1],context=context)
3159- inv_obj.write(cr,uid,created_inv[0],{'name':wzd_brw.description,'origin':new_inv_brw.origin},context=context)
3160- inv_obj.write(cr,uid,created_inv[1],{'origin':inv.origin,'name':wzd_brw.description},context=context)
3161+
3162+ new_inv_brw = inv_obj.browse(cr, uid, created_inv[1], context=context)
3163+ inv_obj.write(cr, uid, created_inv[0], {'name': wzd_brw.description, 'origin': new_inv_brw.origin}, context=context)
3164+ inv_obj.write(cr, uid, created_inv[1], {'origin': inv.origin, 'name': wzd_brw.description}, context=context)
3165 if inv.type in ('out_invoice', 'out_refund'):
3166 xml_id = 'action_invoice_tree3'
3167 #~ if hasattr(inv, 'sale_ids'):
3168- #~ for i in inv.sale_ids:
3169- #~ cr.execute('insert into sale_order_invoice_rel (order_id,invoice_id) values (%s,%s)', (i.id, refund_id[0]))
3170+ #~ for i in inv.sale_ids:
3171+ #~ cr.execute('insert into sale_order_invoice_rel (order_id,invoice_id) values (%s,%s)', (i.id, refund_id[0]))
3172 else:
3173 xml_id = 'action_invoice_tree4'
3174 result = mod_obj.get_object_reference(cr, uid, 'account', xml_id)
3175@@ -312,14 +312,14 @@
3176 invoice_domain = eval(result['domain'])
3177 invoice_domain.append(('id', 'in', created_inv))
3178 result['domain'] = invoice_domain
3179-
3180+
3181 if wzd_brw.filter_refund == 'cancel':
3182 orig = self._get_orig(cr, uid, inv, inv.supplier_invoice_number, context)
3183- inv_obj.write(cr,uid,created_inv[0],{'origin':orig,'name':wzd_brw.description},context=context)
3184-
3185+ inv_obj.write(cr, uid, created_inv[0], {'origin': orig, 'name': wzd_brw.description}, context=context)
3186+
3187 if wzd_brw.filter_refund == 'refund':
3188 orig = self._get_orig(cr, uid, inv, inv.supplier_invoice_number, context)
3189- inv_obj.write(cr,uid,created_inv[0],{'origin':inv.origin,'name':wzd_brw.description},context=context)
3190+ inv_obj.write(cr, uid, created_inv[0], {'origin': inv.origin, 'name': wzd_brw.description}, context=context)
3191 return result
3192
3193 def validate_total_payment_inv(self, cr, uid, ids, context=None):
3194@@ -339,7 +339,7 @@
3195
3196 return: True: if invoice is does not have wh's or it does have and those ones are validated.
3197 False: if invoice is does have and those wh's are not yet validated.
3198-
3199+
3200 in the meantime this function is DUMMY,
3201 and the developer should use it to override and get advantage of it.
3202 """
3203@@ -359,16 +359,16 @@
3204 mid = []
3205 if self.validate_total_payment_inv(cr, uid, invoiceids, context=context):
3206 for inv in inv_obj.browse(cr, uid, invoiceids, context=context):
3207- movelineids = inv_obj.move_line_id_payment_get(cr, uid,[inv.id])
3208- for moveline in moveline_obj.browse(cr, uid, movelineids,context=context):
3209+ movelineids = inv_obj.move_line_id_payment_get(cr, uid, [inv.id])
3210+ for moveline in moveline_obj.browse(cr, uid, movelineids, context=context):
3211 if moveline.reconcile_id:
3212 rec += [moveline.reconcile_id.id]
3213 if moveline.reconcile_partial_id:
3214 rec += [moveline.reconcile_partial_id.id]
3215- movelines = moveline_obj.search(cr, uid, [('|'),('reconcile_id','in',rec),('reconcile_partial_id','in',rec)],context=context)
3216+ movelines = moveline_obj.search(cr, uid, [('|'), ('reconcile_id', 'in', rec), ('reconcile_partial_id', 'in', rec)], context=context)
3217 for mids in moveline_obj.browse(cr, uid, movelines, context=context):
3218- mid +=[mids.move_id.id]
3219- voucherids = voucher_pool.search(cr, uid,[('move_id','in',mid)])
3220+ mid += [mids.move_id.id]
3221+ voucherids = voucher_pool.search(cr, uid, [('move_id', 'in', mid)])
3222 if voucherids:
3223 voucher_pool.cancel_voucher(cr, uid, voucherids, context=context)
3224 else:
3225@@ -382,17 +382,17 @@
3226 context = {}
3227 inv_obj = self.pool.get('account.invoice')
3228 period_obj = self.pool.get('account.period')
3229- wzr_brw = self.browse(cr,uid,ids,context=context)[0]
3230- date = wzr_brw.date and wzr_brw.date.split('-')
3231- period = wzr_brw and wzr_brw.period and wzr_brw.period.id
3232- period_ids = date and len(date) == 3 and period_obj.search(cr,uid,[('code','=','%s/%s'%(date[1],date[0]))],context=context)
3233+ wzr_brw = self.browse(cr, uid, ids, context=context)[0]
3234+ date = wzr_brw.date and wzr_brw.date.split('-')
3235+ period = wzr_brw and wzr_brw.period and wzr_brw.period.id
3236+ period_ids = date and len(date) == 3 and period_obj.search(cr, uid, [('code', '=', '%s/%s' % (date[1], date[0]))], context=context)
3237 if period not in period_ids:
3238- raise osv.except_osv(_('Error !'), \
3239- _('The date should be chosen to belong to the period'))
3240+ raise osv.except_osv(_('Error !'),
3241+ _('The date should be chosen to belong to the period'))
3242 if not self.validate_wh(cr, uid, context.get('active_ids'), context=context):
3243- inv= inv_obj.browse(cr,uid,context.get('active_ids'),context=context)[0]
3244- raise osv.except_osv(_('Error !'), \
3245- _('There are non-valid withholds for the document %s which refund is being processed!' % inv and inv.wh_iva_id.code or "vacio" ))
3246+ inv = inv_obj.browse(cr, uid, context.get('active_ids'), context=context)[0]
3247+ raise osv.except_osv(_('Error !'),
3248+ _('There are non-valid withholds for the document %s which refund is being processed!' % inv and inv.wh_iva_id.code or "vacio"))
3249 self.unreconcile_paid_invoices(cr, uid, context.get('active_ids'), context=context)
3250 data_refund = self.browse(cr, uid, ids, context=context)[0].filter_refund
3251 return self.compute_refund(cr, uid, ids, data_refund, context=context)
3252
3253=== modified file 'l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py'
3254--- l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py 2013-06-03 21:19:56 +0000
3255+++ l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py 2014-10-11 00:06:17 +0000
3256@@ -2,7 +2,7 @@
3257 # -*- encoding: utf-8 -*-
3258 ##############################################################################
3259 #
3260-# OpenERP, Open Source Management Solution
3261+# OpenERP, Open Source Management Solution
3262 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
3263 # This module is developed by Vauxoo
3264 # This program is free software: you can redistribute it and/or modify
3265@@ -19,46 +19,46 @@
3266 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3267 #
3268 ##############################################################################
3269-import openerp.pooler
3270 from openerp.osv import osv, fields
3271 from openerp.tools.translate import _
3272
3273+
3274 class search_info_partner_seniat(osv.osv_memory):
3275-
3276+
3277 _name = "search.info.partner.seniat"
3278 _columns = {
3279- 'vat':fields.char('ID Number (Cedula, Passport, VAT Number)', size=64, help='The VAT number must be in this format J1234567890, if you are looking for a cedula 12345678 and passport D123456789',required=True),
3280- 'name':fields.char('Partner', size=256, help='Partner name'),
3281- 'wh_iva_agent':fields.boolean('Withholding Agent', help='It is withholding agent'),
3282- 'wh_iva_rate':fields.float('Percent of withholding', help='What is the percentil of withholding that you must to apply to this supplier if you are withholding agent'),
3283- 'vat_subjected':fields.boolean('Pay VAY', help='Pay VAT, in spanish known as : Contribuyente formal'),
3284+ 'vat': fields.char('ID Number (Cedula, Passport, VAT Number)', size=64, help='The VAT number must be in this format J1234567890, if you are looking for a cedula 12345678 and passport D123456789', required=True),
3285+ 'name': fields.char('Partner', size=256, help='Partner name'),
3286+ 'wh_iva_agent': fields.boolean('Withholding Agent', help='It is withholding agent'),
3287+ 'wh_iva_rate': fields.float('Percent of withholding', help='What is the percentil of withholding that you must to apply to this supplier if you are withholding agent'),
3288+ 'vat_subjected': fields.boolean('Pay VAY', help='Pay VAT, in spanish known as : Contribuyente formal'),
3289 }
3290
3291 def search_partner_seniat(self, cr, uid, ids, context=None):
3292 """ Check vat of the partner and update iva rate
3293 """
3294 if context is None:
3295- context={}
3296+ context = {}
3297 this = self.browse(cr, uid, ids)[0]
3298 su_obj = self.pool.get('seniat.url')
3299 rp_obj = self.pool.get('res.partner')
3300 vat = this.vat.upper()
3301- res={'name': _('The requested contributor does not exist'),'vat_subjected': False,'vat':vat,'wh_iva_agent':False, 'wh_iva_rate': 0.0}
3302+ res = {'name': _('The requested contributor does not exist'), 'vat_subjected': False, 'vat': vat, 'wh_iva_agent': False, 'wh_iva_rate': 0.0}
3303
3304 if 'VE' in vat:
3305 vat = vat[2:]
3306
3307- if rp_obj.check_vat_ve(vat,context=context):
3308- res = su_obj._dom_giver(cr, uid, vat,context)
3309- self.write(cr,uid,ids,res)
3310-
3311+ if rp_obj.check_vat_ve(vat, context=context):
3312+ res = su_obj._dom_giver(cr, uid, vat, context)
3313+ self.write(cr, uid, ids, res)
3314+
3315 return {
3316- 'type': 'ir.actions.act_window',
3317- 'res_model': 'search.info.partner.seniat',
3318- 'view_mode': 'form',
3319- 'view_type': 'form',
3320- 'res_id': this.id,
3321- 'views': [(False, 'form')],
3322- 'target': 'new',
3323- }
3324+ 'type': 'ir.actions.act_window',
3325+ 'res_model': 'search.info.partner.seniat',
3326+ 'view_mode': 'form',
3327+ 'view_type': 'form',
3328+ 'res_id': this.id,
3329+ 'views': [(False, 'form')],
3330+ 'target': 'new',
3331+ }
3332 search_info_partner_seniat()
3333
3334=== modified file 'l10n_ve_fiscal_requirements/wizard/update_info_partner.py'
3335--- l10n_ve_fiscal_requirements/wizard/update_info_partner.py 2013-04-12 18:26:24 +0000
3336+++ l10n_ve_fiscal_requirements/wizard/update_info_partner.py 2014-10-11 00:06:17 +0000
3337@@ -1,7 +1,7 @@
3338 # -*- encoding: utf-8 -*-
3339 ##############################################################################
3340 #
3341-# OpenERP, Open Source Management Solution
3342+# OpenERP, Open Source Management Solution
3343 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
3344 # author.name@company.com
3345 #
3346@@ -19,23 +19,21 @@
3347 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3348 #
3349 ##############################################################################
3350-import openerp.pooler
3351-from openerp.osv import osv, fields
3352-from openerp.tools.translate import _
3353+from openerp.osv import osv
3354+
3355
3356 class update_info_partner(osv.osv_memory):
3357 _name = 'update.info.partner'
3358-
3359+
3360 def update_info(self, cr, uid, ids, context={}):
3361 """ OpenERP osv memory wizard : update_info_partner
3362 """
3363- aux=[]
3364 seniat_url_obj = self.pool.get('seniat.url')
3365 cr.execute('''SELECT id FROM res_partner WHERE vat ilike 'VE%';''')
3366 record = cr.fetchall()
3367- pids = record and map(lambda x: x[0],record) or []
3368+ pids = record and map(lambda x: x[0], record) or []
3369 seniat_url_obj.connect_seniat(cr, uid, pids, context=context, all_rif=True)
3370 return{}
3371
3372-
3373+
3374 update_info_partner()
3375
3376=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py'
3377--- l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py 2013-04-11 20:50:21 +0000
3378+++ l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py 2014-10-11 00:06:17 +0000
3379@@ -25,67 +25,65 @@
3380 ##############################################################################
3381
3382 from openerp.osv import fields, osv
3383-import openerp.tools
3384 from openerp.tools.translate import _
3385-from openerp.tools import config
3386+
3387
3388 class wizard_invoice_nro_ctrl(osv.osv_memory):
3389
3390 _name = "wizard.invoice.nro.ctrl"
3391 _columns = {
3392- 'invoice_id': fields.many2one('account.invoice','Invoice',help="Invoice to be declared damaged."),
3393- 'date': fields.date('Date',help="Date used for declared damaged paper. Keep empty to use the current date"),
3394+ 'invoice_id': fields.many2one('account.invoice', 'Invoice', help="Invoice to be declared damaged."),
3395+ 'date': fields.date('Date', help="Date used for declared damaged paper. Keep empty to use the current date"),
3396 'sure': fields.boolean('Are You Sure?'),
3397 }
3398
3399- def action_invoice_create(self, cr, uid, ids, wizard_brw,inv_brw,context=None):
3400+ def action_invoice_create(self, cr, uid, ids, wizard_brw, inv_brw, context=None):
3401 """ If the invoice has control number, this function is responsible for passing the bill to damaged paper
3402- @param wizard_brw: nothing for now
3403+ @param wizard_brw: nothing for now
3404 @param inv_brw: damaged paper
3405 """
3406 invoice_line_obj = self.pool.get('account.invoice.line')
3407 invoice_obj = self.pool.get('account.invoice')
3408 acc_mv_obj = self.pool.get('account.move')
3409 acc_mv_l_obj = self.pool.get('account.move.line')
3410- tax_obj=self.pool.get('account.invoice.tax')
3411- invoice={}
3412- invoice_line ={}
3413+ tax_obj = self.pool.get('account.invoice.tax')
3414+ invoice = {}
3415 if inv_brw.nro_ctrl:
3416 invoice.update({
3417- 'name': 'PAPELANULADO_NRO_CTRL_%s'%(inv_brw.nro_ctrl and inv_brw.nro_ctrl or '') ,
3418- 'state':'paid',
3419- 'tax_line':[],
3420- })
3421+ 'name': 'PAPELANULADO_NRO_CTRL_%s' % (inv_brw.nro_ctrl and inv_brw.nro_ctrl or ''),
3422+ 'state': 'paid',
3423+ 'tax_line': [],
3424+ })
3425 else:
3426 raise osv.except_osv(_('Validation error!'), _("You can run this process just if the invoice have Control Number, please verify the invoice and try again."))
3427- invoice_obj.write(cr,uid,[inv_brw.id],invoice,context=context)
3428+ invoice_obj.write(cr, uid, [inv_brw.id], invoice, context=context)
3429 for line in inv_brw.invoice_line:
3430- invoice_line_obj.write(cr,uid,[line.id],{'quantity':0.0,'invoice_line_tax_id':[],'price_unit':0.0},context=context)
3431-
3432- tax_ids = self.pool.get('account.tax').search(cr,uid,[],context=context)
3433- tax = tax_obj.search(cr,uid,[('invoice_id','=',inv_brw and inv_brw.id)],context=context)
3434- tax and tax_obj.write(cr,uid,tax[0],{'invoice_id':[]},context=context)
3435- tax_id=tax_obj.create(cr,uid,{'name':'SDCF',
3436+ invoice_line_obj.write(cr, uid, [line.id], {'quantity': 0.0, 'invoice_line_tax_id': [], 'price_unit': 0.0}, context=context)
3437+
3438+ tax_ids = self.pool.get('account.tax').search(cr, uid, [], context=context)
3439+ tax = tax_obj.search(cr, uid, [('invoice_id', '=', inv_brw and inv_brw.id)], context=context)
3440+ tax and tax_obj.write(cr, uid, tax[0], {'invoice_id': []}, context=context)
3441+ tax_id = tax_obj.create(cr, uid, {'name': 'SDCF',
3442 'tax_id': tax_ids and tax_ids[0],
3443- 'amount':0.00,
3444- 'tax_amount':0.00,
3445- 'base':0.00,
3446- 'account_id':inv_brw.company_id.acc_id.id,
3447- 'invoice_id':inv_brw and inv_brw.id},{})
3448+ 'amount': 0.00,
3449+ 'tax_amount': 0.00,
3450+ 'base': 0.00,
3451+ 'account_id': inv_brw.company_id.acc_id.id,
3452+ 'invoice_id': inv_brw and inv_brw.id}, {})
3453 move_id = inv_brw.move_id and inv_brw.move_id.id
3454-
3455+
3456 if move_id:
3457 acc_mv_obj.button_cancel(cr, uid, [inv_brw.move_id.id], context=context)
3458- acc_mv_obj.write(cr, uid, [inv_brw.move_id.id],{'ref':'Damanged Paper'}, context=context)
3459- acc_mv_l_obj.unlink(cr,uid,[i.id for i in inv_brw.move_id.line_id])
3460+ acc_mv_obj.write(cr, uid, [inv_brw.move_id.id], {'ref': 'Damanged Paper'}, context=context)
3461+ acc_mv_l_obj.unlink(cr, uid, [i.id for i in inv_brw.move_id.line_id])
3462 return inv_brw.id
3463
3464- def new_open_window(self,cr,uid,ids,list_ids,xml_id,module,context=None):
3465+ def new_open_window(self, cr, uid, ids, list_ids, xml_id, module, context=None):
3466 """ Generate new window at view form or tree
3467 """
3468 mod_obj = self.pool.get('ir.model.data')
3469 act_obj = self.pool.get('ir.actions.act_window')
3470- result = mod_obj._get_id(cr, uid, module, xml_id)
3471+ result = mod_obj._get_id(cr, uid, module, xml_id)
3472 id = mod_obj.read(cr, uid, result, ['res_id'])['res_id']
3473 result = act_obj.read(cr, uid, id)
3474 result['res_id'] = list_ids
3475@@ -94,19 +92,17 @@
3476 def create_invoice(self, cr, uid, ids, context=None):
3477 """ Create a invoice refund
3478 """
3479- if context==None:
3480- context={}
3481+ if context == None:
3482+ context = {}
3483 wizard_brw = self.browse(cr, uid, ids, context=None)
3484- wizard_deli_obj = self.pool.get('wz.picking.delivery.note')
3485 inv_id = context.get('active_id')
3486 for wizard in wizard_brw:
3487 if not wizard.sure:
3488 raise osv.except_osv(_("Validation error!"), _("Please confirm that you know what you're doing by checking the option bellow!"))
3489 if wizard.invoice_id and wizard.invoice_id.company_id.jour_id and wizard.invoice_id and wizard.invoice_id.company_id.acc_id:
3490- inv_id = self.action_invoice_create(cr,uid,ids,wizard,wizard.invoice_id,context)
3491+ inv_id = self.action_invoice_create(cr, uid, ids, wizard, wizard.invoice_id, context)
3492 else:
3493 raise osv.except_osv(_('Validation error!'), _("You must go to the company form and configure a journal and an account for damaged invoices"))
3494- return self.new_open_window(cr,uid,ids,[inv_id],'action_invoice_tree1','account')
3495+ return self.new_open_window(cr, uid, ids, [inv_id], 'action_invoice_tree1', 'account')
3496
3497 wizard_invoice_nro_ctrl()
3498-
3499
3500=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py'
3501--- l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py 2013-04-11 20:50:21 +0000
3502+++ l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py 2014-10-11 00:06:17 +0000
3503@@ -5,7 +5,7 @@
3504 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
3505 # All Rights Reserved
3506 ###############Credits######################################################
3507-# Coded by: Vauxoo C.A.
3508+# Coded by: Vauxoo C.A.
3509 # Planified by: Nhomar Hernandez
3510 # Audited by: Vauxoo C.A.
3511 #############################################################################
3512@@ -26,6 +26,7 @@
3513 from openerp.osv import osv, fields
3514 from openerp.tools.translate import _
3515
3516+
3517 class wiz_nroctrl(osv.osv_memory):
3518 _name = 'wiz.nroctrl'
3519 _description = "Wizard that changes the invoice control number"
3520@@ -34,14 +35,12 @@
3521 """ Change control number of the invoice
3522 """
3523 if context is None:
3524- context={}
3525+ context = {}
3526 data = self.pool.get('wiz.nroctrl').read(cr, uid, ids)[0]
3527 if not data['sure']:
3528 raise osv.except_osv(_("Error!"), _("Please confirm that you want to do this by checking the option"))
3529 inv_obj = self.pool.get('account.invoice')
3530 n_ctrl = data['name']
3531-
3532- invoice = inv_obj.browse(cr, uid, context['active_id'])
3533
3534 inv_obj.write(cr, uid, context.get('active_id'), {'nro_ctrl': n_ctrl}, context=context)
3535 return {}
3536@@ -54,4 +53,3 @@
3537
3538
3539 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3540-
3541
3542=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_update_name.py'
3543--- l10n_ve_fiscal_requirements/wizard/wizard_update_name.py 2013-12-16 18:01:13 +0000
3544+++ l10n_ve_fiscal_requirements/wizard/wizard_update_name.py 2014-10-11 00:06:17 +0000
3545@@ -5,7 +5,7 @@
3546 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
3547 # All Rights Reserved
3548 ###############Credits######################################################
3549-# Coded by: Yanina Aular <yanina.aular@vauxoo.com>
3550+# Coded by: Yanina Aular <yanina.aular@vauxoo.com>
3551 # Planified by: Humberto Arocha
3552 # Audited by: Vauxoo C.A.
3553 #############################################################################
3554@@ -26,6 +26,7 @@
3555 from openerp.osv import osv, fields
3556 from openerp.tools.translate import _
3557
3558+
3559 class wiz_updatename(osv.osv_memory):
3560 _name = 'wiz.updatename'
3561 _description = "Wizard that changes the partner name"
3562@@ -36,10 +37,10 @@
3563 data = self.pool.get('wiz.updatename').read(cr, uid, ids)[0]
3564 if not data['sure']:
3565 raise osv.except_osv(_("Error!"), _("Please confirm that you want to do this by checking the option"))
3566-
3567+
3568 partner_obj = self.pool.get('res.partner')
3569 name_partner = data['name']
3570-
3571+
3572 partner_obj.write(cr, uid, context['active_id'], {'name': name_partner}, context=context)
3573 return {}
3574
3575@@ -55,11 +56,11 @@
3576 context = {}
3577 partner_obj = self.pool.get('res.partner')
3578 partner = partner_obj.search(cr, uid, [('id', '=', context['active_id'])])
3579- partner_o = partner_obj.browse(cr, uid, partner[0])
3580+ partner_o = partner_obj.browse(cr, uid, partner[0])
3581 return partner_o and partner_o.name or False
3582
3583 _defaults = {
3584 'name': _get_name,
3585 }
3586-
3587+
3588 wiz_updatename()
3589
3590=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_url_seniat.py'
3591--- l10n_ve_fiscal_requirements/wizard/wizard_url_seniat.py 2013-04-11 20:50:21 +0000
3592+++ l10n_ve_fiscal_requirements/wizard/wizard_url_seniat.py 2014-10-11 00:06:17 +0000
3593@@ -1,7 +1,7 @@
3594 # -*- encoding: utf-8 -*-
3595 ##############################################################################
3596 #
3597-# OpenERP, Open Source Management Solution
3598+# OpenERP, Open Source Management Solution
3599 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
3600 # author.name@company.com
3601 #
3602@@ -20,46 +20,43 @@
3603 #
3604 ##############################################################################
3605 from openerp.osv import fields, osv
3606-import openerp.tools
3607-from openerp.tools.translate import _
3608-from openerp.tools import config
3609+
3610
3611 class wizard_url_seniat(osv.osv_memory):
3612
3613-
3614- def _get_url(self,cr,uid,ids,context=None):
3615+ def _get_url(self, cr, uid, ids, context=None):
3616 """ Get seniat web page
3617 """
3618- url= self.pool.get('seniat.url')
3619- url_ids = url.search(cr, uid,[])
3620- if len(url_ids)>1:
3621- url.unlink(cr, uid,url_ids[1:])
3622- url_obj=url.browse(cr, uid,url_ids,context=None)[0]
3623+ url = self.pool.get('seniat.url')
3624+ url_ids = url.search(cr, uid, [])
3625+ if len(url_ids) > 1:
3626+ url.unlink(cr, uid, url_ids[1:])
3627+ url_obj = url.browse(cr, uid, url_ids, context=None)[0]
3628 return url_obj
3629
3630- def _get_url1(self,cr,uid,ids,context=None):
3631- url_obj = self._get_url(cr,uid,ids,context)
3632+ def _get_url1(self, cr, uid, ids, context=None):
3633+ url_obj = self._get_url(cr, uid, ids, context)
3634 return url_obj.name
3635-
3636- def _get_url2(self,cr,uid,ids,context=None):
3637- url_obj = self._get_url(cr,uid,ids,context)
3638+
3639+ def _get_url2(self, cr, uid, ids, context=None):
3640+ url_obj = self._get_url(cr, uid, ids, context)
3641 return url_obj.url_seniat
3642-
3643- def _get_url3(self,cr,uid,ids,context=None):
3644- url_obj = self._get_url(cr,uid,ids,context)
3645+
3646+ def _get_url3(self, cr, uid, ids, context=None):
3647+ url_obj = self._get_url(cr, uid, ids, context)
3648 return url_obj.url_seniat2
3649-
3650- def update_url(self,cr,uid,ids,context=None):
3651- data= self.pool.get('wizard.seniat.url').read(cr, uid, ids)[0]
3652- url_obj = self._get_url(cr,uid,ids,context)
3653- url_obj.write({'name':data['url1'],'url_seniat':data['url2'],'url_seniat2':data['url3']})
3654+
3655+ def update_url(self, cr, uid, ids, context=None):
3656+ data = self.pool.get('wizard.seniat.url').read(cr, uid, ids)[0]
3657+ url_obj = self._get_url(cr, uid, ids, context)
3658+ url_obj.write({'name': data['url1'], 'url_seniat': data['url2'], 'url_seniat2': data['url3']})
3659 return {}
3660
3661 _name = "wizard.seniat.url"
3662 _columns = {
3663- 'url1':fields.char('URL1',255, required=True, readonly=False,help='In this field enter the URL from Seniat for search the fiscal information from partner'),
3664- 'url2':fields.char('URL2',255, required=True, readonly=False,help='In this field enter the URL from Seniat for search the retention rate from partner (RIF)'),
3665- 'url3':fields.char('URL3',255, required=True, readonly=False,help='In this field enter the URL from Seniat for search the retention rate from partner (CI or Passport)'),
3666+ 'url1': fields.char('URL1', 255, required=True, readonly=False, help='In this field enter the URL from Seniat for search the fiscal information from partner'),
3667+ 'url2': fields.char('URL2', 255, required=True, readonly=False, help='In this field enter the URL from Seniat for search the retention rate from partner (RIF)'),
3668+ 'url3': fields.char('URL3', 255, required=True, readonly=False, help='In this field enter the URL from Seniat for search the retention rate from partner (CI or Passport)'),
3669 }
3670 _defaults = {
3671 'url1': _get_url1,
3672@@ -67,4 +64,3 @@
3673 'url3': _get_url3,
3674 }
3675 wizard_url_seniat()
3676-
3677
3678=== modified file 'l10n_ve_generic/__init__.py'
3679--- l10n_ve_generic/__init__.py 2012-09-23 23:14:44 +0000
3680+++ l10n_ve_generic/__init__.py 2014-10-11 00:06:17 +0000
3681@@ -1,7 +1,7 @@
3682 # -*- encoding: utf-8 -*-
3683 ##############################################################################
3684 #
3685-# OpenERP, Open Source Management Solution
3686+# OpenERP, Open Source Management Solution
3687 # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
3688 # $Id$
3689 #
3690
3691=== modified file 'l10n_ve_imex/__init__.py'
3692--- l10n_ve_imex/__init__.py 2013-04-26 19:54:06 +0000
3693+++ l10n_ve_imex/__init__.py 2014-10-11 00:06:17 +0000
3694@@ -25,4 +25,4 @@
3695 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3696 ###############################################################################
3697
3698-import model
3699+from . import model
3700
3701=== modified file 'l10n_ve_imex/model/__init__.py'
3702--- l10n_ve_imex/model/__init__.py 2013-04-29 16:31:11 +0000
3703+++ l10n_ve_imex/model/__init__.py 2014-10-11 00:06:17 +0000
3704@@ -25,6 +25,6 @@
3705 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3706 ###############################################################################
3707
3708-import customs_form_config
3709-import customs_form
3710-import invoice
3711+from . import customs_form_config
3712+from . import customs_form
3713+from . import invoice
3714
3715=== modified file 'l10n_ve_imex/model/customs_form.py'
3716--- l10n_ve_imex/model/customs_form.py 2014-06-27 21:21:30 +0000
3717+++ l10n_ve_imex/model/customs_form.py 2014-10-11 00:06:17 +0000
3718@@ -26,7 +26,6 @@
3719 ###############################################################################
3720 from openerp.osv import fields, osv
3721 from openerp.tools.translate import _
3722-import openerp.pooler
3723 import openerp.addons.decimal_precision as dp
3724 import time
3725
3726@@ -110,8 +109,8 @@
3727 readonly=True, states={'draft': [('readonly', False)]},
3728 ondelete='restrict'),
3729 'cfl_ids': fields.one2many('customs.form.line', 'customs_form_id',
3730- 'Tax lines', readonly=True,
3731- states={'draft': [('readonly', False)]}),
3732+ 'Tax lines', readonly=True,
3733+ states={'draft': [('readonly', False)]}),
3734 'amount_total': fields.function(_amount_total, method=True,
3735 type='float', string='Amount total',
3736 store=False),
3737@@ -329,4 +328,3 @@
3738 ('code_uniq', 'UNIQUE(customs_form_id,tax_code)',
3739 'The code must be unique! (for this form)'),
3740 ]
3741-
3742
3743=== modified file 'l10n_ve_imex/model/customs_form_config.py'
3744--- l10n_ve_imex/model/customs_form_config.py 2013-06-14 13:39:39 +0000
3745+++ l10n_ve_imex/model/customs_form_config.py 2014-10-11 00:06:17 +0000
3746@@ -26,11 +26,10 @@
3747 ###############################################################################
3748
3749 from openerp.osv import fields, osv
3750-from openerp.tools.translate import _
3751-import openerp.pooler
3752
3753
3754 class customs_form_config(osv.osv):
3755+
3756 '''
3757 Stores common config parameters for form_86 data
3758 '''
3759@@ -59,6 +58,7 @@
3760
3761
3762 class customs_facility(osv.osv):
3763+
3764 '''
3765 Stores a list with Venezuela's customs
3766 '''
3767@@ -82,7 +82,7 @@
3768 cr, user, name, args, operator, context, limit)
3769 if not res and name:
3770 ids = self.search(cr, user, [(
3771- 'code', '=like', name+"%")]+args, limit=limit)
3772+ 'code', '=like', name + "%")] + args, limit=limit)
3773 if ids:
3774 res = self.name_get(cr, user, ids, context=context)
3775 return res
3776@@ -101,6 +101,7 @@
3777
3778
3779 class customs_duty(osv.osv):
3780+
3781 '''
3782 A list of the concepts for taxes in form_86
3783 '''
3784@@ -152,4 +153,3 @@
3785 ('sequence_uniq', 'UNIQUE(sequence,company_id)',
3786 'The sequence must be unique! (for this comany)'),
3787 ]
3788-
3789
3790=== modified file 'l10n_ve_imex/model/invoice.py'
3791--- l10n_ve_imex/model/invoice.py 2014-06-27 21:21:30 +0000
3792+++ l10n_ve_imex/model/invoice.py 2014-10-11 00:06:17 +0000
3793@@ -26,7 +26,6 @@
3794 ###############################################################################
3795
3796 from openerp.osv import osv, fields
3797-import openerp.addons.decimal_precision as dp
3798 from openerp.tools.translate import _
3799
3800
3801@@ -59,13 +58,13 @@
3802 type='many2one', relation='customs.form',
3803 string='Customs form',
3804 store={
3805- 'account.invoice.tax':(_get_inv_from_ait, ['imex_inv_id'], 50),
3806+ 'account.invoice.tax': (_get_inv_from_ait, ['imex_inv_id'], 50),
3807 }, help="This is the VAT Withholding Document where this invoice is being withheld"),
3808 'imex_tax_line': fields.one2many(
3809 'account.invoice.tax', 'imex_inv_id', 'Vat lines', readonly=True,
3810 attrs="{'readonly':[('vat_detail','=',True)], \
3811 'required':[('vat_detail','=',True)]}",),
3812- 'expedient':fields.boolean('Dossier',
3813+ 'expedient': fields.boolean('Dossier',
3814 help="If it is true, it means this is a \
3815 landindg form, you will need to load this \
3816 format as an purchase invoice to declarate \
3817@@ -77,8 +76,8 @@
3818 res = {}
3819 if customs_form_id:
3820 imp = self.pool.get('customs.form').browse(cr, uid,
3821- customs_form_id,
3822- context=context)
3823+ customs_form_id,
3824+ context=context)
3825 res = {'value': {'num_import_form': imp.name,
3826 'import_invo': imp.date_liq}}
3827 return res
3828@@ -94,19 +93,20 @@
3829 % item.customs_form_id.name)
3830 return super(account_invoice, self).test_open(cr, uid, ids, args)
3831
3832+
3833 class account_invoice_tax(osv.osv):
3834
3835 _inherit = 'account.invoice.tax'
3836
3837 _columns = {
3838 'cfl_id': fields.many2one('customs.form.line',
3839- 'Vat line',
3840- ondelete='cascade'),
3841+ 'Vat line',
3842+ ondelete='cascade'),
3843 'imex_inv_id': fields.many2one('account.invoice', 'Imex Invoice',
3844 ondelete='cascade', select=True),
3845 'partner_id': fields.related('imex_inv_id', 'partner_id',
3846 type='many2one', relation='res.partner',
3847- string='Supplier',store=False, readonly=True),
3848+ string='Supplier', store=False, readonly=True),
3849 'supplier_invoice_number': fields.related('imex_inv_id', 'supplier_invoice_number', type='char',
3850 string='Invoice ref', size=64, store=False,
3851 readonly=True),
3852@@ -116,27 +116,27 @@
3853 }
3854
3855 #~ _sql_constraints = [
3856- #~ ('base_gt_zero', 'CHECK (base>0)',
3857- #~ 'The base amount must be > 0!'),
3858- #~ ('amount_zero', 'CHECK (amount>=0)',
3859- #~ 'The tax amount must be >= 0!'),
3860+ #~ ('base_gt_zero', 'CHECK (base>0)',
3861+ #~ 'The base amount must be > 0!'),
3862+ #~ ('amount_zero', 'CHECK (amount>=0)',
3863+ #~ 'The tax amount must be >= 0!'),
3864 #~ ]
3865
3866 #~ def on_change_cfl_id(self, cr, uid, ids,
3867- #~ cfl_id):
3868- #~ '''
3869- #~ Create a domain to filter invoice_id for invoices listed in
3870- #~ customs_form.invoice_ids only
3871- #~ http://help.openerp.com/question/11180/how-to-create-a-domain-for-
3872- #~ field-in-parentparent-model/
3873- #~ '''
3874- #~ res = {}
3875- #~ if cfl_id:
3876- #~ line_obj = self.pool.get('customs.form.line')
3877- #~ invoices = [i.id for i in line_obj.browse(
3878- #~ cr, uid, cfl_id).customs_form_id.invoice_ids]
3879- #~ res = {'domain': {'invoice_id': [('id','in',invoices)]}}
3880- #~ return res
3881+ #~ cfl_id):
3882+ #~ '''
3883+ #~ Create a domain to filter invoice_id for invoices listed in
3884+ #~ customs_form.invoice_ids only
3885+ #~ http://help.openerp.com/question/11180/how-to-create-a-domain-for-
3886+ #~ field-in-parentparent-model/
3887+ #~ '''
3888+ #~ res = {}
3889+ #~ if cfl_id:
3890+ #~ line_obj = self.pool.get('customs.form.line')
3891+ #~ invoices = [i.id for i in line_obj.browse(
3892+ #~ cr, uid, cfl_id).customs_form_id.invoice_ids]
3893+ #~ res = {'domain': {'invoice_id': [('id','in',invoices)]}}
3894+ #~ return res
3895
3896 def on_change_amount(self, cr, uid, ids, tax_id, base_amount, tax_amount,
3897 context=None):
3898
3899=== modified file 'l10n_ve_sale_purchase/__init__.py'
3900--- l10n_ve_sale_purchase/__init__.py 2013-11-18 23:18:43 +0000
3901+++ l10n_ve_sale_purchase/__init__.py 2014-10-11 00:06:17 +0000
3902@@ -5,7 +5,7 @@
3903 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
3904 # All Rights Reserved
3905 ###############Credits######################################################
3906-# Coded by: Israel Fermín Montilla <israel@openerp.com.ve>
3907+# Coded by: Israel Fermín Montilla <israel@openerp.com.ve>
3908 # Planified by: Nhomar Hernandez
3909 # Audited by: Vauxoo C.A.
3910 #############################################################################
3911@@ -22,4 +22,4 @@
3912 # You should have received a copy of the GNU Affero General Public License
3913 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3914 ################################################################################
3915-import model
3916+from . import model
3917
3918=== modified file 'l10n_ve_sale_purchase/__openerp__.py'
3919--- l10n_ve_sale_purchase/__openerp__.py 2013-11-18 23:18:43 +0000
3920+++ l10n_ve_sale_purchase/__openerp__.py 2014-10-11 00:06:17 +0000
3921@@ -5,7 +5,7 @@
3922 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
3923 # All Rights Reserved
3924 ###############Credits######################################################
3925-# Coded by: Israel Fermín Montilla <israel@openerp.com.ve>
3926+# Coded by: Israel Fermín Montilla <israel@openerp.com.ve>
3927 # Planified by: Nhomar Hernandez
3928 # Audited by: Vauxoo C.A.
3929 #############################################################################
3930
3931=== modified file 'l10n_ve_sale_purchase/model/__init__.py'
3932--- l10n_ve_sale_purchase/model/__init__.py 2013-11-18 23:18:43 +0000
3933+++ l10n_ve_sale_purchase/model/__init__.py 2014-10-11 00:06:17 +0000
3934@@ -5,7 +5,7 @@
3935 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
3936 # All Rights Reserved
3937 ###############Credits######################################################
3938-# Coded by: Israel Fermín Montilla <israel@openerp.com.ve>
3939+# Coded by: Israel Fermín Montilla <israel@openerp.com.ve>
3940 # Planified by: Nhomar Hernandez
3941 # Audited by: Vauxoo C.A.
3942 #############################################################################
3943@@ -22,7 +22,7 @@
3944 # You should have received a copy of the GNU Affero General Public License
3945 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3946 ################################################################################
3947-import stock
3948-import purchase
3949-import sale
3950-import product
3951+from . import stock
3952+from . import purchase
3953+from . import sale
3954+from . import product
3955
3956=== modified file 'l10n_ve_sale_purchase/model/product.py'
3957--- l10n_ve_sale_purchase/model/product.py 2013-11-18 23:18:43 +0000
3958+++ l10n_ve_sale_purchase/model/product.py 2014-10-11 00:06:17 +0000
3959@@ -25,35 +25,31 @@
3960 # You should have received a copy of the GNU Affero General Public License
3961 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3962 ##############################################################################
3963-from openerp.osv import osv
3964-from openerp.osv import fields
3965+from openerp.osv import osv, fields
3966 from openerp.tools.translate import _
3967-from openerp.tools import config
3968-import time
3969-import datetime
3970+
3971
3972 class product_template(osv.osv):
3973
3974 _inherit = "product.template"
3975
3976 _columns = {
3977- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Concept Withholding Income to apply to the service", required=False),
3978+ 'concept_id': fields.many2one('islr.wh.concept', 'Withhold Concept', help="Concept Withholding Income to apply to the service", required=False),
3979 }
3980
3981+
3982 class product_product(osv.osv):
3983 _inherit = "product.product"
3984-
3985+
3986 def onchange_product_type(self, cr, uid, ids, prd_type, context=None):
3987 """ Function that adds a default concept for products that are not service
3988 """
3989- domain = {}
3990 if prd_type != 'service':
3991 concept_obj = self.pool.get('islr.wh.concept')
3992- concept_id = concept_obj.search(cr, uid, [('withholdable','=',False)],context=context)
3993+ concept_id = concept_obj.search(cr, uid, [('withholdable', '=', False)], context=context)
3994 if concept_id:
3995- return {'value' : {'concept_id':concept_id[0]}}
3996+ return {'value': {'concept_id': concept_id[0]}}
3997 else:
3998- raise osv.except_osv(_('Invalid action !'),_("Must create the concept of income withholding"))
3999- return {'value' : {'concept_id':False} ,
4000- 'domain' :{'concept_id':[('withholdable','=',True)]}} ,
4001-
4002+ raise osv.except_osv(_('Invalid action !'), _("Must create the concept of income withholding"))
4003+ return {'value': {'concept_id': False},
4004+ 'domain': {'concept_id': [('withholdable', '=', True)]}},
4005
4006=== modified file 'l10n_ve_sale_purchase/model/purchase.py'
4007--- l10n_ve_sale_purchase/model/purchase.py 2013-11-18 23:18:43 +0000
4008+++ l10n_ve_sale_purchase/model/purchase.py 2014-10-11 00:06:17 +0000
4009@@ -7,7 +7,7 @@
4010 ###############Credits######################################################
4011 # Coded by: Humberto Arocha <humberto@openerp.com.ve>
4012 # Maria Gabriela Quilarque <gabrielaquilarque97@gmail.com>
4013-# Javier Duran <javier@vauxoo.com>
4014+# Javier Duran <javier@vauxoo.com>
4015 # Planified by: Nhomar Hernandez
4016 # Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
4017 # Audited by: Humberto Arocha humberto@openerp.com.ve
4018@@ -25,43 +25,41 @@
4019 # You should have received a copy of the GNU Affero General Public License
4020 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4021 ##############################################################################
4022-from openerp.osv import osv
4023-from openerp.osv import fields
4024-from openerp.tools.translate import _
4025-from openerp.tools import config
4026-import time
4027-import datetime
4028+from openerp.osv import osv, fields
4029+
4030
4031 class purchase_order_line(osv.osv):
4032-
4033- _inherit ="purchase.order.line"
4034+
4035+ _inherit = "purchase.order.line"
4036
4037 _columns = {
4038- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Withhold concept associated with this rate",required=False),
4039+ 'concept_id': fields.many2one('islr.wh.concept', 'Withhold Concept', help="Withhold concept associated with this rate", required=False),
4040 }
4041-
4042+
4043 def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False, fiscal_position=False, date_planned=False, name=False, price_unit=False, notes=False):
4044 """ This method loads the withholding concept to a product automatically
4045- """
4046+ """
4047 def get_concept():
4048 concept_obj = self.pool.get('islr.wh.concept')
4049- concept_id = concept_obj.search(cr, uid, [('withholdable','=',False)])
4050+ concept_id = concept_obj.search(cr, uid, [('withholdable', '=', False)])
4051 return concept_id and concept_id[0] or False
4052 res = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order, fiscal_position, date_planned, name, price_unit, notes)
4053 if not product:
4054 concept_id = get_concept()
4055 if concept_id:
4056- res['value']['concept_id']=concept_id
4057+ res['value']['concept_id'] = concept_id
4058 return res
4059 prod_brw = self.pool.get('product.product').browse(cr, uid, product)
4060 res['value']['concept_id'] = prod_brw.concept_id and prod_brw.concept_id.id or get_concept()
4061 return res
4062+
4063+
4064 class purchase_order(osv.osv):
4065 _inherit = 'purchase.order'
4066-
4067+
4068 def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
4069 """ Update concept_id field to the prepare line
4070 """
4071- data = super(purchase_order, self)._prepare_inv_line( cr, uid, account_id, order_line, context=context)
4072- data.update({'concept_id':order_line and order_line.concept_id and order_line.concept_id.id })
4073+ data = super(purchase_order, self)._prepare_inv_line(cr, uid, account_id, order_line, context=context)
4074+ data.update({'concept_id': order_line and order_line.concept_id and order_line.concept_id.id})
4075 return data
4076
4077=== modified file 'l10n_ve_sale_purchase/model/sale.py'
4078--- l10n_ve_sale_purchase/model/sale.py 2013-11-18 23:18:43 +0000
4079+++ l10n_ve_sale_purchase/model/sale.py 2014-10-11 00:06:17 +0000
4080@@ -7,7 +7,7 @@
4081 ###############Credits######################################################
4082 # Coded by: Humberto Arocha <humberto@openerp.com.ve>
4083 # Maria Gabriela Quilarque <gabrielaquilarque97@gmail.com>
4084-# Javier Duran <javier@vauxoo.com>
4085+# Javier Duran <javier@vauxoo.com>
4086 # Planified by: Nhomar Hernandez
4087 # Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
4088 # Audited by: Humberto Arocha humberto@openerp.com.ve
4089@@ -25,20 +25,16 @@
4090 # You should have received a copy of the GNU Affero General Public License
4091 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4092 ##############################################################################
4093-from openerp.osv import osv
4094-from openerp.osv import fields
4095-from openerp.tools.translate import _
4096-from openerp.tools import config
4097-import time
4098-import datetime
4099+from openerp.osv import osv, fields
4100+
4101
4102 class sale_order_line(osv.osv):
4103 _inherit = "sale.order.line"
4104
4105 _columns = {
4106- 'concept_id': fields.many2one('islr.wh.concept','Withhold Concept',help="Withhold concept associated with this rate",required=False),
4107+ 'concept_id': fields.many2one('islr.wh.concept', 'Withhold Concept', help="Withhold concept associated with this rate", required=False),
4108 }
4109-
4110+
4111 # def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,uom=False, qty_uos=0, uos=False, name='', partner_id=False,lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False):
4112 # def get_concept():
4113 # concept_obj = self.pool.get('islr.wh.concept')
4114@@ -61,8 +57,8 @@
4115 create_ids = super(sale_order_line, self).invoice_line_create(cr, uid, ids, context)
4116 invoice_line_brws = self.pool.get('account.invoice.line').browse(cr, uid, create_ids)
4117 order_line_sale_brws = self.pool.get('sale.order.line').browse(cr, uid, ids)
4118- for line_invoice in invoice_line_brws: #lineas de la factura
4119- for line_sale in order_line_sale_brws: #lineas de la orden de venta
4120- if line_sale.product_id==line_invoice.product_id: #si es la misma linea
4121- self.pool.get('account.invoice.line').write(cr, uid, line_invoice.id, {'concept_id':line_sale.concept_id.id})
4122- return create_ids
4123+ for line_invoice in invoice_line_brws: # lineas de la factura
4124+ for line_sale in order_line_sale_brws: # lineas de la orden de venta
4125+ if line_sale.product_id == line_invoice.product_id: # si es la misma linea
4126+ self.pool.get('account.invoice.line').write(cr, uid, line_invoice.id, {'concept_id': line_sale.concept_id.id})
4127+ return create_ids
4128
4129=== modified file 'l10n_ve_sale_purchase/model/stock.py'
4130--- l10n_ve_sale_purchase/model/stock.py 2013-11-18 23:18:43 +0000
4131+++ l10n_ve_sale_purchase/model/stock.py 2014-10-11 00:06:17 +0000
4132@@ -25,25 +25,22 @@
4133 # You should have received a copy of the GNU Affero General Public License
4134 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4135 ##############################################################################
4136-from openerp.osv import osv
4137-from openerp.osv import fields
4138-from openerp.tools.translate import _
4139-from openerp.tools import config
4140-import time
4141+from openerp.osv import osv, fields
4142+
4143
4144 class stock_picking(osv.osv):
4145 _inherit = 'stock.picking'
4146- def action_invoice_create(self, cursor, user, ids, journal_id=False,group=False, type='out_invoice', context=None):
4147- """ Function that adds the concept of retention to the invoice_lines from
4148+
4149+ def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None):
4150+ """ Function that adds the concept of retention to the invoice_lines from
4151 a purchase order or sales order with billing method from picking list
4152 """
4153 if context is None:
4154 context = {}
4155 data = super(stock_picking, self).action_invoice_create(cursor, user, ids, journal_id, group, type, context)
4156- picking_id=data.keys()[0]
4157- invoice_id=data[picking_id]
4158+ picking_id = data.keys()[0]
4159+ invoice_id = data[picking_id]
4160 invoice_brw = self.pool.get('account.invoice').browse(cursor, user, invoice_id)
4161- picking_brw=self.browse(cursor, user, picking_id)
4162 invoice_line_obj = self.pool.get('account.invoice.line')
4163 for l in invoice_brw.invoice_line:
4164 invoice_line_obj.write(cursor, user, l.id, {'concept_id':
4165@@ -51,7 +48,5 @@
4166 return data
4167
4168 _columns = {
4169- 'nro_ctrl': fields.char('Invoice ref.', size=32, readonly=True, states={'draft':[('readonly',False)]}, help="Invoice reference"),
4170+ 'nro_ctrl': fields.char('Invoice ref.', size=32, readonly=True, states={'draft': [('readonly', False)]}, help="Invoice reference"),
4171 }
4172-
4173-
4174
4175=== modified file 'l10n_ve_split_invoice/__init__.py'
4176--- l10n_ve_split_invoice/__init__.py 2013-11-18 09:24:59 +0000
4177+++ l10n_ve_split_invoice/__init__.py 2014-10-11 00:06:17 +0000
4178@@ -22,4 +22,4 @@
4179 # You should have received a copy of the GNU Affero General Public License
4180 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4181 ##############################################################################
4182-import model
4183+from . import model
4184
4185=== modified file 'l10n_ve_split_invoice/model/__init__.py'
4186--- l10n_ve_split_invoice/model/__init__.py 2013-11-18 09:24:59 +0000
4187+++ l10n_ve_split_invoice/model/__init__.py 2014-10-11 00:06:17 +0000
4188@@ -22,7 +22,7 @@
4189 # You should have received a copy of the GNU Affero General Public License
4190 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4191 ##############################################################################
4192-import installer
4193-import res_company
4194-import invoice
4195+from . import installer
4196+from . import res_company
4197+from . import invoice
4198
4199
4200=== modified file 'l10n_ve_split_invoice/model/installer.py'
4201--- l10n_ve_split_invoice/model/installer.py 2013-11-18 09:24:59 +0000
4202+++ l10n_ve_split_invoice/model/installer.py 2014-10-11 00:06:17 +0000
4203@@ -5,7 +5,7 @@
4204 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
4205 # All Rights Reserved
4206 ###############Credits######################################################
4207-# Coded by: Vauxoo C.A.
4208+# Coded by: Vauxoo C.A.
4209 # Planified by: Nhomar Hernandez
4210 # Audited by: Vauxoo C.A.
4211 #############################################################################
4212@@ -22,18 +22,19 @@
4213 # You should have received a copy of the GNU Affero General Public License
4214 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4215 ################################################################################
4216-from openerp.osv import osv
4217-from openerp.osv import fields
4218+from openerp.osv import osv, fields
4219 from openerp.tools.translate import _
4220 import base64
4221 import openerp.addons as addons
4222
4223+
4224 class split_invoice_config(osv.osv_memory):
4225+
4226 """ Fiscal Requirements installer wizard
4227 """
4228 _name = 'split.invoice.config'
4229 _inherit = 'res.config'
4230- _description= __doc__
4231+ _description = __doc__
4232
4233 def default_get(self, cr, uid, fields_list=None, context=None):
4234 """ Default value to the config_logo field
4235@@ -47,18 +48,18 @@
4236 """ In this method I will configure the maximum number of lines in your invoices.
4237 """
4238 wiz_data = self.browse(cr, uid, ids[0])
4239- if wiz_data.name < 1 :
4240- raise osv.except_osv(_('Error !'), _('The number of customer invoice lines must be at least one'))
4241+ if wiz_data.name < 1:
4242+ raise osv.except_osv(_('Error !'), _('The number of customer invoice lines must be at least one'))
4243 company = self.pool.get('res.users').browse(cr, uid, uid).company_id
4244 company_obj = self.pool.get('res.company')
4245- company_id = company_obj.search(cr,uid,[('id','=',company.id)])
4246+ company_id = company_obj.search(cr, uid, [('id', '=', company.id)])
4247 data = {'lines_invoice': wiz_data.name}
4248 company_obj.write(cr, uid, company_id, data)
4249
4250 _columns = {
4251- 'name': fields.integer('Max Invoice Lines',required=True, help='Select the maximum number of lines in your customer invoices'),
4252+ 'name': fields.integer('Max Invoice Lines', required=True, help='Select the maximum number of lines in your customer invoices'),
4253 }
4254- _defaults={
4255+ _defaults = {
4256 'name': 50,
4257 }
4258 split_invoice_config()
4259
4260=== modified file 'l10n_ve_split_invoice/model/invoice.py'
4261--- l10n_ve_split_invoice/model/invoice.py 2014-02-19 04:36:23 +0000
4262+++ l10n_ve_split_invoice/model/invoice.py 2014-10-11 00:06:17 +0000
4263@@ -23,10 +23,10 @@
4264 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4265 ##############################################################################
4266 from openerp.osv import osv
4267-from openerp.osv import fields
4268 from openerp.tools.translate import _
4269 from openerp import netsvc
4270
4271+
4272 class account_invoice(osv.osv):
4273 _inherit = 'account.invoice'
4274
4275@@ -34,13 +34,13 @@
4276 """ Split the invoice when the lines exceed the maximum set for the company
4277 """
4278 for inv in self.browse(cr, uid, ids):
4279- inv_id =False
4280+ inv_id = False
4281 if inv.company_id.lines_invoice < 1:
4282 raise osv.except_osv(_('Error !'), _('Please set an invoice lines value in:\nAdministration->Company->Configuration->Invoice lines'))
4283- if inv.type in ["out_invoice","out_refund"]:
4284- if len(inv.invoice_line)> inv.company_id.lines_invoice:
4285+ if inv.type in ["out_invoice", "out_refund"]:
4286+ if len(inv.invoice_line) > inv.company_id.lines_invoice:
4287 lst = []
4288- invoice = self.read(cr, uid, inv.id, ['name', 'type', 'number', 'supplier_invoice_number', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'period_id', "user_id"])
4289+ invoice = self.read(cr, uid, inv.id, ['name', 'type', 'number', 'supplier_invoice_number', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'period_id', "user_id"])
4290 invoice.update({
4291 'state': 'draft',
4292 'number': False,
4293@@ -49,16 +49,16 @@
4294 })
4295 # take the id part of the tuple returned for many2one fields
4296 invoice.pop('id', None)
4297- for field in ( 'partner_id',
4298- 'account_id', 'currency_id', 'payment_term', 'journal_id', 'period_id','user_id'):
4299+ for field in ('partner_id',
4300+ 'account_id', 'currency_id', 'payment_term', 'journal_id', 'period_id', 'user_id'):
4301 invoice[field] = invoice[field] and invoice[field][0]
4302-
4303+
4304 #~ if hasattr(inv,'sale_ids'):
4305 #~ if self.browse(cr,uid,inv.id,context={}).sale_ids:
4306- #~ invoice.update({
4307- #~ 'sale_ids':[(6,0,[i.id for i in self.browse(cr,uid,inv.id,context={}).sale_ids])]
4308- #~ })
4309-
4310+ #~ invoice.update({
4311+ #~ 'sale_ids':[(6,0,[i.id for i in self.browse(cr,uid,inv.id,context={}).sale_ids])]
4312+ #~ })
4313+
4314 inv_id = self.create(cr, uid, invoice)
4315 cont = 0
4316 lst = inv.invoice_line
4317@@ -66,10 +66,9 @@
4318 lst.pop(0)
4319 cont += 1
4320 for il in lst:
4321- self.pool.get('account.invoice.line').write(cr,uid,il.id,{'invoice_id':inv_id})
4322+ self.pool.get('account.invoice.line').write(cr, uid, il.id, {'invoice_id': inv_id})
4323 self.button_compute(cr, uid, [inv.id], set_total=True)
4324 if inv_id:
4325- wf_service = netsvc.LocalService("workflow")
4326 self.button_compute(cr, uid, [inv_id], set_total=True)
4327 # wf_service.trg_validate(uid, 'account.invoice', inv_id, 'invoice_open', cr)
4328 return True
4329@@ -77,8 +76,8 @@
4330 def action_date_assign(self, cr, uid, ids, *args):
4331 """ Return assigned dat
4332 """
4333- data = super(account_invoice, self).action_date_assign(cr, uid, ids, *args)
4334- self.split_invoice(cr,uid,ids)
4335+ super(account_invoice, self).action_date_assign(cr, uid, ids, *args)
4336+ self.split_invoice(cr, uid, ids)
4337 return True
4338
4339 account_invoice()
4340
4341=== modified file 'l10n_ve_split_invoice/model/res_company.py'
4342--- l10n_ve_split_invoice/model/res_company.py 2013-11-18 09:24:59 +0000
4343+++ l10n_ve_split_invoice/model/res_company.py 2014-10-11 00:06:17 +0000
4344@@ -22,19 +22,18 @@
4345 # You should have received a copy of the GNU Affero General Public License
4346 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4347 ##############################################################################
4348-from openerp.osv import osv
4349-from openerp.osv import fields
4350-from openerp.tools.translate import _
4351+from openerp.osv import osv, fields
4352+
4353
4354 class res_company(osv.osv):
4355 _inherit = 'res.company'
4356
4357 _columns = {
4358- 'lines_invoice':fields.integer('Invoice Lines',required=False, help="Number of lines per invoice"),
4359+ 'lines_invoice': fields.integer('Invoice Lines', required=False, help="Number of lines per invoice"),
4360 }
4361
4362 _defaults = {
4363- 'lines_invoice':50,
4364- }
4365+ 'lines_invoice': 50,
4366+ }
4367
4368 res_company()
4369
4370=== modified file 'l10n_ve_vat_write_off/__init__.py'
4371--- l10n_ve_vat_write_off/__init__.py 2013-05-02 17:01:41 +0000
4372+++ l10n_ve_vat_write_off/__init__.py 2014-10-11 00:06:17 +0000
4373@@ -1,1 +1,1 @@
4374-import model
4375+from . import model
4376
4377=== modified file 'l10n_ve_vat_write_off/__openerp__.py'
4378--- l10n_ve_vat_write_off/__openerp__.py 2014-02-18 21:58:17 +0000
4379+++ l10n_ve_vat_write_off/__openerp__.py 2014-10-11 00:06:17 +0000
4380@@ -1,4 +1,4 @@
4381-{
4382+{
4383 "name" : "VAT Write Off",
4384 "version" : "0.5",
4385 "depends" : ["l10n_ve_fiscal_book",
4386
4387=== modified file 'l10n_ve_vat_write_off/model/__init__.py'
4388--- l10n_ve_vat_write_off/model/__init__.py 2013-03-13 21:07:18 +0000
4389+++ l10n_ve_vat_write_off/model/__init__.py 2014-10-11 00:06:17 +0000
4390@@ -1,1 +1,1 @@
4391-import l10n_ve_vat_write_off
4392+from . import l10n_ve_vat_write_off
4393
4394=== modified file 'l10n_ve_vat_write_off/model/l10n_ve_vat_write_off.py'
4395--- l10n_ve_vat_write_off/model/l10n_ve_vat_write_off.py 2013-05-06 18:55:10 +0000
4396+++ l10n_ve_vat_write_off/model/l10n_ve_vat_write_off.py 2014-10-11 00:06:17 +0000
4397@@ -1,156 +1,156 @@
4398 from openerp.osv import fields, osv
4399-from datetime import datetime, timedelta
4400+
4401
4402 class vat_write_off(osv.osv):
4403 _description = ''
4404 _name = 'vat.write.off'
4405 _columns = {
4406- 'company_id':fields.many2one('res.company','Company',
4407- help='Company',required=True),
4408- 'period_id':fields.many2one('account.period','Period',
4409- help="Book's Fiscal Period",required=True),
4410- 'state': fields.selection([('draft','Getting Ready'),
4411- ('open','Approved by Manager'),('done','Seniat Submitted')],
4412+ 'company_id': fields.many2one('res.company', 'Company',
4413+ help='Company', required=True),
4414+ 'period_id': fields.many2one('account.period', 'Period',
4415+ help="Book's Fiscal Period", required=True),
4416+ 'state': fields.selection([('draft', 'Getting Ready'),
4417+ ('open', 'Approved by Manager'), ('done', 'Seniat Submitted')],
4418 string='Status', required=True),
4419- 'purchase_fb_id':fields.many2one('fiscal.book', 'Purchase Fiscal Book',
4420+ 'purchase_fb_id': fields.many2one('fiscal.book', 'Purchase Fiscal Book',
4421 help='Purchase Fiscal Book'),
4422- 'p_do_general_vat_base_sum' : fields.related('purchase_fb_id',
4423- 'do_general_vat_base_sum',
4424- type="float",
4425- readonly=True,
4426- store=True,),
4427- 'p_do_general_vat_tax_sum' : fields.related('purchase_fb_id',
4428- 'do_general_vat_tax_sum',
4429+ 'p_do_general_vat_base_sum': fields.related('purchase_fb_id',
4430+ 'do_general_vat_base_sum',
4431 type="float",
4432 readonly=True,
4433 store=True,),
4434- 'p_do_additional_vat_base_sum' : fields.related('purchase_fb_id',
4435- 'do_additional_vat_base_sum',
4436- type="float",
4437- readonly=True,
4438- store=True,),
4439- 'p_do_additional_vat_tax_sum' : fields.related('purchase_fb_id',
4440- 'do_additional_vat_tax_sum',
4441- type="float",
4442- readonly=True,
4443- store=True,),
4444- 'p_do_reduced_vat_base_sum' : fields.related('purchase_fb_id',
4445- 'do_reduced_vat_base_sum',
4446+ 'p_do_general_vat_tax_sum': fields.related('purchase_fb_id',
4447+ 'do_general_vat_tax_sum',
4448+ type="float",
4449+ readonly=True,
4450+ store=True,),
4451+ 'p_do_additional_vat_base_sum': fields.related('purchase_fb_id',
4452+ 'do_additional_vat_base_sum',
4453+ type="float",
4454+ readonly=True,
4455+ store=True,),
4456+ 'p_do_additional_vat_tax_sum': fields.related('purchase_fb_id',
4457+ 'do_additional_vat_tax_sum',
4458 type="float",
4459 readonly=True,
4460 store=True,),
4461- 'p_do_reduced_vat_tax_sum' : fields.related('purchase_fb_id',
4462- 'do_reduced_vat_tax_sum',
4463+ 'p_do_reduced_vat_base_sum': fields.related('purchase_fb_id',
4464+ 'do_reduced_vat_base_sum',
4465 type="float",
4466 readonly=True,
4467 store=True,),
4468- 'p_tax_amount' : fields.related('purchase_fb_id',
4469+ 'p_do_reduced_vat_tax_sum': fields.related('purchase_fb_id',
4470+ 'do_reduced_vat_tax_sum',
4471+ type="float",
4472+ readonly=True,
4473+ store=True,),
4474+ 'p_tax_amount': fields.related('purchase_fb_id',
4475 'tax_amount',
4476 type="float",
4477 readonly=True,
4478 store=True,),
4479- 'sale_fb_id':fields.many2one('fiscal.book', 'Sale Fiscal Book',
4480+ 'sale_fb_id': fields.many2one('fiscal.book', 'Sale Fiscal Book',
4481 help='Sale Fiscal Book'),
4482- 's_do_sdcf_and_exempt_sum' : fields.related('sale_fb_id',
4483+ 's_do_sdcf_and_exempt_sum': fields.related('sale_fb_id',
4484 'do_sdcf_and_exempt_sum',
4485 type="float",
4486 readonly=True,
4487 store=True,),
4488- 's_imex_vat_base_sum' : fields.related('sale_fb_id',
4489- 'imex_vat_base_sum',
4490- type="float",
4491- readonly=True,
4492- store=True,),
4493- 's_get_vat_sdcf_sum' : fields.related('sale_fb_id',
4494+ 's_imex_vat_base_sum': fields.related('sale_fb_id',
4495+ 'imex_vat_base_sum',
4496+ type="float",
4497+ readonly=True,
4498+ store=True,),
4499+ 's_get_vat_sdcf_sum': fields.related('sale_fb_id',
4500 'get_vat_sdcf_sum',
4501 type="float",
4502 readonly=True,
4503 store=True,),
4504- 's_imex_general_vat_base_sum' : fields.related('sale_fb_id',
4505+ 's_imex_general_vat_base_sum': fields.related('sale_fb_id',
4506 'imex_general_vat_base_sum',
4507 type="float",
4508 readonly=True,
4509 store=True,),
4510- 's_imex_general_vat_tax_sum' : fields.related('sale_fb_id',
4511+ 's_imex_general_vat_tax_sum': fields.related('sale_fb_id',
4512 'imex_general_vat_tax_sum',
4513 type="float",
4514 readonly=True,
4515 store=True),
4516- 's_imex_additional_vat_base_sum' : fields.related('sale_fb_id',
4517- 'imex_additional_vat_base_sum',
4518- type="float",
4519- readonly=True,
4520- store=True),
4521- 's_imex_additional_vat_tax_sum' : fields.related('sale_fb_id',
4522- 'imex_additional_vat_tax_sum',
4523- type="float",
4524- readonly=True,
4525- store=True),
4526- 's_imex_reduced_vat_base_sum' : fields.related('sale_fb_id',
4527- 'imex_reduced_vat_base_sum',
4528- type="float",
4529- readonly=True,
4530- store=True),
4531- 's_imex_reduced_vat_tax_sum' : fields.related('sale_fb_id',
4532- 'imex_reduced_vat_tax_sum',
4533- type="float",
4534- readonly=True,
4535- store=True),
4536- 's_do_general_vat_base_sum' : fields.related('sale_fb_id',
4537- 'do_general_vat_base_sum',
4538- type="float",
4539- readonly=True,
4540- store=True),
4541- 's_do_general_vat_tax_sum' : fields.related('sale_fb_id',
4542- 'do_general_vat_tax_sum',
4543- type="float",
4544- readonly=True,
4545- store=True),
4546- 's_do_additional_vat_base_sum' : fields.related('sale_fb_id',
4547- 'do_additional_vat_base_sum',
4548- type="float",
4549- readonly=True,
4550- store=True),
4551- 's_do_additional_vat_tax_sum' : fields.related('sale_fb_id',
4552- 'do_additional_vat_tax_sum',
4553+ 's_imex_additional_vat_base_sum': fields.related('sale_fb_id',
4554+ 'imex_additional_vat_base_sum',
4555 type="float",
4556 readonly=True,
4557 store=True),
4558- 's_do_reduced_vat_base_sum' : fields.related('sale_fb_id',
4559- 'do_reduced_vat_base_sum',
4560- type="float",
4561- readonly=True,
4562- store=True),
4563- 's_do_reduced_vat_tax_sum' : fields.related('sale_fb_id',
4564- 'do_reduced_vat_tax_sum',
4565- type="float",
4566- readonly=True,
4567- store=True),
4568- 's_base_amount' : fields.related('sale_fb_id',
4569+ 's_imex_additional_vat_tax_sum': fields.related('sale_fb_id',
4570+ 'imex_additional_vat_tax_sum',
4571+ type="float",
4572+ readonly=True,
4573+ store=True),
4574+ 's_imex_reduced_vat_base_sum': fields.related('sale_fb_id',
4575+ 'imex_reduced_vat_base_sum',
4576+ type="float",
4577+ readonly=True,
4578+ store=True),
4579+ 's_imex_reduced_vat_tax_sum': fields.related('sale_fb_id',
4580+ 'imex_reduced_vat_tax_sum',
4581+ type="float",
4582+ readonly=True,
4583+ store=True),
4584+ 's_do_general_vat_base_sum': fields.related('sale_fb_id',
4585+ 'do_general_vat_base_sum',
4586+ type="float",
4587+ readonly=True,
4588+ store=True),
4589+ 's_do_general_vat_tax_sum': fields.related('sale_fb_id',
4590+ 'do_general_vat_tax_sum',
4591+ type="float",
4592+ readonly=True,
4593+ store=True),
4594+ 's_do_additional_vat_base_sum': fields.related('sale_fb_id',
4595+ 'do_additional_vat_base_sum',
4596+ type="float",
4597+ readonly=True,
4598+ store=True),
4599+ 's_do_additional_vat_tax_sum': fields.related('sale_fb_id',
4600+ 'do_additional_vat_tax_sum',
4601+ type="float",
4602+ readonly=True,
4603+ store=True),
4604+ 's_do_reduced_vat_base_sum': fields.related('sale_fb_id',
4605+ 'do_reduced_vat_base_sum',
4606+ type="float",
4607+ readonly=True,
4608+ store=True),
4609+ 's_do_reduced_vat_tax_sum': fields.related('sale_fb_id',
4610+ 'do_reduced_vat_tax_sum',
4611+ type="float",
4612+ readonly=True,
4613+ store=True),
4614+ 's_base_amount': fields.related('sale_fb_id',
4615 'base_amount',
4616 type="float",
4617 readonly=True,
4618 store=True),
4619- 's_tax_amount' : fields.related('sale_fb_id',
4620+ 's_tax_amount': fields.related('sale_fb_id',
4621 'tax_amount',
4622 type="float",
4623 readonly=True,
4624 store=True),
4625- 'start_date' : fields.date(string='Start date'),
4626+ 'start_date': fields.date(string='Start date'),
4627
4628- 'vat' : fields.related('company_id',
4629- 'partner_id',
4630- 'vat',
4631- type='char',
4632- string='TIN',
4633- readonly=True,
4634- store=True),
4635+ 'vat': fields.related('company_id',
4636+ 'partner_id',
4637+ 'vat',
4638+ type='char',
4639+ string='TIN',
4640+ readonly=True,
4641+ store=True),
4642
4643
4644 }
4645 _defaults = {
4646 'state': 'draft',
4647- 'company_id': lambda s,c,u,ctx: \
4648- s.pool.get('res.users').browse(c,u,u,context=ctx).company_id.id,
4649+ 'company_id': lambda s, c, u, ctx:
4650+ s.pool.get('res.users').browse(c, u, u, context=ctx).company_id.id,
4651 'start_date': fields.date.today,
4652 }
4653
4654=== modified file 'l10n_ve_withholding/__init__.py'
4655--- l10n_ve_withholding/__init__.py 2012-12-05 10:06:09 +0000
4656+++ l10n_ve_withholding/__init__.py 2014-10-11 00:06:17 +0000
4657@@ -5,7 +5,7 @@
4658 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
4659 # All Rights Reserved
4660 ###############Credits######################################################
4661-# Coded by: Vauxoo C.A.
4662+# Coded by: Vauxoo C.A.
4663 # Planified by: Nhomar Hernandez
4664 # Audited by: Vauxoo C.A.
4665 #############################################################################
4666@@ -23,6 +23,6 @@
4667 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4668 ################################################################################
4669
4670-import model
4671+from . import model
4672
4673 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4674
4675=== modified file 'l10n_ve_withholding/__openerp__.py'
4676--- l10n_ve_withholding/__openerp__.py 2013-11-26 01:24:05 +0000
4677+++ l10n_ve_withholding/__openerp__.py 2014-10-11 00:06:17 +0000
4678@@ -5,7 +5,7 @@
4679 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
4680 # All Rights Reserved
4681 ###############Credits######################################################
4682-# Coded by: javier@vauxoo.com
4683+# Coded by: javier@vauxoo.com
4684 # Planified by: Nhomar Hernandez
4685 # Audited by: Vauxoo C.A.
4686 #############################################################################
4687@@ -36,14 +36,14 @@
4688 - Add common tabs on views where they will be used to add information for other modules related to Venezuela. localization.
4689
4690 TODO:
4691--
4692+-
4693 """,
4694 'init_xml': [],
4695 "depends" : ["l10n_ve_fiscal_requirements"],
4696 'update_xml': [
4697 'security/withholding_security.xml',
4698- 'security/ir.model.access.csv',
4699- 'data/l10n_ve_withholding_data.xml',
4700+ 'security/ir.model.access.csv',
4701+ 'data/l10n_ve_withholding_data.xml',
4702 'view/l10n_ve_withholding_view.xml',
4703 'workflow/wh_action_server.xml',
4704 ],
4705
4706=== modified file 'l10n_ve_withholding/model/__init__.py'
4707--- l10n_ve_withholding/model/__init__.py 2013-05-22 20:31:12 +0000
4708+++ l10n_ve_withholding/model/__init__.py 2014-10-11 00:06:17 +0000
4709@@ -5,7 +5,7 @@
4710 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
4711 # All Rights Reserved
4712 ###############Credits######################################################
4713-# Coded by: Vauxoo C.A.
4714+# Coded by: Vauxoo C.A.
4715 # Planified by: Nhomar Hernandez
4716 # Audited by: Vauxoo C.A.
4717 #############################################################################
4718@@ -23,7 +23,7 @@
4719 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4720 ################################################################################
4721
4722-import account
4723-import invoice
4724+from . import account
4725+from . import invoice
4726
4727 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4728
4729=== modified file 'l10n_ve_withholding/model/account.py'
4730--- l10n_ve_withholding/model/account.py 2014-07-11 17:47:27 +0000
4731+++ l10n_ve_withholding/model/account.py 2014-10-11 00:06:17 +0000
4732@@ -5,7 +5,7 @@
4733 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
4734 # All Rights Reserved
4735 ###############Credits######################################################
4736-# Coded by: Vauxoo C.A.
4737+# Coded by: Vauxoo C.A.
4738 # Planified by: Nhomar Hernandez
4739 # Audited by: Vauxoo C.A.
4740 #############################################################################
4741@@ -27,35 +27,36 @@
4742 from openerp.tools.translate import _
4743 import time
4744
4745-__TYPES__ =[('sale', 'Sale'),
4746- ('sale_refund','Sale Refund'),
4747- ('purchase', 'Purchase'),
4748- ('purchase_refund','Purchase Refund'),
4749- ('cash', 'Cash'),
4750- ('bank', 'Bank and Cheques'),
4751- ('general', 'General'),
4752- ('situation', 'Opening/Closing Situation'),
4753- ('sale_debit', 'Sale Debit'),
4754- ('purchase_debit', 'Purchase Debit'),
4755- ('iva_sale', 'Sale Wh VAT'),
4756- ('iva_purchase', 'Purchase Wh VAT'),
4757- ('islr_purchase', 'Purchase Wh Income'),
4758- ('islr_sale', 'Sale Wh Income'),
4759- ('mun_sale', 'Sale Wh County'),
4760- ('mun_purchase', 'Purchase Wh County'),
4761- ('src_sale', 'Sale Wh src'),
4762- ('src_purchase', 'Purchase Wh src')]
4763+__TYPES__ = [('sale', 'Sale'),
4764+ ('sale_refund', 'Sale Refund'),
4765+ ('purchase', 'Purchase'),
4766+ ('purchase_refund', 'Purchase Refund'),
4767+ ('cash', 'Cash'),
4768+ ('bank', 'Bank and Cheques'),
4769+ ('general', 'General'),
4770+ ('situation', 'Opening/Closing Situation'),
4771+ ('sale_debit', 'Sale Debit'),
4772+ ('purchase_debit', 'Purchase Debit'),
4773+ ('iva_sale', 'Sale Wh VAT'),
4774+ ('iva_purchase', 'Purchase Wh VAT'),
4775+ ('islr_purchase', 'Purchase Wh Income'),
4776+ ('islr_sale', 'Sale Wh Income'),
4777+ ('mun_sale', 'Sale Wh County'),
4778+ ('mun_purchase', 'Purchase Wh County'),
4779+ ('src_sale', 'Sale Wh src'),
4780+ ('src_purchase', 'Purchase Wh src')]
4781+
4782
4783 class account_journal(osv.osv):
4784 _inherit = 'account.journal'
4785-
4786- _columns = {'type': fields.selection(__TYPES__, 'Type', size=32, required=True,
4787- help = "Select 'Sale' for customer invoices journals."\
4788- " Select 'Purchase' for supplier invoices journals."\
4789- " Select 'Cash' or 'Bank' for journals that are used in customer or supplier payments."\
4790- " Select 'General' for miscellaneous operations journals."\
4791- " Select 'Opening/Closing Situation' for entries generated for new fiscal years."\
4792- " Select 'Sale Debit' for customer debit note journals."\
4793+
4794+ _columns = {'type': fields.selection(__TYPES__, 'Type', size=32, required=True,
4795+ help="Select 'Sale' for customer invoices journals."
4796+ " Select 'Purchase' for supplier invoices journals."
4797+ " Select 'Cash' or 'Bank' for journals that are used in customer or supplier payments."
4798+ " Select 'General' for miscellaneous operations journals."
4799+ " Select 'Opening/Closing Situation' for entries generated for new fiscal years."
4800+ " Select 'Sale Debit' for customer debit note journals."
4801 " Select 'Purchase Debit' for supplier debit note journals."
4802 " Select 'Sale Wh VAT' for customer vat withholding journals."
4803 " Select 'Purchase Wh VAT' for supplier vat withholding journals."
4804@@ -65,16 +66,17 @@
4805 " Select 'Purchase Wh County' for supplier municipal withholding journals."
4806 " Select 'Sale Wh SRC' for customer social withholding journals."
4807 " Select 'Purchase Wh SRC' for supplier social withholding journals."
4808- )
4809- }
4810+ )
4811+ }
4812
4813 account_journal()
4814
4815+
4816 class account_period(osv.osv):
4817 _inherit = "account.period"
4818
4819 def _find_fortnight(self, cr, uid, dt=None, context=None):
4820- """ This Function returns a tuple composed of
4821+ """ This Function returns a tuple composed of
4822 *) period for the asked dt (int)
4823 *) fortnight for the asked dt (boolean):
4824 -) False: for the 1st. fortnight
4825@@ -82,26 +84,27 @@
4826 Example:
4827 (3,True) => a period whose id is 3 in the second fortnight
4828 """
4829- if context is None: context = {}
4830+ if context is None:
4831+ context = {}
4832 if not dt:
4833 dt = time.strftime('%Y-%m-%d')
4834- period_ids = self.find(cr,uid,dt=dt,context=context)
4835- do = [('special','=',False),('id','in',period_ids)]
4836- #Due to the fact that demo data for periods sets 'special' as True on them, this little
4837- #hack is necesary if this issue is solved we should ask directly for the
4838- #refer to this bug for more information
4839- #https://bugs.launchpad.net/openobject-addons/+bug/924200
4840+ period_ids = self.find(cr, uid, dt=dt, context=context)
4841+ do = [('special', '=', False), ('id', 'in', period_ids)]
4842+ # Due to the fact that demo data for periods sets 'special' as True on them, this little
4843+ # hack is necesary if this issue is solved we should ask directly for the
4844+ # refer to this bug for more information
4845+ # https://bugs.launchpad.net/openobject-addons/+bug/924200
4846 demo_enabled = self.pool.get('ir.module.module').search(cr, uid,
4847 [('name', '=', 'base'),
4848 ('demo', '=', True)])
4849 domain = demo_enabled and [do[1]] or do
4850- #### End of hack, dear future me I am really sorry for this....
4851- period_ids = self.search(cr, uid, domain, context = context)
4852+ # End of hack, dear future me I am really sorry for this....
4853+ period_ids = self.search(cr, uid, domain, context=context)
4854 if not period_ids:
4855- raise osv.except_osv(_('Error looking Fortnight !'), _('There is no "Special" period defined for this date: %s.')%dt)
4856-
4857- fortnight= False if time.strptime(dt, '%Y-%m-%d').tm_mday <= 15 else True
4858- return (period_ids[0],fortnight)
4859+ raise osv.except_osv(_('Error looking Fortnight !'), _('There is no "Special" period defined for this date: %s.') % dt)
4860+
4861+ fortnight = False if time.strptime(dt, '%Y-%m-%d').tm_mday <= 15 else True
4862+ return (period_ids[0], fortnight)
4863
4864 def find_fortnight(self, cr, uid, dt=None, context=None):
4865 """
4866@@ -110,7 +113,7 @@
4867 """
4868 # TODO: fix this workaround in version 8.0 [hbto notes]
4869 context = context or {}
4870- p,f = self._find_fortnight(cr, uid, dt=dt, context=context)
4871+ p, f = self._find_fortnight(cr, uid, dt=dt, context=context)
4872 return p, str(f)
4873
4874 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4875
4876=== modified file 'l10n_ve_withholding/model/invoice.py'
4877--- l10n_ve_withholding/model/invoice.py 2013-12-10 15:52:19 +0000
4878+++ l10n_ve_withholding/model/invoice.py 2014-10-11 00:06:17 +0000
4879@@ -5,7 +5,7 @@
4880 # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
4881 # All Rights Reserved
4882 ###############Credits######################################################
4883-# Coded by: Vauxoo C.A.
4884+# Coded by: Vauxoo C.A.
4885 # Planified by: Nhomar Hernandez
4886 # Audited by: Vauxoo C.A.
4887 #############################################################################
4888@@ -25,58 +25,58 @@
4889
4890 import time
4891 from openerp.osv import fields, osv
4892-from openerp.addons import decimal_precision as dp
4893 from openerp.tools.translate import _
4894
4895+
4896 class account_invoice(osv.osv):
4897 _inherit = 'account.invoice'
4898-
4899- def _get_move_lines(self, cr, uid, ids, to_wh, period_id,
4900- pay_journal_id, writeoff_acc_id,
4901- writeoff_period_id, writeoff_journal_id, date,
4902- name, context=None):
4903+
4904+ def _get_move_lines(self, cr, uid, ids, to_wh, period_id,
4905+ pay_journal_id, writeoff_acc_id,
4906+ writeoff_period_id, writeoff_journal_id, date,
4907+ name, context=None):
4908 """ Function openerp is rewritten for adaptation in
4909 the ovl
4910 """
4911- if context is None: context = {}
4912+ if context is None:
4913+ context = {}
4914 return []
4915
4916- def ret_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id,
4917- period_id, pay_journal_id, writeoff_acc_id,
4918- writeoff_period_id, writeoff_journal_id, date,
4919- name, to_wh, context=None):
4920- """ Make the payment of the invoice
4921+ def ret_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id,
4922+ period_id, pay_journal_id, writeoff_acc_id,
4923+ writeoff_period_id, writeoff_journal_id, date,
4924+ name, to_wh, context=None):
4925+ """ Make the payment of the invoice
4926 """
4927 if context is None:
4928 context = {}
4929 rp_obj = self.pool.get('res.partner')
4930-
4931- #TODO check if we can use different period for payment and the writeoff line
4932- assert len(ids)==1, "Can only pay one invoice at a time"
4933+
4934+ # TODO check if we can use different period for payment and the writeoff line
4935+ assert len(ids) == 1, "Can only pay one invoice at a time"
4936 invoice = self.browse(cr, uid, ids[0])
4937 src_account_id = invoice.account_id.id
4938-
4939+
4940 # Take the seq as name for move
4941 types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1}
4942 direction = types[invoice.type]
4943 l1 = {
4944- 'debit': direction * pay_amount>0 and direction * pay_amount,
4945- 'credit': direction * pay_amount<0 and - direction * pay_amount,
4946+ 'debit': direction * pay_amount > 0 and direction * pay_amount,
4947+ 'credit': direction * pay_amount < 0 and - direction * pay_amount,
4948 'account_id': src_account_id,
4949 'partner_id': rp_obj._find_accounting_partner(invoice.partner_id).id,
4950- 'ref':invoice.number,
4951+ 'ref': invoice.number,
4952 'date': date,
4953 'currency_id': False,
4954- 'name':name
4955+ 'name': name
4956 }
4957 lines = [(0, 0, l1)]
4958-
4959- l2 = self._get_move_lines(cr, uid, ids, to_wh, period_id,
4960- pay_journal_id, writeoff_acc_id,
4961- writeoff_period_id, writeoff_journal_id, date,
4962+
4963+ l2 = self._get_move_lines(cr, uid, ids, to_wh, period_id,
4964+ pay_journal_id, writeoff_acc_id,
4965+ writeoff_period_id, writeoff_journal_id, date,
4966 name, context=context)
4967-
4968-
4969+
4970 if not l2:
4971 raise osv.except_osv(_('Warning !'), _('No accounting moves were created.\n Please, Check if there are Taxes/Concepts to withhold in the Invoices!'))
4972 lines += l2
4973@@ -89,13 +89,13 @@
4974 line_ids = []
4975 total = 0.0
4976 line = self.pool.get('account.move.line')
4977- cr.execute('select id from account_move_line where move_id in ('+str(move_id)+','+str(invoice.move_id.id)+')')
4978- lines = line.browse(cr, uid, map(lambda x: x[0], cr.fetchall()) )
4979- for l in lines+invoice.payment_ids:
4980- if l.account_id.id==src_account_id:
4981+ cr.execute('select id from account_move_line where move_id in (' + str(move_id) + ',' + str(invoice.move_id.id) + ')')
4982+ lines = line.browse(cr, uid, map(lambda x: x[0], cr.fetchall()))
4983+ for l in lines + invoice.payment_ids:
4984+ if l.account_id.id == src_account_id:
4985 line_ids.append(l.id)
4986 total += (l.debit or 0.0) - (l.credit or 0.0)
4987- if (not round(total,self.pool.get('decimal.precision').precision_get(cr, uid, 'Withhold'))) or writeoff_acc_id:
4988+ if (not round(total, self.pool.get('decimal.precision').precision_get(cr, uid, 'Withhold'))) or writeoff_acc_id:
4989 self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context)
4990 else:
4991 self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context)
4992@@ -116,21 +116,21 @@
4993 moves = self.move_line_id_payment_get(cr, uid, [invoice.id])
4994 src = []
4995 for m in self.pool.get('account.move.line').browse(cr, uid, moves):
4996- temp_lines = []#Added temp list to avoid duplicate records
4997+ temp_lines = [] # Added temp list to avoid duplicate records
4998 if m.reconcile_id:
4999 temp_lines = [i.id for i in m.reconcile_id.line_id]
5000 elif m.reconcile_partial_id:
The diff has been truncated for viewing.