* [DMS] file can not upload from ftp client
* [l10n_be] in VAT declaration xml report , YEAR is wrong

bzr revid: hmo@tinyerp.com-20090205054313-ukjf6nwh43fg8mp4
This commit is contained in:
Harry (Open ERP) 2009-02-05 11:13:13 +05:30
parent 5e4f0a9bf6
commit 5d1da24e12
3 changed files with 10 additions and 9 deletions

View File

@ -609,7 +609,7 @@ class document_file(osv.osv):
def create(self, cr, uid, vals, context={}):
vals['title']=vals['name']
vals['parent_id'] = context.get('parent_id',False)
vals['parent_id'] = context.get('parent_id',False) or vals.get('parent_id',False)
if not vals.get('res_id', False) and context.get('default_res_id',False):
vals['res_id']=context.get('default_res_id',False)
if not vals.get('res_model', False) and context.get('default_res_model',False):

View File

@ -31,10 +31,10 @@ class res_company(osv.osv):
city = post_code = address = ""
for ads in addresses:
if ads.type == 'default':
city = ads.city
post_code = ads.zip
city = ads.city or ""
post_code = ads.zip or ""
if ads.street:
address = ads.street
address = ads.street or ""
if ads.street2:
address += " " + ads.street2
return city, post_code, address

View File

@ -76,9 +76,10 @@ class wizard_vat_declaration(wizard.interface):
obj_fyear = pool_obj.get('account.fiscalyear')
year_id = obj_fyear.find(cr, uid)
current_year = obj_fyear.browse(cr,uid,year_id).name
period_code = pool_obj.get('account.period').browse(cr, uid, data['form']['period']).code
account_period=pool_obj.get('account.period').browse(cr, uid, data['form']['period'])
current_year = account_period.fiscalyear_id.name
period_code = account_period.code
send_ref = user_cmpny
if period_code:
@ -89,8 +90,8 @@ class wizard_vat_declaration(wizard.interface):
data_of_file +='\n\t\t<POSTCODE>'+post_code+'</POSTCODE>\n\t\t<CITY>'+city+'</CITY>\n\t\t<SENDINGREFERENCE>'+send_ref+'</SENDINGREFERENCE>\n\t</DECLARER>'
data_of_file +='\n\t<VATRECORD>\n\t\t<RECNUM>1</RECNUM>\n\t\t<VATNUMBER>'+str(vat_no)+'</VATNUMBER>\n\t\t<DPERIODE>\n\t\t\t'
starting_month = pool_obj.get('account.period').browse(cr, uid, data['form']['period']).date_start[5:7]
ending_month = pool_obj.get('account.period').browse(cr, uid, data['form']['period']).date_stop[5:7]
starting_month = account_period.date_start[5:7]
ending_month = account_period.date_stop[5:7]
if starting_month != ending_month:
#starting month and ending month of selected period are not the same
#it means that the accounting isn't based on periods of 1 month but on quarters