[IMP] l10n_BE: Clean

bzr revid: mra@tinyerp.com-20100402043242-29pd8u2p9v92xiot
This commit is contained in:
mra (Open ERP) 2010-04-02 10:02:42 +05:30
parent b718a0d0cd
commit 43caafbd4a
2 changed files with 10 additions and 15 deletions

View File

@ -18,10 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import datetime
import base64
from osv import osv, fields
from tools.translate import _
@ -33,8 +33,8 @@ class l10n_be_vat_declaration(osv.osv_memory):
_columns = {
'period_id': fields.many2one('account.period','Period', required=True),
'msg': fields.text('File created', size=64, readonly=True),
'file_save' : fields.binary('Save File'),
}
'file_save': fields.binary('Save File'),
}
_defaults = {
'msg': lambda *a:'''Save the File with '".xml"' extension.''',
@ -66,8 +66,6 @@ class l10n_be_vat_declaration(osv.osv_memory):
address = post_code = city = ''
city, post_code, address = obj_comp._get_default_ad(obj_company.partner_id.address)
year_id = obj_fyear.find(cr, uid)
account_period = obj_acc_period.browse(cr, uid, data['period_id'], context=context)
@ -98,7 +96,7 @@ class l10n_be_vat_declaration(osv.osv_memory):
for item in tax_info:
if item['code']:
if item['code'] == '71-72':
item['code']='71'
item['code'] = '71'
if item['code'] in list_of_tags:
data_of_file +='\n\t\t\t\t<D'+str(int(item['code'])) +'>' + str(int(item['sum_period']*100)) + '</D'+str(int(item['code'])) +'>'
@ -107,7 +105,6 @@ class l10n_be_vat_declaration(osv.osv_memory):
self.write(cr, uid, ids, {'file_save':data['file_save']}, context=context)
return True
l10n_be_vat_declaration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -18,26 +18,24 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
import time
import datetime
import base64
from osv import osv, fields
class partner_vat_intra(osv.osv_memory):
""" Partner Vat Intra"""
_name = "partner.vat.intra"
_description = 'Partner VAT Intra'
def _get_europe_country(self, cursor, user, context={}):
obj_country = self.pool.get('res.country')
country_ids = obj_country.search(cursor, user, [('code', 'in', ['AT', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB'])])
return country_ids
return obj_country.search(cursor, user, [('code', 'in', ['AT', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB'])])
_columns = {
'trimester': fields.selection(
[('1','Jan/Feb/Mar'),
'trimester': fields.selection( [('1','Jan/Feb/Mar'),
('2','Apr/May/Jun'),
('3','Jul/Aug/Sep'),
('4','Oct/Nov/Dec')],
@ -48,13 +46,13 @@ class partner_vat_intra(osv.osv_memory):
'msg': fields.text('File created', size=64, readonly=True),
'file_save' : fields.binary('Save File', readonly=True),
'country_ids': fields.many2many('res.country', 'vat_country_rel', 'vat_id', 'country_id', 'European Countries'),
}
}
_defaults = {
'country_ids': _get_europe_country,
}
def create_xml(self, cursor, user, ids, context):
def create_xml(self, cursor, user, ids, context={}):
obj_user = self.pool.get('res.users')
obj_fyear = self.pool.get('account.fiscalyear')
obj_sequence = self.pool.get('ir.sequence')