← Back to team overview

clearcorp team mailing list archive

[Merge] lp:~cv.clearcorp/openerp-ccorp-addons/rent-fixes into lp:openerp-ccorp-addons/6.1

 

Carlos Vásquez (CLEARCORP) has proposed merging lp:~cv.clearcorp/openerp-ccorp-addons/rent-fixes into lp:openerp-ccorp-addons/6.1.

Requested reviews:
  CLEARCORP development team (clearcorp)

For more details, see:
https://code.launchpad.net/~cv.clearcorp/openerp-ccorp-addons/rent-fixes/+merge/100053
-- 
https://code.launchpad.net/~cv.clearcorp/openerp-ccorp-addons/rent-fixes/+merge/100053
Your team CLEARCORP development team is requested to review the proposed merge of lp:~cv.clearcorp/openerp-ccorp-addons/rent-fixes into lp:openerp-ccorp-addons/6.1.
=== removed file 'rent/.goutputstream-DRFF1V'
--- rent/.goutputstream-DRFF1V	2011-12-05 17:47:04 +0000
+++ rent/.goutputstream-DRFF1V	1970-01-01 00:00:00 +0000
@@ -1,590 +0,0 @@
-from osv import osv, fields
-from tools import debug
-import time
-import pooler
-from dateutil import parser
-from tools.translate import _
-
-class rent_canton(osv.osv):
-	 _name = 'rent.canton'
-	 _description = 'Canton for the State'
-	 _columns = {
-		'state_id'   : fields.many2one('res.country.state','Province',required=True),
-		'name'       : fields.char('Canton Name', size=64, required=True),
-		'code'       : fields.char('Canton Code', size=4,help = 'The canton code in 4 chars', required=True),
-	 }
-rent_canton()
-
-class rent_canton_district(osv.osv):
-	_name = 'rent.canton.district'
-	_description = 'District located in the canton'
-	_columns = {
-		'canton_id'  : fields.many2one('rent.canton','Canton',required=True),
-		'name'       : fields.char('Distric Name', size=64, required=True),
-		'code'       : fields.char('Distric Code', size=4,help = 'The district code in 4 chars', required=True),
-	}
-rent_canton_district()
-
-
-# Class used to specialize the res.partner.address, this one adds the attributes of
-# canton, district and redefines the estate_id to province making it as a selection
-class rent_location(osv.osv):
-	_name = 'res.partner.address'
-	_inherit = 'res.partner.address'
-
-	_columns = {
-		#'province_id '   : fields.selection(_get_province,'Province',size=16),
-		#'canton_id'   : fields.selection(_get_canton, 'Canton'),
-		'canton_id'   : fields.many2one('rent.canton', 'Canton', domain = "[('state_id','=',state_id)]"),
-		'district_id' : fields.many2one('rent.canton.district','District', domain = "[('canton_id','=',canton_id)]"),
-	}
-rent_location()
-
-#Class that inherits from res.partner allowing to record the 
-#necesary data from the clients
-
-class rent_client(osv.osv):
-	_name = 'res.partner'
-	_inherit = 'res.partner'
-	_columns = {
-		'client_birthdate' : fields.date('Birthdate',select=1,required=True),
-		#'client_location'  : fields.one2many('rent.location','location_id','Location'),
-		'client_canton'    : fields.related('address', 'canton_id', type='many2one', relation='rent.canton', string='Canton'),
-		'client_district'  : fields.related('address', 'district_id', type='many2one', relation='rent.canton.district', string='District'),
-	}
-rent_client()
-
-
-#Class that represents the estates owned by the user. 
-#This class also uses the rent.location defined above
-class rent_estate(osv.osv):
-	_name = 'rent.estate'
-	_rec_name = "estate_number"
-	
-	def _get_estate_vrm(self,cr,uid,ids,field_name,args,context=None):
-		res = {}
-		for estate_id in ids:
-			obj_estate = self.pool.get('rent.estate').browse(cr,uid,estate_id)
-			res[estate_id] = obj_estate.estate_value / obj_estate.estate_area
-		return res
-	
-	def calculate_vrm(self,cr,uid,ids,context):
-		res = {}
-		self.pool.get('rent.estate').write(cr, uid, ids, {}, context)
-		return { 'value' : res}
-		
-	_columns = {
-		'estate_owner'    : fields.many2one('res.company','Owner',required=True),
-		'estate_number'   : fields.char('# estate', size=10,required=True),
-		'estate_value'    : fields.float('VRN Dynamic',required=True),
-		'estate_area'     : fields.float('Area', required=True),
-		'estate_vrn_per_sqr' : fields.function(_get_estate_vrm,type='float',method=True,string='VRN Din/M2'),#fields.float('VRN Din/M2',store=False, readonly=True),
-		'estate_buildings': fields.one2many('rent.building','building_estate','Buildings'),
-		'estate_location' : fields.many2one('res.partner.address','Location'),
-		#'estate_province': fields.related('estate_address', 'estate_province', type='selection', string='Province'),
-        #'estate_canton': fields.related('estate_address', 'estate_canton', type='selection', string='Canton'),
-        #'estate_district': fields.related('estate_address', 'estate_district', type='selection', string='District'),
-	}
-rent_estate()
-
-#Class building to represente a Real Estate, that is on any land previously define by the user
-#this class contains the necesary data to determine the value for rent of the building
-class rent_building(osv.osv):
-	_name = 'rent.building'
-	
-	def _get_building_vrm(self,cr,uid,ids,field_name,args,context=None):
-		#This method calculates the vrn acording to the value an area of the building
-		res = {}
-		for building_id in ids:
-			obj_building = self.pool.get('rent.building').browse(cr,uid,building_id)
-			res[building_id] = obj_building.building_value / obj_building.building_area
-		return res
-		
-	_columns = {
-		'building_capacity'          : fields.integer('Capacity',required=True),
-		'building_date_construction' : fields.date('Construction Date', required=True),
-		'building_elevator'          : fields.boolean('Elevadores',help='Select if the building has at least one elevator'),
-		'building_elevators_number'  : fields.integer('Elvetators number',readonly=True,help='If checkbox of elevators is no selected this will be 0'),
-		'building_stairs'            : fields.boolean('Stairs',help='Select if the building has at least one elevator'),
-		'building_stairs_number'     : fields.integer('Stairs number',readonly=True,help='If checkbox of stairs is no selected this will be 0'),
-		'name'                       : fields.char('Name', size=40,required=True),
-		'building_value'             : fields.float('VRN Dynamic',required=True),
-		'building_area'              : fields.float('Area',required=True),
-		'building_estate'            : fields.many2one('rent.estate', 'estate'),
-		'building_photo'             : fields.binary('Photo'),
-		'building_gallery_photo'     : fields.char('Gallery of Photos', size=64),
-		'building_floors'            : fields.one2many('rent.floor','floor_building','Floors'),
-		'building_vrn_per_sqr'       : fields.function(_get_building_vrm,type='float',method=True,string='VRN Din/M2'),
-		'building_code'              : fields.char('Code', size=4, required=True),
-		#'building_asset'             : fields.many2one('account.invoice','Asset'),
-	}
-rent_building()
-
-#Class that represents every single floor contained on the building, defined above
-#All floors are differenced by the number starting from 0 (basement), then higher 
-#the numbre then near to the top of the building is the floor.
-class rent_floor(osv.osv):
-	_name = 'rent.floor'
-	_rec_name = 'floor_number'
-	
-	def _calculate_floor_value(self,cr,uid,ids,field_name,args,context):
-		#This method takes al the valid rents for the floor and calculates the value according to 
-		#the value of the locals,parking, building and estate related to it
-		res = {}
-		valores = {}
-		total = 0
-		debug("CALCULO====================")
-		debug(ids)
-		for floor_id in ids:
-			debug(floor_id)
-			actual_rent = self.pool.get('rent.rent').search(cr,uid,['|',('state','=','valid'),('state','=','draft'),('rent_related_real','=','local')])
-			debug(actual_rent)
-			for obj_rent in self.pool.get('rent.rent').browse(cr,uid,actual_rent):
-				obj_local = obj_rent.rent_rent_local
-				local_floor_ids = self.pool.get('rent.local.floor').search(cr,uid,[('local_local_floor','=',obj_local.id),('local_floor_floor','=',floor_id)])
-				for local in self.pool.get('rent.local.floor').browse(cr,uid,local_floor_ids):
-					valores = local._local_value(local.id,None,None)
-					debug(valores)
-					total += valores[local.id]
-			debug(total)
-			
-			#This part look for the parking on rents associated to the floor
-			rent_ids = self.pool.get('rent.rent').search(cr,uid,['|',('state','=','valid'),('state','=','draft'),('rent_related_real','=','parking')])
-			obj_rent = self.pool.get('rent.rent').browse(cr,uid,rent_ids)
-			for rent in obj_rent:
-				obj_parking = rent.rent_rent_parking
-				if (obj_parking.parking_floor.id == floor_id):
-					total += obj_parking._parking_value(obj_parking.id,None,None)[obj_parking.id]
-			res[floor_id] = total
-			total = 0
-		return res
-	
-	def _get_fullname(self,cr,uid,ids,field_name,args,context):
-		debug("FULLNAME====================")
-		res = {}
-		for obj_floor in self.pool.get('rent.floor').browse(cr,uid,ids):
-			building_code = obj_floor.floor_building.building_code
-			res[obj_floor.id] = building_code + '-' + obj_floor.floor_number
-		debug(res)
-		return res
-	 
-	def name_get(self, cr, uid, ids, context=None):
-		if not len(ids):
-			return []
-		reads = self.read(cr, uid, ids, ['complete_name'], context=context)
-		res = []
-		for record in reads:
-			name = record['complete_name']
-			res.append((record['id'], name))
-		return res
-
-	_columns = {
-		'floor_number'     : fields.char('# Floor',size=4,required=True, help='Number of the floor in the building, starts from 0 (Basement)'),
-		'floor_thickness'  : fields.float('Thickness'),
-		'floor_durability' : fields.integer('Durability', help='Indicate the durability in years'),
-		'floor_area'       : fields.float('Area',required=True),
-		'floor_value'      : fields.function(_calculate_floor_value,type='float',method=True,string='Value',help='This value is calculated using the estate and building area and values'),
-		'floor_acabado'    : fields.char('Acabado',size=64),
-		#'floor_local'      : fields.one2many('rent.floor.local','local_floor','Local'),
-		'floor_parking'    : fields.one2many('rent.floor.parking','parking_floor','Parking'),
-		'floor_building'   : fields.many2one('rent.building','Building'),
-		'complete_name'    : fields.function(_get_fullname,type='char',method=True,string='Name',help='This name uses the code of the building and the floor name'),
-	}
-rent_floor()
-
-#Class representing the local, on every floor. This class has a relation 
-#many2one with the floor 
-#
-class rent_floor_local(osv.osv):
-	_name = 'rent.floor.local'
-	_rec_name = 'local_number'
-		
-	def _get_building_local(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		debug('EDIFICIO+==================================')
-		debug(ids)
-		for local_id in ids:
-			local = self.pool.get('rent.local.floor').search(cr,uid,[('local_local_floor','=',local_id)])
-			debug(local)
-			res[local_id] = False
-			for lids in local:
-				obj_local = self.pool.get('rent.local.floor').browse(cr,uid,lids)
-				debug(obj_local)
-				res[local_id] = obj_local.local_floor_floor.floor_building.id
-			debug(res)
-		return res
-	
-	def _determine_rented(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		debug('Renta+==================================')
-		for local_id in ids:
-			res[local_id] =  False
-			debug(ids)
-			rent_ids = self.pool.get('rent.rent').search(cr,uid,[('state','=','valid'),('rent_related_real','=','local'),('rent_rent_local','=',local_id)])
-			if rent_ids:
-				res[local_id] =  True
-		debug(res)
-		return res
-	def _local_value(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		debug(ids)
-		total = 0
-		for local in self.pool.get('rent.floor.local').browse(cr,uid,ids):
-			for obj_local_floor in local.local_local_by_floor:
-				total += obj_local_floor._local_value(obj_local_floor.id,None,None)[obj_local_floor.id]
-			res[local.id] = total
-			total = 0
-		debug(total)
-		debug(res)
-		return res
-
-	def name_get(self, cr, uid, ids, context=None):
-		if not len(ids):
-			return []
-		reads = self.read(cr, uid, ids, ['local_number','local_building'], context=context)
-		res = []
-		debug('NOMBREPISOS+==================================')
-		for record in reads:
-			debug(record)
-			debug(record['local_building'][1])
-			name = 'Local #' + str(record['local_number']) + ' , ' +  record['local_building'][1]
-		#	for subrecord in subreads 
-		#		name += ', ' + subrecord['local_floor_building']
-			res.append((record['id'], name))
-		return res
-	_columns = {
-		#'local_area'               : fields.function(_floor_area,type='float',method=True,string='VRN Dynamic'),
-		'local_area'               : fields.float('Area',required=True),
-		#'local_value'              : fields.float('Value',required=True),
-		'local_number'             : fields.integer('# Local',required=True),
-		'local_huella'             : fields.float('Huella',required=True),
-		'local_water_meter_number' : fields.char('Water Meter',size=64), 
-		'local_light_meter_number' : fields.char('Electric Meter', size=64),
-		#'local_sqrmeter_price'     : fields.function(_local_sqr_price,type='float',method=True,string='Sqr Meter Price'),
-		#'local_sqrmeter_price'     :  fields.float('Sqr Meter Price',required=True),
-		'local_rented'             : fields.function(_determine_rented,type='boolean',method=True,string='Rented',help='Check if the local is rented'),
-		#'local_floor'              : fields.many2one('rent.floor','# Floor'),
-		'local_local_by_floor'     : fields.one2many('rent.local.floor','local_local_floor','Local floors'),
-		#'local_floor'              : fields.related('rent.local.floor','# Floor'),
-		'local_building'           : fields.function(_get_building_local,type='many2one',obj='rent.building',method=True,string='Building'),
-		'local_gallery_photo'      : fields.char('Photo Gallery', size=64),
-		'local_photo'              : fields.binary('Main photo'),
-		#'local_rent'               : fields.many2one('rent.rent','Alquiler'),
-	}
-rent_floor_local()
-
-#Class representing the parking, on floor. This class has a relation 
-#many2one with the floor 
-#
-class rent_floor_parking(osv.osv):
-	_name = 'rent.floor.parking'
-	_rec_name = 'parking_number'
-	
-	def _parking_sqr_price(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for parking_id in ids:
-			obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
-			obj_build = obj.parking_floor.floor_building
-			res[parking_id] = obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
-		return res
-	
-	def _parking_value(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for parking_id in ids:
-			obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
-			areas = obj._parking_area(parking_id,None,None)
-			obj_build = obj.parking_floor.floor_building
-			res[parking_id] = areas[parking_id] * obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
-		return res
-		
-	def _parking_area(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for parking_id in ids:
-			obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
-			res[parking_id] = obj.parking_large * obj.parking_width
-		return res
-	
-	def name_get(self, cr, uid, ids, context=None):
-		if not len(ids):
-			return []
-		reads = self.read(cr, uid, ids, ['parking_number','parking_floor'], context=context)
-		res = []
-		debug('NOMBREPARKEO+==================================')
-		for record in reads:
-			debug(record)
-			debug(record['parking_floor'][1])
-			name = 'Parking #' + str(record['parking_number']) + ' , ' +  record['parking_floor'][1]
-		#	for subrecord in subreads 
-		#		name += ', ' + subrecord['local_floor_building']
-			res.append((record['id'], name))
-		return res
-	
-	def _determine_rented(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		debug('Renta+==================================')
-		for parking_id in ids:
-			res[parking_id] =  False
-			debug(ids)
-			rent_ids = self.pool.get('rent.rent').search(cr,uid,[('state','=','valid'),('rent_related_real','=','parking'),('rent_rent_parking','=',parking_id)])
-			if rent_ids:
-				res[parking_id] =  True
-		debug(res)
-		return res
-	_columns = {
-		'parking_area'            : fields.function(_parking_area,type='float',method=True,string='Area'),
-		#'parking_area'            : fields.float('VRN Dynamic',required=True),
-		#'parking_value'           : fields.float('Value',required=True),
-		'parking_value'           : fields.function(_parking_value,type='float',method=True,string='Value'),
-		'parking_number'          : fields.integer('# Parking',required=True),
-		'parking_huella'          : fields.float('Huella',required=True),
-		'parking_sqrmeter_price'  :  fields.function(_parking_sqr_price,type='float',method=True,string='Sqr Meter Value'),
-		#'parking_sqrmeter_price'  :  fields.float('Sqr Meter Value',required=True),
-		'parking_rented'          : fields.function(_determine_rented,type='boolean',method=True,string='Rented',help='Checked if the parking is rented'),
-		'parking_floor'           : fields.many2one('rent.floor','# Floor'),
-		'parking_large'           : fields.float('Large Meters'),
-		'parking_width'           : fields.float('Width Meters'),
-	}
-rent_floor_parking()
-
-
-#Class to hold all the information that refences the rent
-#value, dates, status and to control de transaction of the bussines
-#
-class rent_rent(osv.osv):
-	_name = 'rent.rent'
-	
-	def _get_currency(self, cr, uid, context=None):
-		user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid], context=context)[0]
-		if user.company_id:
-			return user.company_id.currency_id.id
-		return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0]
-		
-	def _get_total_rent(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		total = 0
-		debug('+==================================')
-		for rent_id in ids:
-			debug(rent_id)
-			obj_rent = self.pool.get('rent.rent').browse(cr,uid,rent_id)
-			debug(obj_rent)
-			if obj_rent.rent_related_real == 'local':
-				debug("LOCALES")
-				debug(obj_rent.rent_rent_local)
-				obj_local = obj_rent.rent_rent_local
-				total = obj_local._local_value(obj_local.id,None,None)[obj_local.id]
-				debug(total)
-			elif obj_rent.rent_related_real == 'parking':
-				debug("PARQUEO")
-				obj_parking = obj_rent.rent_rent_parking
-				debug(obj_parking)
-				total = obj_parking._parking_value(obj_parking.id,None,None)[obj_parking.id]
-			else:
-				debug("LOTES")
-				debug(obj_rent.rent_rent_estate)
-				obj_estado = obj_rent.rent_rent_estate
-				total = obj_estado._get_estate_vrm(obj_estado.id,None,None)[obj_estado.id]
-				debug(total)
-				#for obj_estado in obj_rent.rent_rent_estate:
-					#debug(obj_estado)
-					#total += obj_estado._get_estate_vrm(obj_estado.id,None,None)[obj_estado.id]
-			res[rent_id] = total
-		return res
-	def _calculate_years(self,cr,uid,ids,field_name,args,context):
-		debug('+==================================')
-		res = {}
-		for rent_id in ids:
-			obj_rent = self.pool.get('rent.rent').browse(cr,uid,rent_id)
-			if (obj_rent.rent_end_date and  obj_rent.rent_start_date):
-				fin = parser.parse(obj_rent.rent_end_date)
-				inicio = parser.parse(obj_rent.rent_start_date)
-				debug(inicio)
-				debug(fin)
-				res[rent_id] = (fin.year - inicio.year)
-			debug(res)
-		return res
-	
-	def write(self, cr, uid, ids, vals, context=None):
-		if 'rent_related_real' in vals:
-			obj_rent = self.pool.get('rent.rent').browse(cr,uid,ids)[0]
-			debug('_---------------------------------------------------ACT')
-			debug(obj_rent)
-			debug(obj_rent.rent_rent_local)
-			if (obj_rent.rent_related_real != vals['rent_related_real']):
-				debug(vals)
-				real_type = vals['rent_related_real'] 
-				if real_type == 'local' or real_type == 'parking':
-					vals['rent_rent_estate'] = False
-				if real_type == 'local' or real_type == 'estate':
-					vals['rent_rent_parking'] = False
-				if real_type == 'parking' or real_type == 'estate':
-					#raise osv.except_osv(_('Warning !'), _('You have changed the type of real state that will overwrite the last with this one'))
-					local_list = []
-					for ob_local_floor in obj_rent.rent_rent_local:
-						local_list.append((2,ob_local_floor.id))
-					vals['rent_rent_local'] = local_list
-		debug(vals)
-		return super(rent_rent, self).write(cr, uid, ids, vals, context=context)
-		
-	_columns = {
-		'name'                  : fields.char('Name',size=64),
-		'rent_rent_client'      : fields.many2one('res.partner','Client', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_end_date'         : fields.date('Ending Date', required=True, states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_ending_motif'     : fields.selection([('Desertion','Desertion'),('No Renovation','No Renovation'),('Eviction','Eviction')],'Ending Motif'),
-		'rent_ending_motif_desc': fields.text('Ending Motif Description'),
-		'rent_rise'             : fields.float('Anual Rise', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_type'             : fields.selection([('Contract','Contract'),('Adendum','Adendum'),('Renovation','Renovation')],'Type', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'state'                 : fields.selection([('valid','Valid'),('finished','Finished'),('draft','Draft')],'Status', readonly=True),
-		'rent_start_date'       : fields.date('Starting Date', required=True, states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_total'            : fields.function(_get_total_rent,type='float',method=True,string='Total Paid'),
-		'rent_rent_local'       : fields.many2one('rent.floor.local','Local', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_rent_parking'     : fields.many2one('rent.floor.parking','Parking', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_rent_estate'      : fields.many2one('rent.estate','Estate', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		#'rent_is_local'         : fields.boolean('Locals',help='Check if you want to calculate a rent for locals', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		#'rent_is_parking'       : fields.boolean('Parking',help='Check if you want to calculate a rent for locals', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		#'rent_is_estate'        : fields.boolean('Estates',help='Check if you want to calculate a rent for locals', states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_related_real'     : fields.selection([('local','Locals'),('parking','Parking'),('estate','Estates')],'Type of Real Estate', required=True,states={'valid':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_years'            : fields.function(_calculate_years,type='integer',method=True,string = 'Years' ,help='Check if you want to calculate a rent for locals'),
-		'rent_modif'            : fields.one2many('rent.rent', 'rent_modif_ref','Contract reference', states={'draft':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_modif_ref'        : fields.many2one('rent.rent', 'Modifications'),
-		'currency_id'           : fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
-		'rent_estimates'        : fields.one2many('rent.rent.analitic', 'analitic_rent','Estimates'),         
-	}
-	
-	_defaults = {
-		'state'        : 'draft',
-		'rent_type'    : 'Contract',
-		'currency_id': _get_currency,
-	}
-rent_rent()
-
-class rent_rent_analitic(osv.osv):
-	_name = 'rent.rent.analitic'
-	
-	def _performance_years(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for obj_analitic in self.pool.get('rent.rent.analitic').browse(cr,uid,ids):
-			res[obj_analitic.id] =  1 / obj.analitic.analitic_performance
-		return res
-	_columns = {
-		'analitic_performance'       : fields.integer('Performance', help='This a percentaje number',store=False),
-		'analitic_years'             : fields.function(_performance_years, type='integer',method = True,string='Years'),
-		'analitic_amountc'           : fields.function(_performance_years, type='integer',method = True,string='Years'),
-		#'analitic_colones'           : fields.function(_performance_years, type='integer',method = True,string='c / m2'),
-		#'analitic_amountd'           : fields.function(_performance_years, type='integer',method = True,string='Years'),
-		#'analitic_dollars'           : fields.function(_performance_years, type='integer',method = True,string='s / m2'),
-		'analitic_cust_colones'      : fields.integer('Amount c', store=False),
-		'analitic_cust_dollars'      : fields.integer('Amount s', store=False),
-		
-		'analitic_dec_min_dollars'       : fields.integer('Amount s', store=False),
-		'analitic_dec_base_dollars'      : fields.integer('Amount s', store=False),
-		'analitic_rent'                  : fields.many2one('rent.rent','Rent'),
-	}
-rent_rent_analitic()
-
-class rent_local_floor(osv.osv):
-	_name = 'rent.local.floor'
-	
-	def _local_sqr_price(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for local_id in ids:
-			obj = self.pool.get('rent.local.floor').browse(cr,uid,local_id)
-			obj_build = obj.local_floor_floor.floor_building
-			res[local_id] = obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
-		return res
-	
-	def _local_value(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for local_id in ids:
-			obj = self.pool.get('rent.local.floor').browse(cr,uid,local_id)
-			obj_build = obj.local_floor_floor.floor_building
-			res[local_id] = obj.local_floor_area * obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
-		return res
-		
-	#def _local_floor_area(self,cr,uid,ids,field_name,args,context):
-	#	res = {}
-	#	for local_floor_id in ids:
-	#		obj = self.pool.get('rent.local.floor').browse(cr,uid,local_floor_id)
-	#		res[local_floor_id] = obj.local_floor_width * obj.local_floor_large
-	#	return res
-	
-	def onchange_floor(self,cr,uid,ids,floor_id):
-		res = {}
-		debug("+============================")
-		obj_floor = self.pool.get('rent.floor').browse(cr,uid,floor_id)
-		debug(obj_floor)
-		res['local_floor_building'] = obj_floor.floor_building.id
-		debug(res)
-		return {'value' : res}
-	_columns = {
-		#'name'                 : fields.char('Reference',size=64,help='Indicate a representative reference for the asociation'),
-		'local_floor_front'    : fields.float('Front', required=True),
-		'local_floor_side'    : fields.float('Side', required=True),
-		'local_floor_floor'    : fields.many2one('rent.floor','Level',help='Represents the floor on witch its located the local'),
-		'local_local_floor'    : fields.many2one('rent.floor.local','Local#',help='Represents the floor on witch its located the local'),
-		#'local_rent'           : fields.many2one('rent.rent','Alquiler',ondelete='cascade'),
-		'local_floor_area'     : fields.float('Area M2',required=True),
-		#'local_floor_area'     : fields.function(_local_floor_area,type='float',method=True,string='Area M2'),
-		'local_sqrmeter_price' : fields.function(_local_sqr_price,type='float',method=True,string='Sqr Meter Price'),
-		'local_floor_value'    : fields.function(_local_value,type='float',method=True,string='Total Value'),
-		'local_floor_building' : fields.related('local_floor_floor','floor_building',type='many2one',relation='rent.building',string='Building', readonly=True, store=False),
-	} 
-rent_local_floor()
-
-#
-#
-#
-class rent_contract(osv.osv):
-	_name = 'rent.contract'
-	
-	def create(self,cr,uid, vals,context=None):
-		debug("============================CREANDO EL NUEVO CONTRATO")
-		contract_id = super(rent_contract,self).create(cr,uid,vals,context)
-		debug(contract_id)
-		obj_contract = self.pool.get('rent.contract').browse(cr,uid,contract_id)
-		debug(obj_contract)
-		i = 0
-		for clause_perm in self.pool.get('rent.contract.clause').search(cr,uid,[('clause_is_basic','=','True')]):
-		#for obj_clause_perm in self.pool.get('rent.contract.clause').browse(cr,uid,clause_perm):
-			#clause_rel_id = self.pool.get('rent.contract.clause.rel').create(cr,uid,{'sequence':i,'rent_contract_id':obj_contract.id,'rent_contract_clause_id' : clause_perm},context)
-			#obj_clause_perm = self.pool.get('rent.contract.clause.rel').browse(cr,uid,clause_rel_id)
-			#if obj_clause_perm:
-			obj_contract.write({'contract_clauses' : [(0,0,{'sequence':i,'rent_contract_id':obj_contract.id,'rent_contract_clause_id' : clause_perm})]})
-			i+=1
-		return obj_contract.id
-				
-	_columns = {
-		'name'             : fields.char('Reference', size=64),
-		'contract_rent'    : fields.many2one('rent.rent','Rent Reference'),
-		'contract_clauses' : fields.one2many('rent.contract.clause.rel','rent_contract_id','Clausulas'),
-		#'contract_clauses' : fields.many2many('rent.contract.clause','rent_contract_clause_rel','name','clause_code','Clausulas'),
-		#'contract_design'  : fields.char('Design',size=64),
-	}
-	
-rent_contract()
-
-
-#Class that holds all the clauses for the contracts
-#this class is used to create a custom contract
-#it simulates a sintaxys analizer to subtitute codes with the corresponding clause
-class rent_contract_clause(osv.osv):
-	_name = 'rent.contract.clause'
-	_rec_name = 'clause_code'
-	_columns = {
-		'clause_code'     : fields.char('Reference',size=64,required=True,help='Reference code for the clause, used to create custom contracts'),
-		'clause_subject'  : fields.char('Subject',size=64,required=True),
-		'clause_body'     : fields.text('Body',required=True),
-		'clause_is_basic' : fields.boolean('Priority', help = 'Check if the clause should allways appear on every contract you create'),
-		#'clause_contract' : fields.many2many('rent.contract','rent_contract_clause','id','id','Contracts'),
-	}
-rent_contract_clause()
-
-
-class rent_contract_clause_rel(osv.osv):
-	_name = 'rent.contract.clause.rel'
-	_rec_name = 'rent_contract_id'
-	_columns = {
-		'rent_contract_id' : fields.many2one('rent.contract','Contract Reference'),
-		'rent_contract_clause_id' : fields.many2one('rent.contract.clause','Contract Reference'),
-		'sequence'         : fields.integer('Sequence'),
-	}
-rent_contract_clause_rel()

=== modified file 'rent/__openerp__.py'
--- rent/__openerp__.py	2012-01-05 20:39:48 +0000
+++ rent/__openerp__.py	2012-03-29 22:54:18 +0000
@@ -30,7 +30,7 @@
 	""",
 	'depends': [
 		'account',
-		'base_contact',
+		'l10n_cr_base',
 		],
 	'init_xml': [],
 	'demo_xml': [],

=== modified file 'rent/rent.py'
--- rent/rent.py	2012-03-23 20:42:53 +0000
+++ rent/rent.py	2012-03-29 22:54:18 +0000
@@ -20,7 +20,6 @@
 #
 ##############################################################################
 from osv import osv, fields
-#from tools import #debug
 import time
 import pooler
 from dateutil import parser
@@ -29,1835 +28,1785 @@
 import calendar
 from tools.translate import _
 
-class rent_canton(osv.osv):
-	 _name = 'rent.canton'
-	 _description = 'Canton for the State'
-	 _columns = {
-		'state_id'   : fields.many2one('res.country.state','Province',required=True),
-		'name'       : fields.char('Canton Name', size=64, required=True),
-		'code'       : fields.char('Canton Code', size=4,help = 'The canton code in 4 chars', required=True),
-	 }
-rent_canton()
-
-class rent_canton_district(osv.osv):
-	_name = 'rent.canton.district'
-	_description = 'District located in the canton'
-	_columns = {
-		'canton_id'  : fields.many2one('rent.canton','Canton',required=True),
-		'name'       : fields.char('Distric Name', size=64, required=True),
-		'code'       : fields.char('Distric Code', size=4,help = 'The district code in 4 chars', required=True),
-	}
-rent_canton_district()
-
 
 # Class used to specialize the res.partner.address, this one adds the attributes of
 # canton, district and redefines the estate_id to province making it as a selection
 class rent_location(osv.osv):
-	_name = 'res.partner.address'
-	_inherit = 'res.partner.address'
+    _name = 'res.partner.address'
+    _inherit = 'res.partner.address'
 
-	_columns = {
-		'canton_id'   : fields.many2one('rent.canton', 'Canton', domain = "[('state_id','=',state_id)]"),
-		'district_id' : fields.many2one('rent.canton.district','District', domain = "[('canton_id','=',canton_id)]"),
-	}
-rent_location()
+    _columns = {
+        'canton_id'   : fields.many2one('res.country.state.canton', 'Canton', domain = "[('state_id','=',state_id)]"),
+        'district_id' : fields.many2one('res.country.state.canton.district','District', domain = "[('canton_id','=',canton_id)]"),
+    }
 
 #Class that inherits from res.partner allowing to record the 
 #necesary data from the clients
 
 class rent_client(osv.osv):
-	_name = 'res.partner'
-	_inherit = 'res.partner'
-	_columns = {
-		#'client_birthdate' : fields.date('Birthdate',select=1,required=True),
-		'client_canton'    : fields.related('address', 'canton_id', type='many2one', relation='rent.canton', string='Canton'),
-		'client_district'  : fields.related('address', 'district_id', type='many2one', relation='rent.canton.district', string='District'),
-	}
-rent_client()
-
+    _name = 'res.partner'
+    _inherit = 'res.partner'
+    _columns = {
+        #'client_birthdate' : fields.date('Birthdate',select=1,required=True),
+        'client_canton'    : fields.related('address', 'canton_id', type='many2one', relation='res.country.state.canton', string='Canton'),
+        'client_district'  : fields.related('address', 'district_id', type='many2one', relation='res.country.state.canton.district', string='District'),
+    }
 
 #Class that represents the estates owned by the user. 
 #This class also uses the rent.location defined above
 class rent_estate(osv.osv):
-	_name = 'rent.estate'
-	_rec_name = "estate_number"
-	
-	def write (self, cr, uid,ids,vals,context=None):
-		#Check for the area before saving the changes
-		for obj_estate in self.browse(cr,uid,ids):
-			if obj_estate.estate_area == 0:
-				raise osv.except_osv('Wrong value!', 'The area for the estate has to bee greater than 0')
-		return super(rent_estate,self).write(cr,uid,ids,vals,context)
-	def create(self, cr, uid,vals, context=None):
-		#Check for the area before creating the object
-		if vals['estate_area'] == 0:
-			raise osv.except_osv('Wrong value!', 'The area for the estate has to bee greater than 0')
-		return super(rent_estate,self).create(cr,uid,vals,context)
-	
-	def _get_estate_vrm(self,cr,uid,ids,field_name,args,context=None):
-		res = {}
-		for obj_estate in self.pool.get('rent.estate').browse(cr,uid,ids):
-			if obj_estate.estate_area == 0:
-				raise osv.except_osv('Wrong value!', 'The area for the estate has to bee greater than 0')
-			else:
-				res[obj_estate.id] = obj_estate.estate_value / (obj_estate.estate_area == 0 and 1 or obj_estate.estate_area)
-		return res
-	
-	def calculate_vrm(self,cr,uid,ids,context):
-		res = {}
-		self.pool.get('rent.estate').write(cr, uid, ids, {}, context)
-		return { 'value' : res}
-	def _determine_rented(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for estate_id in ids:
-			res[estate_id] =  False
-			rent_ids = self.pool.get('rent.rent').search(cr,uid,[('state','=','active'),('rent_related_real','=','estate'),('rent_rent_local_id','=',estate_id)])
-			if rent_ids:
-				res[estate_id] =  True
-		return res
-	_columns = {
-		'estate_owner_id'     : fields.many2one('res.company','Owner',required=True),
-		'estate_number'       : fields.char('# estate', size=20,required=True),
-		'estate_value'        : fields.float('VRN Dynamic',required=True),
-		'estate_area'         : fields.float('Area', required=True),
-		'estate_vrn_per_sqr'  : fields.function(_get_estate_vrm,type='float',method=True,string='VRN Din/M2'),#fields.float('VRN Din/M2',store=False, readonly=True),
-		'estate_buildings_ids': fields.one2many('rent.building','building_estate_id','Buildings'),
-		'estate_location_id'  : fields.many2one('res.partner.address','Location'),
-		'estate_account_id'   : fields.many2one('account.account', 'Cuenta'),
-		'estate_rented'       : fields.function(_determine_rented,type='boolean',method=True,string='Rented',help='Checked if the local is rented', store=True),
-	}
-	_sql_constraints = [
-		('estate_area_gt_zero', 'CHECK (estate_area!=0)', 'The area for the estate cannot be 0!'),
-		('estate_number_key','UNIQUE (estate_number)','You can not have two estates with the same number!'),
-	]
-rent_estate()
+    _name = 'rent.estate'
+    _rec_name = "estate_number"
+    
+    def write (self, cr, uid,ids,vals,context=None):
+        #Check for the area before saving the changes
+        for obj_estate in self.browse(cr,uid,ids):
+            if obj_estate.estate_area == 0:
+                raise osv.except_osv('Wrong value!', 'The area for the estate has to bee greater than 0')
+        return super(rent_estate,self).write(cr,uid,ids,vals,context)
+    def create(self, cr, uid,vals, context=None):
+        #Check for the area before creating the object
+        if vals['estate_area'] == 0:
+            raise osv.except_osv('Wrong value!', 'The area for the estate has to bee greater than 0')
+        return super(rent_estate,self).create(cr,uid,vals,context)
+    
+    def _get_estate_vrm(self,cr,uid,ids,field_name,args,context=None):
+        res = {}
+        for obj_estate in self.pool.get('rent.estate').browse(cr,uid,ids):
+            if obj_estate.estate_area == 0:
+                raise osv.except_osv('Wrong value!', 'The area for the estate has to bee greater than 0')
+            else:
+                res[obj_estate.id] = obj_estate.estate_value / (obj_estate.estate_area == 0 and 1 or obj_estate.estate_area)
+        return res
+    
+    def calculate_vrm(self,cr,uid,ids,context):
+        res = {}
+        self.pool.get('rent.estate').write(cr, uid, ids, {}, context)
+        return { 'value' : res}
+    def _determine_rented(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for estate_id in ids:
+            res[estate_id] =  False
+            rent_ids = self.pool.get('rent.rent').search(cr,uid,[('state','=','active'),('rent_related_real','=','estate'),('rent_rent_local_id','=',estate_id)])
+            if rent_ids:
+                res[estate_id] =  True
+        return res
+    _columns = {
+        'estate_owner_id'     : fields.many2one('res.company','Owner',required=True),
+        'estate_number'       : fields.char('# estate', size=20,required=True),
+        'estate_value'        : fields.float('VRN Dynamic',required=True),
+        'estate_area'         : fields.float('Area', required=True),
+        'estate_vrn_per_sqr'  : fields.function(_get_estate_vrm,type='float',method=True,string='VRN Din/M2'),#fields.float('VRN Din/M2',store=False, readonly=True),
+        'estate_buildings_ids': fields.one2many('rent.building','building_estate_id','Buildings'),
+        'estate_location_id'  : fields.many2one('res.partner.address','Location'),
+        'estate_account_id'   : fields.many2one('account.account', 'Cuenta'),
+        'estate_rented'       : fields.function(_determine_rented,type='boolean',method=True,string='Rented',help='Checked if the local is rented', store=True),
+    }
+    _sql_constraints = [
+        ('estate_area_gt_zero', 'CHECK (estate_area!=0)', 'The area for the estate cannot be 0!'),
+        ('estate_number_key','UNIQUE (estate_number)','You can not have two estates with the same number!'),
+    ]
 
 #Class building to represente a Real Estate, that is on any land previously define by the user
 #this class contains the necesary data to determine the value for rent of the building
 class rent_building(osv.osv):
-	_name = 'rent.building'
-	
-	def write (self, cr, uid,ids,vals,context=None):
-		#Check for the area before saving the changes
-		for obj_building in self.browse(cr,uid,ids):
-			if obj_building.building_area == 0:
-				raise osv.except_osv('Wrong value!', 'The area for the building has to bee greater than 0')
-		return super(rent_building,self).write(cr,uid,ids,vals,context)
-	def create(self, cr, uid,vals, context=None):
-		#Check for the area before creating the object
-		if vals['building_area'] == 0:
-			raise osv.except_osv('Wrong value!', 'The area for the building has to bee greater than 0')
-		return super(rent_building,self).create(cr,uid,vals,context)
-	
-	def _get_building_vrm(self,cr,uid,ids,field_name,args,context=None):
-		#This method calculates the vrn acording to the value an area of the building
-		res = {}
-		for building_id in ids:
-			obj_building = self.pool.get('rent.building').browse(cr,uid,building_id)
-			try:
-				res[building_id] = obj_building.building_value / obj_building.building_area
-			except:
-				res[building_id] = 0
-		return res
-		
-	_columns = {
-		'building_capacity'          : fields.integer('Capacity'),
-		'building_date_construction' : fields.date('Construction Date'),
-		'building_elevator'          : fields.boolean('Elevadores',help='Select if the building has at least one elevator'),
-		'building_elevators_number'  : fields.integer('Elvetators number',readonly=True,help='If checkbox of elevators is no selected this will be 0'),
-		'building_stairs'            : fields.boolean('Stairs',help='Select if the building has at least one elevator'),
-		'building_stairs_number'     : fields.integer('Stairs number',readonly=True,help='If checkbox of stairs is no selected this will be 0'),
-		'name'                       : fields.char('Name', size=40,required=True),
-		'building_value'             : fields.float('VRN Dynamic',required=True),
-		'building_area'              : fields.float('Area',required=True),
-		'building_estate_id'         : fields.many2one('rent.estate', 'estate',required=True),
-		'building_photo'             : fields.binary('Photo'),
-		'building_gallery_photo'     : fields.char('Gallery of Photos', size=64),
-		'building_floors_ids'        : fields.one2many('rent.floor','floor_building_id','Floors'),
-		'building_vrn_per_sqr'       : fields.function(_get_building_vrm,type='float',method=True,string='VRN Din/M2'),
-		'building_code'              : fields.char('Code', size=4, required=True),
-		#'building_asset_id'          : fields.many2one('account.asset.asset','Asset'),
-		'building_company_id'        : fields.many2one('res.company','Company',required=True),
-	}
-	_sql_constraints = [
-		('building_area_gt_zero', 'CHECK (building_area!=0)', 'The area for the building cannot be 0!'),
-		('building_code','UNIQUE (building_code)','You can not have two buildings with the same code!'),
-	]
-rent_building()
+    _name = 'rent.building'
+    
+    def write (self, cr, uid,ids,vals,context=None):
+        #Check for the area before saving the changes
+        for obj_building in self.browse(cr,uid,ids):
+            if obj_building.building_area == 0:
+                raise osv.except_osv('Wrong value!', 'The area for the building has to bee greater than 0')
+        return super(rent_building,self).write(cr,uid,ids,vals,context)
+    def create(self, cr, uid,vals, context=None):
+        #Check for the area before creating the object
+        if vals['building_area'] == 0:
+            raise osv.except_osv('Wrong value!', 'The area for the building has to bee greater than 0')
+        return super(rent_building,self).create(cr,uid,vals,context)
+    
+    def _get_building_vrm(self,cr,uid,ids,field_name,args,context=None):
+        #This method calculates the vrn acording to the value an area of the building
+        res = {}
+        for building_id in ids:
+            obj_building = self.pool.get('rent.building').browse(cr,uid,building_id)
+            try:
+                res[building_id] = obj_building.building_value / obj_building.building_area
+            except:
+                res[building_id] = 0
+        return res
+        
+    _columns = {
+        'building_capacity'          : fields.integer('Capacity'),
+        'building_date_construction' : fields.date('Construction Date'),
+        'building_elevator'          : fields.boolean('Elevadores',help='Select if the building has at least one elevator'),
+        'building_elevators_number'  : fields.integer('Elvetators number',readonly=True,help='If checkbox of elevators is no selected this will be 0'),
+        'building_stairs'            : fields.boolean('Stairs',help='Select if the building has at least one elevator'),
+        'building_stairs_number'     : fields.integer('Stairs number',readonly=True,help='If checkbox of stairs is no selected this will be 0'),
+        'name'                       : fields.char('Name', size=40,required=True),
+        'building_value'             : fields.float('VRN Dynamic',required=True),
+        'building_area'              : fields.float('Area',required=True),
+        'building_estate_id'         : fields.many2one('rent.estate', 'estate',required=True),
+        'building_photo'             : fields.binary('Photo'),
+        'building_gallery_photo'     : fields.char('Gallery of Photos', size=64),
+        'building_floors_ids'        : fields.one2many('rent.floor','floor_building_id','Floors'),
+        'building_vrn_per_sqr'       : fields.function(_get_building_vrm,type='float',method=True,string='VRN Din/M2'),
+        'building_code'              : fields.char('Code', size=4, required=True),
+        #'building_asset_id'          : fields.many2one('account.asset.asset','Asset'),
+        'building_company_id'        : fields.many2one('res.company','Company',required=True),
+    }
+    _sql_constraints = [
+        ('building_area_gt_zero', 'CHECK (building_area!=0)', 'The area for the building cannot be 0!'),
+        ('building_code','UNIQUE (building_code)','You can not have two buildings with the same code!'),
+    ]
 
 #Class that represents every single floor contained on the building, defined above
 #All floors are differenced by the number starting from 0 (basement), then higher 
 #the numbre then near to the top of the building is the floor.
 class rent_floor(osv.osv):
-	_name = 'rent.floor'
-	_rec_name = 'floor_number'
-	
-	def write (self, cr, uid,ids,vals,context=None):
-		#Check for the area before saving the changes
-		for obj_floor in self.browse(cr,uid,ids):
-			if obj_floor.floor_area == 0:
-				raise osv.except_osv('Wrong value!', 'The area for the floor has to bee greater than 0')
-			if vals and vals['floor_number']:
-				obj_build = obj_floor.floor_building_id
-				for obj_f in obj_build.building_floors_ids:
-					if obj_f.floor_number.upper() == vals['floor_number'].upper() and obj_f.id  != obj_floor.id:
-						raise osv.except_osv('Wrong value!', 'The number for the floor at the same building cannot be repeated')
-		return super(rent_floor,self).write(cr,uid,ids,vals,context)
-	def create(self, cr, uid,vals, context=None):
-		#Check for the area before creating the object
-		if vals['floor_area'] == 0:
-			raise osv.except_osv('Wrong value!', 'The area for the floor has to bee greater than 0')
-		if vals['floor_number']:
-				obj_build = self.pool.get('rent.building').browse(cr,uid,vals['floor_building_id'])
-				for obj_f in obj_build.building_floors_ids:
-					if obj_f.floor_number.upper() == vals['floor_number'].upper():
-						raise osv.except_osv('Wrong value!', 'The number for the floor at the same building cannot be repeated')
-		return super(rent_floor,self).create(cr,uid,vals,context)
-	
-	def _calculate_floor_value(self,cr,uid,ids,field_name,args,context):
-		#This method takes al the active rents for the floor and calculates the value according to 
-		#the value of the locals,parking, building and estate related to it
-		res = {}
-		valores = {}
-		total = 0
-		for floor_id in ids:
-			actual_rent = self.pool.get('rent.rent').search(cr,uid,['|',('state','=','active'),('state','=','draft'),('rent_related_real','=','local')])
-			for obj_rent in self.pool.get('rent.rent').browse(cr,uid,actual_rent):
-				obj_local = obj_rent.rent_rent_local_id
-				local_floor_ids = self.pool.get('rent.local.floor').search(cr,uid,[('local_local_floor_id','=',obj_local.id),('local_floor_floor_id','=',floor_id)])
-				for local in self.pool.get('rent.local.floor').browse(cr,uid,local_floor_ids):
-					valores = local._local_value(local.id,None,None)
-					total += valores[local.id]
-			
-			#This part look for the parking on rents associated to the floor
-			rent_ids = self.pool.get('rent.rent').search(cr,uid,['|',('state','=','active'),('state','=','draft'),('rent_related_real','=','parking')])
-			obj_rent = self.pool.get('rent.rent').browse(cr,uid,rent_ids)
-			for rent in obj_rent:
-				obj_parking = rent.rent_rent_parking_id
-				if (obj_parking.parking_floor_id.id == floor_id):
-					total += obj_parking._parking_value(obj_parking.id,None,None)[obj_parking.id]
-			res[floor_id] = total
-			total = 0
-		return res
-	
-	def _get_fullname(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for obj_floor in self.pool.get('rent.floor').browse(cr,uid,ids):
-			building_code = obj_floor.floor_building_id.building_code
-			res[obj_floor.id] = building_code + '-' + obj_floor.floor_number
-		return res
-	 
-	def name_get(self, cr, uid, ids, context=None):
-		if not len(ids):
-			return []
-		reads = self.read(cr, uid, ids, ['complete_name'], context=context)
-		res = []
-		for record in reads:
-			name = record['complete_name']
-			res.append((record['id'], name))
-		return res
+    _name = 'rent.floor'
+    _rec_name = 'floor_number'
+    
+    def write (self, cr, uid,ids,vals,context=None):
+        #Check for the area before saving the changes
+        for obj_floor in self.browse(cr,uid,ids):
+            if obj_floor.floor_area == 0:
+                raise osv.except_osv('Wrong value!', 'The area for the floor has to bee greater than 0')
+            if vals and vals['floor_number']:
+                obj_build = obj_floor.floor_building_id
+                for obj_f in obj_build.building_floors_ids:
+                    if obj_f.floor_number.upper() == vals['floor_number'].upper() and obj_f.id  != obj_floor.id:
+                        raise osv.except_osv('Wrong value!', 'The number for the floor at the same building cannot be repeated')
+        return super(rent_floor,self).write(cr,uid,ids,vals,context)
+    def create(self, cr, uid,vals, context=None):
+        #Check for the area before creating the object
+        if vals['floor_area'] == 0:
+            raise osv.except_osv('Wrong value!', 'The area for the floor has to bee greater than 0')
+        if vals['floor_number']:
+                obj_build = self.pool.get('rent.building').browse(cr,uid,vals['floor_building_id'])
+                for obj_f in obj_build.building_floors_ids:
+                    if obj_f.floor_number.upper() == vals['floor_number'].upper():
+                        raise osv.except_osv('Wrong value!', 'The number for the floor at the same building cannot be repeated')
+        return super(rent_floor,self).create(cr,uid,vals,context)
+    
+    def _calculate_floor_value(self,cr,uid,ids,field_name,args,context):
+        #This method takes al the active rents for the floor and calculates the value according to 
+        #the value of the locals,parking, building and estate related to it
+        res = {}
+        valores = {}
+        total = 0
+        for floor_id in ids:
+            actual_rent = self.pool.get('rent.rent').search(cr,uid,['|',('state','=','active'),('state','=','draft'),('rent_related_real','=','local')])
+            for obj_rent in self.pool.get('rent.rent').browse(cr,uid,actual_rent):
+                obj_local = obj_rent.rent_rent_local_id
+                local_floor_ids = self.pool.get('rent.local.floor').search(cr,uid,[('local_local_floor_id','=',obj_local.id),('local_floor_floor_id','=',floor_id)])
+                for local in self.pool.get('rent.local.floor').browse(cr,uid,local_floor_ids):
+                    valores = local._local_value(local.id,None,None)
+                    total += valores[local.id]
+            
+            #This part look for the parking on rents associated to the floor
+            rent_ids = self.pool.get('rent.rent').search(cr,uid,['|',('state','=','active'),('state','=','draft'),('rent_related_real','=','parking')])
+            obj_rent = self.pool.get('rent.rent').browse(cr,uid,rent_ids)
+            for rent in obj_rent:
+                obj_parking = rent.rent_rent_parking_id
+                if (obj_parking.parking_floor_id.id == floor_id):
+                    total += obj_parking._parking_value(obj_parking.id,None,None)[obj_parking.id]
+            res[floor_id] = total
+            total = 0
+        return res
+    
+    def _get_fullname(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for obj_floor in self.pool.get('rent.floor').browse(cr,uid,ids):
+            building_code = obj_floor.floor_building_id.building_code
+            res[obj_floor.id] = building_code + '-' + obj_floor.floor_number
+        return res
+     
+    def name_get(self, cr, uid, ids, context=None):
+        if not len(ids):
+            return []
+        reads = self.read(cr, uid, ids, ['complete_name'], context=context)
+        res = []
+        for record in reads:
+            name = record['complete_name']
+            res.append((record['id'], name))
+        return res
 
-	_columns = {
-		'floor_number'     : fields.char('# Floor',size=16,required=True, help='Number of the floor in the building, starts from 0 (Basement)'),
-		'floor_thickness'  : fields.float('Thickness'),
-		'floor_durability' : fields.integer('Durability', help='Indicate the durability in years'),
-		'floor_area'       : fields.float('Area',required=True),
-		'floor_value'      : fields.function(_calculate_floor_value,type='float',method=True,string='Value',help='This value is calculated using the estate and building area and values'),
-		'floor_acabado'    : fields.char('Acabado',size=64),
-		'floor_parking_ids'    : fields.one2many('rent.floor.parking','parking_floor_id','Parking'),
-		'floor_building_id'   : fields.many2one('rent.building','Building'),
-		'complete_name'    : fields.function(_get_fullname,type='char',method=True,string='Name',help='This name uses the code of the building and the floor name'),
-	}
-	_sql_constraints = [
-		('floor_area_gt_zero', 'CHECK (floor_area!=0)', 'The area for the floor cannot be 0!'),
-		('floor_building_number_key','UNIQUE(floor_number,floor_building_id)','You can not have two floors with the same number at the same building!'),
-	]
-rent_floor()
+    _columns = {
+        'floor_number'     : fields.char('# Floor',size=16,required=True, help='Number of the floor in the building, starts from 0 (Basement)'),
+        'floor_thickness'  : fields.float('Thickness'),
+        'floor_durability' : fields.integer('Durability', help='Indicate the durability in years'),
+        'floor_area'       : fields.float('Area',required=True),
+        'floor_value'      : fields.function(_calculate_floor_value,type='float',method=True,string='Value',help='This value is calculated using the estate and building area and values'),
+        'floor_acabado'    : fields.char('Acabado',size=64),
+        'floor_parking_ids'    : fields.one2many('rent.floor.parking','parking_floor_id','Parking'),
+        'floor_building_id'   : fields.many2one('rent.building','Building'),
+        'complete_name'    : fields.function(_get_fullname,type='char',method=True,string='Name',help='This name uses the code of the building and the floor name'),
+    }
+    _sql_constraints = [
+        ('floor_area_gt_zero', 'CHECK (floor_area!=0)', 'The area for the floor cannot be 0!'),
+        ('floor_building_number_key','UNIQUE(floor_number,floor_building_id)','You can not have two floors with the same number at the same building!'),
+    ]
 
 #Class representing the local, on every floor. This class has a relation 
 #with the floor throught the class rent_local_floor
 class rent_floor_local(osv.osv):
-	_name = 'rent.floor.local'
-	_rec_name = 'local_number'
-	
-	def write (self, cr, uid,ids,vals,context=None):
-		#Check for the area before saving the changes
-		for obj_local in self.browse(cr,uid,ids):
-			if obj_local.local_huella == 0:
-				raise osv.except_osv('Wrong value!', 'The huella for the local has to bee greater than 0')
-		return super(rent_floor_local,self).write(cr,uid,ids,vals,context)
-	def create(self, cr, uid,vals, context=None):
-		#Check for the area before creating the object
-		if vals['local_huella'] == 0:
-			raise osv.except_osv('Wrong value!', 'The huella for the local has to bee greater than 0')
-		return super(rent_floor_local,self).create(cr,uid,vals,context)
-	
-	def _get_building_local(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for local_id in ids:
-			local = self.pool.get('rent.local.floor').search(cr,uid,[('local_local_floor_id','=',local_id)])
-			res[local_id] = False
-			for lids in local:
-				obj_local = self.pool.get('rent.local.floor').browse(cr,uid,lids)
-				res[local_id] = obj_local.local_floor_floor_id.floor_building_id.id
-		return res
-	
-	def _determine_rented(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for local_id in ids:
-			res[local_id] =  False
-			rent_ids = self.pool.get('rent.rent').search(cr,uid,[('state','=','active'),('rent_related_real','=','local'),('rent_rent_local_id','=',local_id)])
-			if rent_ids:
-				res[local_id] =  True
-		return res
-	def _local_value(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		total = 0
-		for local in self.pool.get('rent.floor.local').browse(cr,uid,ids):
-			for obj_local_floor in local.local_local_by_floor_ids:
-				total += obj_local_floor._local_value(obj_local_floor.id,None,None)[obj_local_floor.id]
-			res[local.id] = total
-			total = 0
-		return res
+    _name = 'rent.floor.local'
+    _rec_name = 'local_number'
+    
+    def write (self, cr, uid,ids,vals,context=None):
+        #Check for the area before saving the changes
+        for obj_local in self.browse(cr,uid,ids):
+            if obj_local.local_huella == 0:
+                raise osv.except_osv('Wrong value!', 'The huella for the local has to bee greater than 0')
+        return super(rent_floor_local,self).write(cr,uid,ids,vals,context)
+    def create(self, cr, uid,vals, context=None):
+        #Check for the area before creating the object
+        if vals['local_huella'] == 0:
+            raise osv.except_osv('Wrong value!', 'The huella for the local has to bee greater than 0')
+        return super(rent_floor_local,self).create(cr,uid,vals,context)
+    
+    def _get_building_local(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for local_id in ids:
+            local = self.pool.get('rent.local.floor').search(cr,uid,[('local_local_floor_id','=',local_id)])
+            res[local_id] = False
+            for lids in local:
+                obj_local = self.pool.get('rent.local.floor').browse(cr,uid,lids)
+                res[local_id] = obj_local.local_floor_floor_id.floor_building_id.id
+        return res
+    
+    def _determine_rented(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for local_id in ids:
+            res[local_id] =  False
+            rent_ids = self.pool.get('rent.rent').search(cr,uid,[('state','=','active'),('rent_related_real','=','local'),('rent_rent_local_id','=',local_id)])
+            if rent_ids:
+                res[local_id] =  True
+        return res
+    def _local_value(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        total = 0
+        for local in self.pool.get('rent.floor.local').browse(cr,uid,ids):
+            for obj_local_floor in local.local_local_by_floor_ids:
+                total += obj_local_floor._local_value(obj_local_floor.id,None,None)[obj_local_floor.id]
+            res[local.id] = total
+            total = 0
+        return res
 
-	#def name_get(self, cr, uid, ids, context=None):
-	#	if not len(ids):
-	#		return []
-	#	reads = self.read(cr, uid, ids, ['local_number','local_building'], context=context)
-	#	res = []
-	#	for record in reads:
-	#		if record['local_number'] and record['local_building'] and record['local_building'][1]:
-	#			name = 'Local #' + str(record['local_number']) + ' , ' +  record['local_building'][1]
-	#			res.append((record['id'], name))
-	#	return res
-	
-	#This method takes the area of every record of local_by_floor and calculates the total area
-	def _local_area(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for obj_local in self.pool.get('rent.floor.local').browse(cr,uid,ids):
-			total = 0
-			for obj_local_floor in obj_local.local_local_by_floor_ids:
-				total += obj_local_floor.local_floor_area
-			res[obj_local.id] = total
-		return res
-	
-	_columns = {
-		'local_area'               : fields.function(_local_area,type='float',method=True,string='VRN Dynamic'),
-		'local_number'             : fields.char('# Local',required=True, size=64),
-		'local_huella'             : fields.float('Huella',required=True),
-		'local_water_meter_number' : fields.char('Water Meter',size=64), 
-		'local_light_meter_number' : fields.char('Electric Meter', size=64),
-		'local_rented'             : fields.function(_determine_rented,type='boolean',method=True,string='Rented',help='Check if the local is rented',store=True),
-		'local_local_by_floor_ids' : fields.one2many('rent.local.floor','local_local_floor_id','Local floors'),
-		'local_building'           : fields.function(_get_building_local,type='many2one',obj='rent.building',method=True,string='Building'),
-		'local_gallery_photo'      : fields.char('Photo Gallery', size=64),
-		'local_photo'              : fields.binary('Main photo'),
-		'local_rise_historic_ids'  : fields.one2many('rent.rent.anual.value','anual_value_local_ids','Historic', readonly=True),
-		'local_notes'              : fields.text('Notes'),
-	}
-	_sql_constraints = [
-		('local_huella_gt_zero', 'CHECK (local_huella!=0)', 'The area for the floor cannot be 0!'),
-	]
-rent_floor_local()
+    #def name_get(self, cr, uid, ids, context=None):
+    #    if not len(ids):
+    #        return []
+    #    reads = self.read(cr, uid, ids, ['local_number','local_building'], context=context)
+    #    res = []
+    #    for record in reads:
+    #        if record['local_number'] and record['local_building'] and record['local_building'][1]:
+    #            name = 'Local #' + str(record['local_number']) + ' , ' +  record['local_building'][1]
+    #            res.append((record['id'], name))
+    #    return res
+    
+    #This method takes the area of every record of local_by_floor and calculates the total area
+    def _local_area(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for obj_local in self.pool.get('rent.floor.local').browse(cr,uid,ids):
+            total = 0
+            for obj_local_floor in obj_local.local_local_by_floor_ids:
+                total += obj_local_floor.local_floor_area
+            res[obj_local.id] = total
+        return res
+    
+    _columns = {
+        'local_area'               : fields.function(_local_area,type='float',method=True,string='VRN Dynamic'),
+        'local_number'             : fields.char('# Local',required=True, size=64),
+        'local_huella'             : fields.float('Huella',required=True),
+        'local_water_meter_number' : fields.char('Water Meter',size=64), 
+        'local_light_meter_number' : fields.char('Electric Meter', size=64),
+        'local_rented'             : fields.function(_determine_rented,type='boolean',method=True,string='Rented',help='Check if the local is rented',store=True),
+        'local_local_by_floor_ids' : fields.one2many('rent.local.floor','local_local_floor_id','Local floors'),
+        'local_building'           : fields.function(_get_building_local,type='many2one',obj='rent.building',method=True,string='Building'),
+        'local_gallery_photo'      : fields.char('Photo Gallery', size=64),
+        'local_photo'              : fields.binary('Main photo'),
+        'local_rise_historic_ids'  : fields.one2many('rent.rent.anual.value','anual_value_local_ids','Historic', readonly=True),
+        'local_notes'              : fields.text('Notes'),
+    }
+    _sql_constraints = [
+        ('local_huella_gt_zero', 'CHECK (local_huella!=0)', 'The area for the floor cannot be 0!'),
+    ]
 
 ##Class used to connect the local to the floor, its a  many to one relation with the floor, allowing to locate it
 ##in one or more floors of the same building
 class rent_local_floor(osv.osv):
-	_name = 'rent.local.floor'
-	
-	def write (self, cr, uid,ids,vals,context=None):
-		#Check for the building and the floor so it can't be at diferent places before saving the changes
-		if vals['local_floor_floor_id']:
-			for obj_local_floor in self.browse(cr,uid,ids):
-				for obj_local_floor_check in obj_local_floor.local_local_floor_id.local_local_by_floor_ids:
-					current_floor = self.pool.get('rent.floor').browse(cr,uid,vals['local_floor_floor_id'])
-					if obj_local_floor_check.local_floor_floor_id.floor_building_id.id != current_floor.floor_building_id.id:
-						raise osv.except_osv('Wrong value!', 'The same local can not be on diferent buildings')
-						break
-		return super(rent_local_floor,self).write(cr,uid,ids,vals,context)
-	def create(self, cr, uid,vals, context=None):
-		#Check for the building and the floor so it can't be at diferent places before creating the object
-		locations_ids = self.search(cr,uid,[('local_local_floor_id','=',vals['local_local_floor_id'])])
-		current_floor = self.pool.get('rent.floor').browse(cr,uid,vals['local_floor_floor_id'])
-		for obj_local_floor in self.browse(cr,uid,locations_ids):
-			if obj_local_floor.local_floor_floor_id.floor_building_id.id != current_floor.floor_building_id.id:
-				raise osv.except_osv('Wrong value!', 'The same local can not be on diferent buildings')
-		return super(rent_local_floor,self).create(cr,uid,vals,context)
-	
-	def _local_sqr_price(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for local_id in ids:
-			obj = self.pool.get('rent.local.floor').browse(cr,uid,local_id)
-			obj_build = obj.local_floor_floor_id.floor_building_id
-			res[local_id] = obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
-		return res
-	
-	def _local_value(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for local_id in ids:
-			obj = self.pool.get('rent.local.floor').browse(cr,uid,local_id)
-			obj_build = obj.local_floor_floor_id.floor_building_id
-			res[local_id] = obj.local_floor_area * obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
-		return res
-	
-	def onchange_floor(self,cr,uid,ids,floor_id):
-		res = {}
-		if floor_id:
-			obj_floor = self.pool.get('rent.floor').browse(cr,uid,floor_id)
-			if obj_floor:
-				res['local_floor_building'] = obj_floor.floor_building_id.id
-		return {'value' : res}
-	_columns = {
-		'local_floor_front'     : fields.float('Front', required=True),
-		'local_floor_side'      : fields.float('Side', required=True),
-		'local_floor_floor_id'  : fields.many2one('rent.floor','Level',help='Represents the floor on witch its located the local',required=True),
-		'local_local_floor_id'  : fields.many2one('rent.floor.local','Local#',help='Represents the floor on witch its located the local'),
-		'local_floor_area'      : fields.float('Area M2',required=True),
-		'local_sqrmeter_price'  : fields.function(_local_sqr_price,type='float',method=True,string='Sqr Meter Price'),
-		'local_floor_value'     : fields.function(_local_value,type='float',method=True,string='Total Value'),
-		'local_floor_building'  : fields.related('local_floor_floor_id','floor_building_id',type='many2one',relation='rent.building',string='Building', readonly=True, store=False),
-	} 
-	_sql_constraints = [
-		('local_floor_area_gt_zero', 'CHECK (local_floor_area!=0)', 'The area for the local at this floor cannot be 0!'),
-		('local_floor_front_gt_zero', 'CHECK (local_floor_front!=0)', 'The front for the local cannot be 0!'),
-		('local_floor_side_gt_zero', 'CHECK (local_floor_side!=0)', 'The side for the local cannot be 0!'),
-		('local_floor_location_key','UNIQUE (local_floor_floor_id,local_local_floor_id)','You can not repeat the local at the same floor!'),
-	]
-rent_local_floor()
+    _name = 'rent.local.floor'
+    
+    def write (self, cr, uid,ids,vals,context=None):
+        #Check for the building and the floor so it can't be at diferent places before saving the changes
+        if vals['local_floor_floor_id']:
+            for obj_local_floor in self.browse(cr,uid,ids):
+                for obj_local_floor_check in obj_local_floor.local_local_floor_id.local_local_by_floor_ids:
+                    current_floor = self.pool.get('rent.floor').browse(cr,uid,vals['local_floor_floor_id'])
+                    if obj_local_floor_check.local_floor_floor_id.floor_building_id.id != current_floor.floor_building_id.id:
+                        raise osv.except_osv('Wrong value!', 'The same local can not be on diferent buildings')
+                        break
+        return super(rent_local_floor,self).write(cr,uid,ids,vals,context)
+    def create(self, cr, uid,vals, context=None):
+        #Check for the building and the floor so it can't be at diferent places before creating the object
+        locations_ids = self.search(cr,uid,[('local_local_floor_id','=',vals['local_local_floor_id'])])
+        current_floor = self.pool.get('rent.floor').browse(cr,uid,vals['local_floor_floor_id'])
+        for obj_local_floor in self.browse(cr,uid,locations_ids):
+            if obj_local_floor.local_floor_floor_id.floor_building_id.id != current_floor.floor_building_id.id:
+                raise osv.except_osv('Wrong value!', 'The same local can not be on diferent buildings')
+        return super(rent_local_floor,self).create(cr,uid,vals,context)
+    
+    def _local_sqr_price(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for local_id in ids:
+            obj = self.pool.get('rent.local.floor').browse(cr,uid,local_id)
+            obj_build = obj.local_floor_floor_id.floor_building_id
+            res[local_id] = obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
+        return res
+    
+    def _local_value(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for local_id in ids:
+            obj = self.pool.get('rent.local.floor').browse(cr,uid,local_id)
+            obj_build = obj.local_floor_floor_id.floor_building_id
+            res[local_id] = obj.local_floor_area * obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
+        return res
+    
+    def onchange_floor(self,cr,uid,ids,floor_id):
+        res = {}
+        if floor_id:
+            obj_floor = self.pool.get('rent.floor').browse(cr,uid,floor_id)
+            if obj_floor:
+                res['local_floor_building'] = obj_floor.floor_building_id.id
+        return {'value' : res}
+    _columns = {
+        'local_floor_front'     : fields.float('Front', required=True),
+        'local_floor_side'      : fields.float('Side', required=True),
+        'local_floor_floor_id'  : fields.many2one('rent.floor','Level',help='Represents the floor on witch its located the local',required=True),
+        'local_local_floor_id'  : fields.many2one('rent.floor.local','Local#',help='Represents the floor on witch its located the local'),
+        'local_floor_area'      : fields.float('Area M2',required=True),
+        'local_sqrmeter_price'  : fields.function(_local_sqr_price,type='float',method=True,string='Sqr Meter Price'),
+        'local_floor_value'     : fields.function(_local_value,type='float',method=True,string='Total Value'),
+        'local_floor_building'  : fields.related('local_floor_floor_id','floor_building_id',type='many2one',relation='rent.building',string='Building', readonly=True, store=False),
+    } 
+    _sql_constraints = [
+        ('local_floor_area_gt_zero', 'CHECK (local_floor_area!=0)', 'The area for the local at this floor cannot be 0!'),
+        ('local_floor_front_gt_zero', 'CHECK (local_floor_front!=0)', 'The front for the local cannot be 0!'),
+        ('local_floor_side_gt_zero', 'CHECK (local_floor_side!=0)', 'The side for the local cannot be 0!'),
+        ('local_floor_location_key','UNIQUE (local_floor_floor_id,local_local_floor_id)','You can not repeat the local at the same floor!'),
+    ]
 
 #Class representing the parking, on floor. This class has a relation 
 #many2one with the floor 
 #
 class rent_floor_parking(osv.osv):
-	_name = 'rent.floor.parking'
-	_rec_name = 'parking_number'
-	
-	def _parking_sqr_price(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for parking_id in ids:
-			obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
-			obj_build = obj.parking_floor_id.floor_building_id
-			res[parking_id] = obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
-		return res
-	
-	def _parking_value(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for parking_id in ids:
-			obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
-			areas = obj._parking_area(parking_id,None,None)
-			obj_build = obj.parking_floor_id.floor_building_id
-			res[parking_id] = areas[parking_id] * obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
-		return res
-		
-	def _parking_area(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for parking_id in ids:
-			obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
-			res[parking_id] = obj.parking_large * obj.parking_width
-		return res
-	
-	#def name_get(self, cr, uid, ids, context=None):
-	#	if not len(ids):
-	#		return []
-	#	reads = self.read(cr, uid, ids, ['parking_number','parking_floor_id'], context=context)
-	#	res = []
-	#	#debug('NOMBREPARKEO+==================================')
-	#	for record in reads:
-	#		#debug(record)
-	#		#debug(record['parking_floor_id'][1])
-	#		name = 'Parking #' + str(record['parking_number']) + ' , ' +  record['parking_floor_id'][1]
-	#	#	for subrecord in subreads 
-	#	#		name += ', ' + subrecord['local_floor_building']
-	#		res.append((record['id'], name))
-	#	return res
-	
-	def _determine_rented(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for parking_id in ids:
-			res[parking_id] =  False
-			rent_ids = self.pool.get('rent.rent').search(cr,uid,[('state','=','active'),('rent_related_real','=','parking'),('rent_rent_parking_id','=',parking_id)])
-			if rent_ids:
-				res[parking_id] =  True
-		return res
-	def onchange_floor(self,cr,uid,ids,floor_id):
-		res = {}
-		obj_floor = self.pool.get('rent.floor').browse(cr,uid,floor_id)
-		res['parking_floor_building'] = obj_floor.floor_building_id.id
-		return {'value' : res}
-		
-	_columns = {
-		'parking_area'            : fields.function(_parking_area,type='float',method=True,string='Area'),
-		'parking_value'           : fields.function(_parking_value,type='float',method=True,string='Value'),
-		#'parking_number'          : fields.integer('# Parking',required=True),
-		'parking_number'          : fields.char('# Parking',required=True, size=64),
-		'parking_huella'          : fields.float('Huella',required=True),
-		'parking_sqrmeter_price'  : fields.function(_parking_sqr_price,type='float',method=True,string='Sqr Meter Value'),
-		'parking_rented'          : fields.function(_determine_rented,type='boolean',method=True,string='Rented',help='Checked if the parking is rented'),
-		'parking_floor_id'        : fields.many2one('rent.floor','# Floor',required=True),
-		'parking_large'           : fields.float('Large Meters'),
-		'parking_width'           : fields.float('Width Meters'),
-		'parking_floor_building'  : fields.related('parking_floor_id','floor_building_id',type='many2one',relation='rent.building',string='Building', readonly=True, store=False),
-	}
-	_sql_constraints = [
-		('parking_huella_gt_zero', 'CHECK (parking_area!=0)', 'The huella for the parking cannot be 0!'),
-		('parking_large_gt_zero', 'CHECK (parking_large!=0)', 'The large for the parking cannot be 0!'),
-		('parking_width_gt_zero', 'CHECK (parking_width!=0)', 'The width for the parking cannot be 0!'),
-		('local_floor_side_gt_zero', 'CHECK (local_floor_side!=0)', 'The side for the local cannot be 0!'),
-		('parking_number_key','UNIQUE (parking_number,parking_floor_id)','You can not repeat the parking number at the same floor!'),
-	]
-rent_floor_parking()
+    _name = 'rent.floor.parking'
+    _rec_name = 'parking_number'
+    
+    def _parking_sqr_price(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for parking_id in ids:
+            obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
+            obj_build = obj.parking_floor_id.floor_building_id
+            res[parking_id] = obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
+        return res
+    
+    def _parking_value(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for parking_id in ids:
+            obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
+            areas = obj._parking_area(parking_id,None,None)
+            obj_build = obj.parking_floor_id.floor_building_id
+            res[parking_id] = areas[parking_id] * obj_build._get_building_vrm(obj_build.id,None,None)[obj_build.id]
+        return res
+        
+    def _parking_area(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for parking_id in ids:
+            obj = self.pool.get('rent.floor.parking').browse(cr,uid,parking_id)
+            res[parking_id] = obj.parking_large * obj.parking_width
+        return res
+    
+    #def name_get(self, cr, uid, ids, context=None):
+    #    if not len(ids):
+    #        return []
+    #    reads = self.read(cr, uid, ids, ['parking_number','parking_floor_id'], context=context)
+    #    res = []
+    #    #debug('NOMBREPARKEO+==================================')
+    #    for record in reads:
+    #        #debug(record)
+    #        #debug(record['parking_floor_id'][1])
+    #        name = 'Parking #' + str(record['parking_number']) + ' , ' +  record['parking_floor_id'][1]
+    #    #    for subrecord in subreads 
+    #    #        name += ', ' + subrecord['local_floor_building']
+    #        res.append((record['id'], name))
+    #    return res
+    
+    def _determine_rented(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for parking_id in ids:
+            res[parking_id] =  False
+            rent_ids = self.pool.get('rent.rent').search(cr,uid,[('state','=','active'),('rent_related_real','=','parking'),('rent_rent_parking_id','=',parking_id)])
+            if rent_ids:
+                res[parking_id] =  True
+        return res
+    def onchange_floor(self,cr,uid,ids,floor_id):
+        res = {}
+        obj_floor = self.pool.get('rent.floor').browse(cr,uid,floor_id)
+        res['parking_floor_building'] = obj_floor.floor_building_id.id
+        return {'value' : res}
+        
+    _columns = {
+        'parking_area'            : fields.function(_parking_area,type='float',method=True,string='Area'),
+        'parking_value'           : fields.function(_parking_value,type='float',method=True,string='Value'),
+        #'parking_number'          : fields.integer('# Parking',required=True),
+        'parking_number'          : fields.char('# Parking',required=True, size=64),
+        'parking_huella'          : fields.float('Huella',required=True),
+        'parking_sqrmeter_price'  : fields.function(_parking_sqr_price,type='float',method=True,string='Sqr Meter Value'),
+        'parking_rented'          : fields.function(_determine_rented,type='boolean',method=True,string='Rented',help='Checked if the parking is rented'),
+        'parking_floor_id'        : fields.many2one('rent.floor','# Floor',required=True),
+        'parking_large'           : fields.float('Large Meters'),
+        'parking_width'           : fields.float('Width Meters'),
+        'parking_floor_building'  : fields.related('parking_floor_id','floor_building_id',type='many2one',relation='rent.building',string='Building', readonly=True, store=False),
+    }
+    _sql_constraints = [
+        ('parking_huella_gt_zero', 'CHECK (parking_area!=0)', 'The huella for the parking cannot be 0!'),
+        ('parking_large_gt_zero', 'CHECK (parking_large!=0)', 'The large for the parking cannot be 0!'),
+        ('parking_width_gt_zero', 'CHECK (parking_width!=0)', 'The width for the parking cannot be 0!'),
+        ('local_floor_side_gt_zero', 'CHECK (local_floor_side!=0)', 'The side for the local cannot be 0!'),
+        ('parking_number_key','UNIQUE (parking_number,parking_floor_id)','You can not repeat the parking number at the same floor!'),
+    ]
 
 class rent_rent_group(osv.osv):
-	_name = 'rent.rent.group'
-	
-	def create(self,cr,uid,vals,context=None):
-		if vals:
-			next_seq = self.pool.get('ir.sequence').get(cr, uid, 'rent.rent.group')
-			rent = vals.get('obj_rent',False)
-			o = self.pool.get('rent.rent').browse(cr,uid,rent)
-			code = next_seq or (o and ('GRP-' + (o.rent_related_real == 'local' and o.rent_rent_local_id.name_get() or (o.rent_related_real == 'estate' and o.rent_rent_estate_id.name_get() or (o.rent_related_real == 'parking' and o.rent_rent_parking_id.name_get() or '')))))
-			vals['code'] = code
-		return super(rent_rent_group,self).create(cr,uid,vals,context)
-	
-	_columns = {
-		'name'            : fields.char('Name',size=64,required=True),
-		'rent_rent_ids'   : fields.one2many('rent.rent','rent_group_id','Rents Members',readonly=True, domain=[('rent_type','=','Contract')]),
-	}
-rent_rent_group()
+    _name = 'rent.rent.group'
+    
+    def create(self,cr,uid,vals,context=None):
+        if vals:
+            next_seq = self.pool.get('ir.sequence').get(cr, uid, 'rent.rent.group')
+            rent = vals.get('obj_rent',False)
+            o = self.pool.get('rent.rent').browse(cr,uid,rent)
+            code = next_seq or (o and ('GRP-' + (o.rent_related_real == 'local' and o.rent_rent_local_id.name_get() or (o.rent_related_real == 'estate' and o.rent_rent_estate_id.name_get() or (o.rent_related_real == 'parking' and o.rent_rent_parking_id.name_get() or '')))))
+            vals['code'] = code
+        return super(rent_rent_group,self).create(cr,uid,vals,context)
+    
+    _columns = {
+        'name'            : fields.char('Name',size=64,required=True),
+        'rent_rent_ids'   : fields.one2many('rent.rent','rent_group_id','Rents Members',readonly=True, domain=[('rent_type','=','Contract')]),
+    }
 
 #Class to hold all the information that refences the rent
 #value, dates, status and to control de transaction of the bussines
 
 class rent_rent(osv.osv):
-	_name = 'rent.rent'
-	
-	def onchange_estimations(self,cr,uid,ids,field):
-		res = {}
-		obj_sorted = sorted(field,key=lambda estimate: estimate.estimate_performance,reverse=True)
-		priority = 1
-		for obj_record in obj_sorted:
-			vals = {}
-			if obj_record.estimate_state != 'final':
-				if priority == 1:
-					vals['estimate_state'] = 'recommend'
-				elif priority == 2:
-					vals['estimate_state'] = 'min'
-				else:
-					vals['estimate_state'] = 'norec'
-				priority += 1
-			obj_record.write(vals)
-		return True
-		
-	def _get_total_area(self,cr,uid,ids,fields_name,args,context):
-		res = {}
-		for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
-			if obj_rent.rent_related_real == 'local':
-				total = obj_rent.rent_rent_local_id.local_area
-			elif obj_rent.rent_related_real == 'parking':
-				total = obj_rent.rent_rent_parking_id.parking_area
-			else:
-				total = obj_rent.rent_rent_estate_id.estate_area
-			res[obj_rent.id] = total
-		return res
-		
-	def _get_currency(self, cr, uid, context=None):
-		user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid], context=context)[0]
-		if user.company_id:
-			return user.company_id.currency_id.id
-		return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0]
-	
-	def _get_currency_eqv(self, cr, uid, context=None):
-		return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0]
-		
-	def _get_total_rent(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		total = 0
-		for obj_rent in self.browse(cr,uid,ids):
-			if obj_rent.rent_related_real == 'local':
-				obj_local = obj_rent.rent_rent_local_id
-				total = obj_local._local_value(obj_local.id,None,None)[obj_local.id]
-			elif obj_rent.rent_related_real == 'parking':
-				obj_parking = obj_rent.rent_rent_parking_id
-				total = obj_parking._parking_value(obj_parking.id,None,None)[obj_parking.id]
-			else:
-				obj_estado = obj_rent.rent_rent_estate_id
-				total = obj_estado._get_estate_vrm(obj_estado.id,None,None)[obj_estado.id]
-			
-			obj_client = obj_rent.rent_rent_client_id
-			company_currency = (obj_client.company_id and obj_client.company_id.currency_id or (obj_rent.currency_id or self.pool.get('res.currency').browse(cr,uid,self._get_currency(cr,uid,context))))
-			#company_currency = self.pool.get('res.currency').browse(cr,uid,company_currency_id)
-			to_exchange = {
-				'obj_rent' : obj_rent,
-				'vals'     : [('rent_total',total),
-				],
-				'from_currency' : company_currency,
-				'to_currency'   : obj_rent.currency_id,
-			}
-			exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
-			
-			total = exchanged['rent_total']
-			to_exchange = {
-				'obj_rent' : obj_rent,
-				'vals'     : [('rent_total_us',total),
-				],
-				'from_currency' : obj_rent.currency_id,
-				'to_currency'   : obj_rent.eqv_currency_id,
-			}
-			exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
-			total_vals = {}
-			total_vals['rent_total'] = total
-			total_vals['rent_total_us'] = exchanged['rent_total_us']
-			res[ obj_rent.id] = total_vals
-		return res
-		
-	def _calculate_years(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for rent_id in ids:
-			obj_rent = self.pool.get('rent.rent').browse(cr,uid,rent_id)
-			if (obj_rent.rent_end_date and  obj_rent.rent_start_date):
-				fin = parser.parse(obj_rent.rent_end_date)
-				inicio = parser.parse(obj_rent.rent_start_date)
-				res[rent_id] = (fin.year - inicio.year)
-		return res
-	
-	def copy (self, cr, uid, id, default=None, context=None):
-		obj_rent = self.browse(cr,uid,id, context=context)
-		if not default:
-			default = {}
-		default['name'] = (obj_rent.name or '') + '(copy)'
-		default.update({
-			'rent_modif' : [],
-			'rent_estimates_ids' : [],
-			'rent_historic_ids' : [],
-			'rent_invoice_ids' : [],
-			'rent_main_estimates_ids' : [],
-			'rent_historic_ids' : [],
-			'rent_main_invoice_ids' : [],
-			'state'      : 'draft',
-		})
-		return super(rent_rent, self).copy(cr, uid, id, default=default, context=context)
-		
-	def create(self,cr,uid, vals,context=None):
-		org_rent = vals
-		try:
-			user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid], context=context)[0]
-			if user.company_id:
-				org_rent.update({
-				#	'company_id'  : user.company_id.id,
-				})
-		#if vals:
-		#	if vals.get('rent_type') == 'Adendum':
-		#		rent_id = vals.get('rent_modif_ref')
-		#		org_rent = self.copy_data(cr,uid,rent_id)
-		#		org_rent.update({
-		#			'rent_type'      : 'Adendum',
-		#			'rent_modif_ref' : rent_id,
-		#		})
-		#		vals.update({
-		#			'rent_modif_ref' : False,
-		#			'rent_type'      : 'Contract',
-		#		})
-		#		#debug(org_rent)
-		#		#debug(vals)
-		#		self.write(cr,uid,[rent_id],vals)
-		except:
-			print ''
-		return super(rent_rent,self).create(cr,uid,org_rent,context)
-			
-	def default_get(self,cr,uid,fields_list,context=None):
-		res = {}
-		if context:
-			type = context.get('rent_type')
-			if type == 'Adendum':
-				rent_id = context.get('active_id')
-				if rent_id:
-					res = self.copy_data(cr,uid,rent_id)
-					res['rent_rent_account_id'] = context.get('rent_rent_account_id')
-					res['rent_rent_acc_int_id']  = context.get('rent_rent_acc_int_id')
-					if context.get('rent_main_inc'):
-						obj_rent = self.browse(cr,uid,rent_id)
-						res['rent_rent_main_account_id']  = context.get('rent_rent_main_account_id')
-						res['rent_rent_main_acc_int_id']  = context.get('rent_rent_main_acc_int_id')
-					res.update({
-						'rent_type'             : type,
-						'rent_estimates_ids'    : [],
-						'rent_modif'            : [],
-						'rent_historic_ids'     : [],
-						'rent_invoice_ids'      : [],
-						'state'                 : 'draft',
-						'rent_main_estimates_ids'    : [],
-						'rent_main_invoice_ids'      : [],
-						'rent_main_historic_ids'     : [],
-						'rent_modif_date'       : None,
-					})
-			else:
-				res = {
-					'state'        : 'draft',
-					'rent_type'    : 'Contract',
-					'currency_id': self._get_currency(cr,uid,context),
-					'eqv_currency_id': self._get_currency_eqv(cr,uid,context),
-					'main_currency_id': self._get_currency(cr,uid,context),
-					'main_eqv_currency_id': self._get_currency_eqv(cr,uid,context),
-					'rent_amount_base' : 0.00,
-					'rent_main_amount_base' : 0.00,
-					#'rent_rise'     : "%.2f%%" % (0.),
-					#'rent_main_rise': "%.2f%%" % (0.),
-					'rent_charge_day' : 01,
-					'rent_main_charge_day' : 01,
-					'rent_main_performance' : "%.2f%%" % (0.),
-					'active': 1,
-				}
-		return res
-		
-	def write(self, cr, uid, ids, vals, context=None):
-		obj_rent = self.pool.get('rent.rent').browse(cr,uid,ids)[0]
-		if 'rent_related_real' in vals:			
-			if (obj_rent.rent_related_real != vals['rent_related_real']):
-				real_type = vals['rent_related_real'] 
-				if real_type == 'local' or real_type == 'parking':
-					vals['rent_rent_estate_id'] = False
-				if real_type == 'local' or real_type == 'estate':
-					vals['rent_rent_parking_id'] = False
-				if real_type == 'parking' or real_type == 'estate':
-					vals['rent_rent_local_id'] = False		
-		super(rent_rent, self).write(cr, uid, ids, vals, context=context)
-		if 'rent_estimates_ids' in vals:
-			obj_rent.onchange_estimations(obj_rent.rent_estimates_ids)
-		#if 'rent_amount_base' in vals: 
-		#	self.register_historic(cr,uid,obj_rent)
-		return True
-		
-	def register_historic(self,cr,uid,obj_rent):
-		#obj_rent = self.browse(cr,uid,ids)[0]
-		if obj_rent:
-			vals = {}
-			is_registrated = False
-			current_date = parser.parse(obj_rent.rent_start_date).date()
-			current_date = current_date.replace(year=date.today().year)
-			for obj_historic in obj_rent.rent_historic_ids:
-				obj_date = parser.parse(obj_historic.anual_value_date).date()
-				if obj_date.year == current_date.year:
-				#if obj_historic.anual_value_date == current_date.isoformat():
-					is_registrated = True
-					match_historic = obj_historic
-					break
-			if not is_registrated:
-				#We need to update the amount_base of the rent, so we can
-				#charge the next part with the rate included
-				percentaje = obj_rent.rent_rise
-				prev_value = obj_rent.rent_amount_base
-				years_val = obj_rent.rent_amount_base * (1 + float(percentaje) / 100)
-				#obj_rent.write({'rent_amount_base' : years_val})
-				vals['rent_amount_base'] = years_val
-				if obj_rent.rent_related_real == 'local':
-					vals['anual_value_local_ids'] = obj_rent.rent_rent_local_id.id
-			
-				vals['rent_historic_ids'] = [(0,0,{'anual_value_rent_id':obj_rent.id,'anual_value_value':years_val,'anual_value_prev_value' : prev_value,'anual_value_rate' : obj_rent.rent_rise, 'anual_value_date' : current_date, 'anual_value_type' : 'rent', 'anual_value_local_ids':vals.get('anual_value_local_ids',False)})]
-			#else:
-			#	vals['rent_historic_ids'] = [(1,match_historic.id,{'anual_value_value':years_val,'anual_value_rate' : obj_rent.rent_rise})]
-			obj_rent.write(vals)
-		return True
-	
-	def register_main_historic(self,cr,uid,obj_rent):
-		#obj_rent = self.browse(cr,uid,ids)[0]
-		if obj_rent:
-			vals = {}
-			is_registrated = False
-			current_date = parser.parse(obj_rent.rent_main_start_date).date()
-			current_date = current_date.replace(year=date.today().year)
-			for obj_historic in obj_rent.rent_main_historic_ids:
-				obj_date = parser.parse(obj_historic.anual_value_date).date()
-				if obj_date.year == current_date.year:
-				#if obj_historic.anual_value_date == current_date.isoformat():
-					is_registrated = True
-					match_historic = obj_historic
-					break
-			if not is_registrated:
-				#We need to update the amount_base of the rent, so we ca
-				#charge the next part with the rate included
-				amount_base = obj_rent.rent_main_amount_base
-				rise = obj_rent.rent_main_rise
-				percentaje = rise
-				prev_value = amount_base
-				years_val = amount_base * (1 + float(percentaje) / 100)
-				#obj_rent.write({'rent_amount_base' : years_val})
-				vals['rent_main_amount_base'] = years_val
-				if obj_rent.rent_related_real == 'local':
-					vals['anual_value_local_ids'] = obj_rent.rent_rent_local_id.id
-				vals['rent_main_historic_ids'] = [(0,0,{'anual_value_rent_id':obj_rent.id,'anual_value_value':years_val,'anual_value_prev_value' : prev_value,'anual_value_rate' : rise, 'anual_value_date' : current_date, 'anual_value_type' : 'main','anual_value_local_ids':vals['anual_value_local_ids']})]
-			#else:
-			#	vals['rent_main_historic_ids'] = [(1,match_historic.id,{'anual_value_value':amount_base,'anual_value_rate' : rise})]
-			obj_rent.write(vals)
-		return True
-	def _value_per_sqr(self,cr,uid,ids,field_name,args,context):
-		#Calculates the price per sqr meter using the total area of the real state 
-		#and the final price or amount base of the rent
-		res = {}
-		for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
-			amounts_val = {}
-			valor = obj_rent._get_total_area(obj_rent.id,None,None)[obj_rent.id]
-			amounts_val['rent_amount_per_sqr'] = (obj_rent.rent_amount_base / (valor == 0 and 1.0 or valor)) 
-			
-			to_exchange = {
-				'obj_rent' : obj_rent,
-				'vals'     : [('rent_amountd_per_sqr',amounts_val['rent_amount_per_sqr']),
-				],
-				'from_currency' : obj_rent.currency_id,
-				'to_currency'   : obj_rent.eqv_currency_id,
-			}
-			
-			exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
-			amounts_val['rent_amountd_per_sqr'] = exchanged['rent_amountd_per_sqr']
-			res[obj_rent.id] = amounts_val
-		return res
-		
-	def _rent_performance(self,cr,uid,ids,field_name,args,context):
-		res = {}
-	#	if args:
-	#		if 'onchange_amount' in args:
-	#			amount = args.get('onchange_amount')
-	#			total = args.get('onchange_total')
-	#			res[0] = "%.2f%%" % ((amount * 12) /  (amount== 0.00 and 1 or total) * 100)
-	#	else:
-		for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
-			res[obj_rent.id] = "%.2f%%" % ((obj_rent.rent_amount_base * 12) /  (obj_rent.rent_total== 0.00 and 1 or obj_rent.rent_total) * 100)
-		return res
-		
-	def _rent_amount_years(self,cr,uid,ids,field_name,args,contexto):
-		res = {}
-		for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
-			years_val = {}
-			
-			percentaje = obj_rent.rent_rise
-			years_val['rent_rise_year2'] = obj_rent.rent_amount_base * (1 + float(percentaje) / 100)
-			years_val['rent_rise_year3'] = years_val['rent_rise_year2']  * (1 + float(percentaje) / 100)
-			
-			to_exchange = {
-				'obj_rent'      : obj_rent,
-				'vals'          : [('rent_rise_year2d',years_val['rent_rise_year2']),
-				('rent_rise_year3d',years_val['rent_rise_year3']),
-				('rent_amountd_base',obj_rent.rent_amount_base),
-				],
-				'from_currency' : obj_rent.currency_id,
-				'to_currency'   : obj_rent.eqv_currency_id,
-			}
-			
-			exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
-			years_val['rent_rise_year2d'] = exchanged['rent_rise_year2d']
-			years_val['rent_rise_year3d'] = exchanged['rent_rise_year3d']
-			
-			#Just to avoid use a separate function
-			years_val['rent_amountd_base'] = exchanged['rent_amountd_base']
-			res[obj_rent.id] = years_val
-		return res
-		
-	def inv_line_create(self, cr, uid,obj_rent,args,type='rent'):
-		res_data = {}
-		obj_company = obj_rent.rent_rent_client_id.company_id or False
-		
-		if type=='rent':
-			res_data['account_id'] = obj_rent.rent_rent_account_id.id
-		elif type == 'main':
-			res_data['account_id'] = obj_rent.rent_rent_main_account_id.id
-		elif type== 'services':
-			res_data['account_id'] = obj_rent.rent_inv_water_account_id.id
-
-		#if obj_company.currency_id.id != obj_rent.currency_id.id:
-		#	new_price = res_data['price_unit'] * obj_rent.currency_id.rate
-		#	res_data['price_unit'] = new_price
-
-		return (0, False, {
-			'name': args['desc'],
-			'account_id': res_data['account_id'],
-			'price_unit': args['amount'] or 0.0,
-			'quantity': 1 ,
-			'product_id': False,
-			'uos_id': False,
-			'invoice_line_tax_id': [(6, 0, [])],
-			'account_analytic_id': False,
-			'invoice_rent_id': obj_rent.id or args.get('rent_id', False),
-		})
-	
-	def invoice_rent(self, cr, uid, ids, args,type='rent',current_date=date.today(),first_inv=False):
-		#Creates the invoice for every rent given as arg, the args is a list of dictionaries 
-		#usually it only has one element. But it can take up 2 records to create an invoice with 2 lines
-		res = {}
-		journal_obj = self.pool.get('account.journal')
-		il = []
-		#debug(first_inv)
-
-		for rlist in args:
-			obj_rent = self.browse(cr,uid,rlist['rent_id'])
-			il.append(self.inv_line_create(cr, uid,obj_rent,rlist,type))
-
-		obj_client = obj_rent.rent_rent_client_id
-		a = obj_rent.rent_inv_account_id.id or obj_rent.rent_rent_account_id.id or obj_client.property_account_receivable.id
-		#a = obj_client.property_account_receivable.id
-		journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=',obj_rent.company_id.id)],limit=1)
-
-		if not journal_ids:
-			raise osv.except_osv(_('Error !'),
-				_('There is no purchase journal defined for this company: "%s" (id:%d)') % (obj_rent.company_id.name, obj_rent.company_id.id))
-		
-		#Determines if today is the previous month for the invoice creation
-		today = current_date
-		#debug(today)
-		if type=='rent':
-			if not first_inv:
-				date_due = (obj_rent.rent_invoiced_day < obj_rent.rent_charge_day and date(today.year,today.month,1) or (today.replace(day=1) + timedelta(days=32)).replace(day=1))
-				date_due = date_due.replace(day=obj_rent.rent_charge_day + obj_rent.rent_grace_period)
-			else:
-				date_due = today +  timedelta(days=obj_rent.rent_grace_period)
-		elif type == 'main':
-			if not first_inv:
-				date_due = (obj_rent.rent_main_invoiced_day < obj_rent.rent_main_charge_day and date(today.year,today.month,1) or (today.replace(day=1) + timedelta(days=32)).replace(day=1))
-				date_due = date_due.replace(day=obj_rent.rent_main_charge_day + obj_rent.rent_main_grace_period)
-			else:
-				date_due = today +  timedelta(days=obj_rent.rent_main_grace_period)
-		
-		desc = "Cobro de %s. Mes %s " % ((type=='rent'and 'alquiler' or 'mantenimiento'),date_due.strftime("%B %Y"))
-		
-		if not first_inv:
-			main_grace = (type=='rent'and obj_rent.rent_grace_period or obj_rent.rent_main_grace_period)
-			invoice_day = (type=='rent'and obj_rent.rent_invoiced_day or obj_rent.rent_main_invoiced_day)
-			
-			inv_date = date_due - timedelta(days= main_grace + invoice_day)
-		else:
-			inv_date = today
-		
-		period_id = False
-		if not period_id:
-			period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=', date_due or time.strftime('%Y-%m-%d')),('date_stop','>=',date_due or time.strftime('%Y-%m-%d')), ('company_id', '=', obj_rent.company_id.id)])
-			if period_ids:
-				period_id = period_ids[0]
-		
-		company_id = (type == 'rent' and obj_rent.company_id.id or (obj_rent.rent_main_company_id and obj_rent.rent_main_company_id.id or False))
-		
-		inv = {
-			'name': desc or obj_rent.name,
-			'reference': obj_rent.name or desc,
-			'account_id': a,
-			'type': 'out_invoice',
-			'partner_id': obj_client.id,
-			'currency_id': (type == 'rent' and obj_rent.currency_id.id or obj_rent.main_currency_id.id),
-			'address_invoice_id': obj_client.address[0].id,
-			'address_contact_id': obj_client.address[0].id,
-			'journal_id': len(journal_ids) and journal_ids[0] or False,
-			'origin': obj_rent.name or desc,
-			'invoice_line': il,
-			'fiscal_position': obj_client.property_account_position.id,
-			'payment_term': obj_client.property_payment_term and o.partner_id.property_payment_term.id or False,
-			'company_id': company_id,
-			'date_invoice' : inv_date or today,
-			'date_due' : date_due,
-			'period_id' : period_id or False,
-		}
-		inv_id = self.pool.get('account.invoice').create(cr, uid, inv, {'type':'out_invoice'})
-		self.pool.get('account.invoice').button_compute(cr, uid, [inv_id], {'type':'out_invoice'}, set_total=True)
-		res['invoice_id'] = inv_id
-		res['rent_id'] = obj_rent.id
-		res['invoice_type'] = type
-		self.register_rent_invoice(cr,uid,ids,res)
-		if type == 'rent' and obj_rent.rent_include_water:
-			#debug("TIENE COBRO DE AGUA")
-			self.invoice_services(cr,uid,[obj_rent.id],inv)
-		
-		return res
-	
-	def first_rent(self,cr,uid,ids,type='rent',current_date=date.today()):
-		#for the given list of ids it creates a list of the invoice data and later calls 
-		#the invoice_rent to create every invoice
-		#debug('GENERACION DE PRIMER PAGO')
-		res = []
-		for obj_rent in ids:
-			today = current_date
-			charge_date = date(today.year,today.month,1)
-			 
-			if type == 'rent':
-				init_date = parser.parse(obj_rent.rent_start_date).date()
-			elif type == 'main':
-				init_date = parser.parse(obj_rent.rent_main_start_date).date()
-			
-			init_date = init_date.replace(year=today.year)
-			
-			if (type == 'main' and obj_rent.rent_main_inc) or type == 'rent':
-				res.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': init_date, 'end_date' : charge_date.replace(day=calendar.mdays[charge_date.month])},type))
-			#debug(res)
-			self.invoice_rent(cr,uid,ids,res,type,first_inv=True)
-		return True
-	
-	def _invoice_main_required(self,cr,uid,ids,type='rent',current_date=date.today()):
-		#determines if the ids given require a invoice for the month
-		res = {}
-		for obj_rent in self.browse(cr,uid,ids):
-			is_required = False
-			today = current_date
-			if type == 'rent':
-					invoice_day = (obj_rent.rent_invoiced_day < obj_rent.rent_charge_day) and (obj_rent.rent_charge_day - obj_rent.rent_invoiced_day) or (calendar.mdays[today.month] - obj_rent.rent_invoiced_day +  obj_rent.rent_charge_day)
-					inv_rent_list = obj_rent.rent_invoice_ids
-			elif type == 'main':
-					invoice_day = (obj_rent.rent_main_invoiced_day < obj_rent.rent_main_charge_day) and (obj_rent.rent_main_charge_day - obj_rent.rent_main_invoiced_day) or (calendar.mdays[today.month] - obj_rent.rent_main_invoiced_day + obj_rent.rent_main_charge_day)
-					inv_rent_list = obj_rent.rent_main_invoice_ids
-			if today.day == invoice_day:
-				if (type == 'main' and obj_rent.rent_main_inc) or type == 'rent':
-					is_required = True
-					inv_rent_list = sorted(inv_rent_list,key=lambda reg: time.strptime(reg.invoice_due_date,'%Y-%m-%d'),reverse=True)
-					i = 0
-					for obj_inv_reg in inv_rent_list:
-						i += 1						
-						inv_date = parser.parse(obj_inv_reg.invoice_due_date).date()
-						inv_create = parser.parse(obj_inv_reg.invoice_date).date()
-						#inv_date = parser.parse(obj_inv_reg.invoice_date).date()
-						if type == 'rent':
-							start_date = parser.parse(obj_rent.rent_start_date).date()
-							charge_date = today+timedelta(days=obj_rent.rent_invoiced_day+obj_rent.rent_grace_period)
-						elif type == 'main':
-							start_date = parser.parse(obj_rent.rent_main_start_date).date()
-							charge_date = today+timedelta(days=obj_rent.rent_main_invoiced_day+obj_rent.rent_main_grace_period)
-						
-						#debug(inv_date)
-						#debug(charge_date)
-						#debug(today)
-						if inv_date.month == start_date.month and inv_date.year == start_date.year and len(inv_rent_list) <= 1:
-							#debug("SOLO TIENE 1 FACTURA")
-							is_required = True
-						elif (inv_date.month == charge_date.month and inv_date.year == charge_date.year):
-						#elif (inv_date.month == today.month and inv_date.year == today.year):
-							is_required = False
-							#debug("YA SE ENCONTRO UNA FACTURA QUE COINCIDE SE VA A SALIR")
-							break
-							#if (inv_date.month != charge_date.month and inv_date.year != charge_date.year):
-							#if (inv_date.month != charge_date.month and inv_date.year != charge_date.year) and ():
-							#	#debug("NECESITA FACTURA")
-							#	is_required = True
-						else:
-							is_required = True
-							#debug("No se ha encontrado una factura en los registros hasta el momento. %d" % (i))
-								
-						#elif (inv_date.month == today.month and inv_date.year == today.year):
-					#debug("veces iteradas")
-					#debug(i)
-					#debug(is_required)
-			res[obj_rent.id] = is_required
-		return res
-	
-	def register_rent_invoice(self,cr,uid,ids,args):
-		obj_rent = self.browse(cr,uid,args['rent_id'])
-		obj_rent.write({'rent_invoice_ids' : [(0,0,{'invoice_id':args['invoice_id'],'invoice_rent_id':obj_rent.id,'invoice_type':args['invoice_type']})]})
-		return True
-	
-	def rent_calc(self,cr,uid,ids,type='rent',current_date=date.today()):
-		#calculates the rent considering the date of change for the anual rate.
-		#Verify if the rent needs to increase the price due to an anual rise
-		#If the rise is at some point of the month it separetes the invoice on 2 lines 
-		#the first one from the first day and the day before the rise, and the second one
-		#from the day of rise to the end of month
-		#debug('GENERACION DE Pago Normal')
-		res = {}
-		res_deposit_fix = []
-		for obj_rent in ids:
-			res_dob_inv = []
-			#debug(current_date)
-			today = current_date
-			
-			if type=='rent':
-				rise_date = parser.parse(obj_rent.rent_start_date).date()
-				charge_date = (obj_rent.rent_invoiced_day < obj_rent.rent_charge_day and date(today.year,today.month,1) or (today.replace(day=1) + timedelta(days=32)).replace(day=1))
-			elif type == 'main':
-				rise_date = parser.parse(obj_rent.rent_main_start_date).date()
-				charge_date = (obj_rent.rent_main_invoiced_day < obj_rent.rent_main_charge_day and date(today.year,today.month,1) or (today.replace(day=1) + timedelta(days=32)).replace(day=1))
-				
-			rise_date = rise_date.replace(year=today.year)
-			
-			if rise_date.month == charge_date.month:
-				if rise_date.day > 1:
-					#It's necesary to check if the rise is on a day different than the first of every month
-					res_dob_inv.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': charge_date, 'end_date' : rise_date - timedelta(days=1)},type))
-					#res_dob_inv.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': charge_date, 'end_date' : rise_date.replace(day=rise_date.day-1)},type))
-				
-				#We need to update the amount_base of the rent, so we can
-				#charge the next part with the rate included
-				#NOTE: Even if the rise is on the second day of the month we apply the previous charge on the first day 
-				#and the new one on the remaining
-				if type=='rent':
-					self.register_historic(cr,uid,obj_rent)
-				elif type=='main':
-					self.register_main_historic(cr,uid,obj_rent)
-				obj_rent = self.browse(cr,uid,obj_rent.id)
-				res_dob_inv.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': rise_date, 'end_date' : charge_date.replace(day=calendar.mdays[charge_date.month])},type))
-				res_deposit_fix.append({'rent_id':obj_rent.id,'current_amount':obj_rent.rent_amount_base,'deposit':obj_rent.rent_deposit})
-			else:
-				res_dob_inv.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': charge_date, 'end_date' : charge_date.replace(day=calendar.mdays[charge_date.month])},type))
-
-			self.invoice_rent(cr,uid,ids,res_dob_inv,type,today)
-			if res_deposit_fix:
-				self._check_deposit(cr,uid,res_deposit_fix,context=None)
-		return True
-	
-	def invoice_services(self,cr,uid,ids,inv,current_date=date.today()):
-		#It receive a dictionary containing all the data for the invoice of the rent, and updates the values
-		#required to create another invoice for the services
-		#debug('INVOICE FOR SERVICES')
-		il = []
-		rlist = {
-			'amount' : 0.0,
-			'desc'   : '',
-		}
-		desc = 'Pago de servicios de '
-		today = current_date
-		for obj_rent in self.browse(cr,uid,ids):
-			if obj_rent.rent_include_water:
-				charged_month = (obj_rent.rent_invoiced_day < obj_rent.rent_charge_day and today or (today.replace(day=1) - timedelta(days=2)))
-				
-				obj_local = obj_rent.rent_rent_local_id
-				
-				desc = desc + "agua, %s mes de %s" % ( obj_local and (obj_local.local_water_meter_number and "Paja " + obj_local.local_water_meter_number or ''),
-				charged_month.strftime("%B %Y"))
-				
-				rlist.update({
-							'amount' : 0.0,
-							'desc'   : desc,
-				})
-				il.append(self.inv_line_create(cr, uid,obj_rent,rlist,type='services'))
-		desc = "Cobro de %s. Mes %s " % ('servicios',charged_month.strftime("%B %Y"))
-
-		currency = self._get_currency(cr,uid)
-		a = obj_rent.rent_inv_water_account_id.id or obj_rent.rent_inv_account_id.id
-		
-		inv.update({
-			'name': desc or obj_rent.name,
-		#	'account_id': a,
-			'currency_id': currency,
-			'invoice_line': il,
-		})
-		inv_id = self.pool.get('account.invoice').create(cr, uid, inv, {'type':'out_invoice'})
-		self.pool.get('account.invoice').button_compute(cr, uid, [inv_id], {'type':'out_invoice'}, set_total=True)
-		return True
-		
-	def _invoice_data(self,cr,uid,ids,obj_rent,date_range,type='rent'):
-		#creates a dictionary with all the needed data of the rent or maintenance
-		init_date = date_range['init_date']
-		end_date = date_range['end_date']
-		month_days = calendar.mdays[init_date.month]
-		charged_days = month_days
-		if (end_date.day == month_days and init_date.day != 1) or (end_date.day != month_days and init_date.day == 1):
-			charged_days = (end_date.day - init_date.day) + 1
-		if type == 'rent':
-			amount_base = obj_rent.rent_amount_base
-		elif type == 'main':
-			amount_base = obj_rent.rent_main_amount_base
-		
-		amount =  charged_days / float(month_days) * amount_base
-		if init_date != end_date:
-			desc = "Cobro de %s. Desde el %s hasta el %s" % ((type=='rent'and 'alquiler' or 'mantenimiento'),init_date.strftime("%A %d %B %Y"),end_date.strftime("%A %d %B %Y"))
-		else:
-			desc = "Cobro de %s. Del %s " % ((type=='rent'and 'alquiler' or 'mantenimiento'),init_date.strftime("%A %d %B %Y"))
-		
-		res = {
-			'rent_id': obj_rent.id,
-			'amount' : amount,
-			'date'   : end_date,
-			'desc'   : desc,
-		}
-		#debug(res)
-		return res
-		
-	def day_invoice_check(self,cr,uid):
-		#MAIN CRONJOB TO BE RUNNED EVERY DAY AN CREATE INVOICES
-		self.cron_rent_invoice(cr,uid,[])
-		return True
-		
-	def cron_rent_invoice(self,cr,uid,ids,context=None):
-		#gets the list of all active rents
-		rent_ids = self.search(cr,uid,[('state','=','active'),('rent_type','=','Contract')])
-		date_list = []
-		#debug('CRONJOB FORCED TEST')
-		#we retrieve the date of today and the last date registered at the log 
-		#this allows to create the list with dates between those two
-		today =date.today()
-		#debug(today)
-		log_id = self.pool.get('rent.invoice.log').search(cr,uid,[],order='log_date desc')
-		if log_id:
-			last_log = self.pool.get('rent.invoice.log').browse(cr,uid,log_id[0])
-			last_date = parser.parse(last_log.log_date).date() + timedelta(days=1)
-		else:
-			#if theres no record we set the today as the last_date assuming that 
-			#the cronjob has never been excecuted and add it to the list
-			last_date = today
-		#debug(last_date)
-		while last_date <= today:
-			date_list.append(last_date)
-			last_date += timedelta(days=1)
-		#once we have all that dates we run the method for each one 
-		#NOTE: date_list contains at least the today date
-		#debug(date_list)
-		for record_date in date_list:
-			is_required = self._invoice_main_required(cr,uid,rent_ids,'rent',record_date)
-			self._method_invoice_caller(cr,uid,rent_ids,is_required,'rent',record_date)
-		
-			#after we invocied all the rents, now we can proceed with the maintenance 
-			#debug("CALCULATING INVOICE FOR MAINTENANCE")
-			is_required = self._invoice_main_required(cr,uid,rent_ids,'main',record_date)
-			self._method_invoice_caller(cr,uid,rent_ids,is_required,'main',record_date)
-		if date_list:
-			log_desc = "CronJob ran for dates between %s to %s" % (date_list[0].strftime("%A %d %B %Y"),(len(date_list) > 1 and date_list[-1] or date_list[0]).strftime("%A %d %B %Y"))
-			self.pool.get('rent.invoice.log').create(cr,uid,{'log_date':today,'log_desc' : log_desc })
-		return True
-	
-	def _method_invoice_caller (self,cr,uid,rent_ids,is_required,type='rent',current_date=date.today()):
-		res_norm_inv = []
-		for obj_rent in self.browse(cr,uid,rent_ids):
-			if is_required[obj_rent.id]: 
-				#res_norm_inv.append(obj_rent.id)
-				res_norm_inv.append(obj_rent)
-		self.rent_calc(cr,uid,res_norm_inv,type,current_date)
-		return True
-	
-	def cron_rent_defaulter_interest(self,cr,uid):
-		#under develop
-		rent_ids = self.search(cr,uid,[('state','=','active')])
-		res = []
-		for obj_rent in self.browse(cr,uid,rent_ids):
-			today = date.today()
-			invoices_ids = self.pool.get('rent.rent.invoice').search(cr,uid,[('invoice_date','=',today.strftime('%Y-%m-%d'))])
-			for obj_invoice_rent in self.pool.get('rent.invoice.rent').browse(cr,uid,invoices_ids):
-				#date_due = parser.parse(obj_invoice_rent.date_due).date()
-				today = date.today()
-				limit_day = parser.parse(obj_invoice_rent.date_due).date().day + (obj_rent.rent_grace_period or 0)
-				if  (today.day > 8 and today.day > limit_dayand) and obj_invoice_rent.residual != 0:
-					res.append(obj_invoice_rent)
-		return True
-		
-	def cron_rent_date_due_check(self,cr,uid):
-		#TODO: SEND NOTIFICATION TO ADMIN
-		active_rent_ids = self.search(cr,uid,[('state','=','active'),('active','=','true')])
-		current_date = date.today()
-		required_action = []
-		for obj_ren in self.browse(cr,uid,active_rent_ids):
-			custom_month = current_date + timedelta(weeks=24)
-			if obj_ren.rent_end_date == custom_month:
-				required_action.append(obj_ren.id)
-		self._send_notification(cr,uid,required_action,context=None)
-		self._create_negotiation_contract(cr,uid,required_action,context=None)
-		return True
-		
-	def _send_notification(self,cr,uid,ids,context=None):
-		#Method that notifies the user about the problems to solve
-		return True
-		
-	def _create_negotiation_contract(self,cr,uid,ids,context=None):
-		copied = []
-		for rent_id in ids:
-			copied.append(self.copy(cr,uid,rent_id))
-		return True
-	
-	def test_negotiation(self,cr,uid,ids,context=None):
-		test_ids = self.search(cr,uid,[('state','=','draft')])
-		res_deposit_fix = []
-		#debug("ENTRAAAAAAAAAA")
-		for obj_rent in self.browse(cr,uid,test_ids):
-			res_deposit_fix.append({'rent_id':obj_rent.id,'current_amount':obj_rent.rent_amount_base,'deposit':obj_rent.rent_deposit})
-		#debug(res_deposit_fix)
-		self._check_deposit(cr,uid,res_deposit_fix,context=context)
-		return True
-	
-	def _check_deposit(self,cr,uid,args,context=None):
-		#
-		required_act = []
-		for record in args:
-			current = float(record['current_amount'])
-			depo = float(record['deposit'])
-			if current > depo:
-				required_act.append(record['rent_id'])
-		#TODO:ESCRIBIR METODO PARA QUE ALERTE
-		return True
-		
-	def action_aprove_adendum(self,cr,uid,ids,context=None):
-		rent_ids = self.search(cr,uid,[('state','=','active'), ('rent_type','in',['Adendum','Others']),('rent_modif_date','=',False)])
-		#debug(rent_ids)
-		#debug(ids)
-		for rent_aden_id in rent_ids:
-			vals = self.copy_data(cr,uid,rent_aden_id)
-			if vals:
-				if vals.get('rent_type') in ['Adendum','Others']:
-					rent_id = vals.get('rent_modif_ref')
-					org_rent = self.copy_data(cr,uid,rent_id)
-					org_rent.update({
-						'rent_type'          : vals.get('rent_type'),
-						'rent_modif_ref'     : rent_id,
-						'rent_estimates_ids' : [],
-						'rent_modif'         : [],
-						'rent_historic_ids'  : [],
-						'rent_invoice_ids'   : [],
-						'state'              : 'active',
-						'rent_modif_date'    : date.today(),
-					})
-					vals.update({
-						'rent_modif_ref'     : False,
-						'rent_type'          : 'Contract',
-						'state'              : 'active',
-						'rent_estimates_ids' : False,
-					})
-					self.write(cr,uid,[rent_id],vals)
-					self.write(cr,uid,[rent_aden_id],org_rent)
-		return True
-		
-	def action_first_invoice(self,cr,uid,ids,context=None):
-		#gets the list of all active rents
-		#debug(ids)
-		#rent_ids = self.search(cr,uid,[('state','=','active'), ('rent_type','in',['Contract'])])
-		#is_required = self._invoice_required(cr,uid,rent_ids)
-		res_first_inv = []
-		res_first_main_inv = []
-		for obj_rent in self.browse(cr,uid,ids):
-			#if is_required[obj_rent.id]: 
-			if obj_rent.rent_type == 'Contract':
-				has_first = self.pool.get('rent.invoice.rent').search(cr,uid,[('invoice_rent_id','=',obj_rent.id),('invoice_type','=','rent')])
-				if not has_first and parser.parse(obj_rent.rent_start_date).date().month == date.today().month:
-					#res_first_inv.append(obj_rent.id)
-					if obj_rent.rent_type != "Adendum":
-						#we only create invoice for the contracts NOT for the adendums
-						res_first_inv.append(obj_rent)
-					percentaje = obj_rent.rent_performance.split('%')[0]
-					#we update the estimates list for the obj
-					obj_rent.write({'rent_estimates_ids' : [(0,0,{'estimate_performance': float(percentaje),'estimate_rent_id':obj_rent.id,'estimate_date' : date.today(), 'estimate_state':'final'})]})
-					
-				#We check for maintenance invoice for this we need to heck if the rent hasta a maintenance record
-				if obj_rent.rent_main_inc:
-					has_main_first = self.pool.get('rent.invoice.rent').search(cr,uid,[('invoice_rent_id','=',obj_rent.id),('invoice_type','=','main')])
-					if not has_main_first and parser.parse(obj_rent.rent_main_start_date).date().month == date.today().month:
-						if obj_rent.rent_type != "Adendum":
-							#we only create invoice for the contracts NOT for the adendums
-							res_first_main_inv.append(obj_rent)
-						percentaje = obj_rent.rent_main_performance.split('%')[0]
-						obj_rent.write({'rent_main_estimates_ids' : [(0,0,{'estimate_performance': float(percentaje),'estimate_rent_id':obj_rent.id,'estimate_date' : date.today(), 'estimate_state':'final'})]})
-		
-		if res_first_inv:
-			self.first_rent(cr,uid,res_first_inv)
-		if res_first_main_inv:
-			self.first_rent(cr,uid,res_first_main_inv,'main')
-		return {}
-	
-	def calculate_negotiation(self,cr,uid,ids,context=None):
-		res = {}
-		return { 'value' : res}
-	
-	def onchange_calculate_exchange(self,cr,uid,ids,field):
-		res = {}
-		##debug('ONCHANGE')
-		##debug(ids)
-		#for obj_rent in self.browse(cr,uid,ids):
-		#if field:
-		#	res_total = self._get_total_rent(cr,uid,ids,{'rent_total','rent_total_us'},None,None)
-		#	res['rent_total'] = res_total[0]['rent_total']
-		#	res['rent_total_us'] = res_total[0]['rent_total_us']
-		#	
-		#	res['rent_performance'] = self._rent_performance(cr,uid,ids,'rent_performance',{'onchange_amount':field,'onchange_total' : res['rent_total']},None)[0]
-		#	
-		#	
-		#	res_years = self._rent_amount_years(cr,uid,ids,{'rent_rise_year2','rent_rise_year3','rent_amount_base','rent_rise_year2d','rent_rise_year3d','rent_amountd_base'},None)
-		#	res_sqr = self._value_per_sqr(cr,uid,ids,{'rent_performance','rent_amountd_per_sqr'},None,None)
-		#	res['rent_rise_year2'] = res_years[0]['rent_rise_year2']
-		#	res['rent_rise_year3'] = res_years[0]['rent_rise_year3']
-		#	res['rent_amount_base'] = res_years[0]['rent_amount_base']
-		#	res['rent_rise_year2d'] = res_years[0]['rent_rise_year2d']
-		#	res['rent_rise_year3d'] = res_years[0]['rent_rise_year3d']
-		#	res['rent_amountd_base'] = res_years[0]['rent_amountd_base']
-		#	
-		#	res['rent_performance'] = res_sqr[0]['rent_performance']
-		#	res['rent_amountd_per_sqr'] = res_sqr[0]['rent_amountd_per_sqr']
-		#	
-		#	
-		#for obj_rent in self.browse(cr,uid,ids):
-		#	current_currency = obj_rent.currency_id
-		#	obj_client = obj_rent.rent_rent_client_id
-		#	company_currency = (obj_client.company_id and obj_client.company_id.currency_id.id or self._get_currency(cr,uid,context))
-		#	if company_currency  == current_currency.id:
-		#		if current_currency.name != "USD":
-		#			res['eqv_currency_id'] = pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('name','=','USD')])[0]
-		#		else:
-		#			res['eqv_currency_id'] = company_currency
-		#	if company_currency  != current_currency.id:
-		#		res['eqv_currency_id'] = company_currency
-		#	
-		#	obj_rent.write({'currency_id': current_currency.id, 'eqv_currency_id': res['eqv_currency_id']})
-		return { 'value' : res}
-	
-	def _calculate_exchange(self,cr,uid,ids,args,context=None):
-		val = {}
-		if args:
-			#we search for all the variables so we can exchange currencies
-			obj_rent = args['obj_rent']
-			obj_client = obj_rent.rent_rent_client_id
-			orig_currency  = args['from_currency']
-			dest_currency  = args['to_currency']
-			#Main currency required, for now we asume its the USD
-			main_currency = pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('name','=','USD')])[0]
-			for record in args['vals']:
-				value = record[1]
-				if (orig_currency.id != dest_currency.id):
-					value = value / orig_currency.rate
-					if dest_currency.id != main_currency:
-						value = value * dest_currency.rate
-				val[record[0]] = value
-		return val
-		
-	def _rent_main_performance(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
-			total = 1
-			res[obj_rent.id] = "%.2f%%" % ((obj_rent.rent_main_amount_base * 12) /  (obj_rent.rent_main_total== 0.00 and 1 or obj_rent.rent_main_total) * 100) 
-		return res
-		
-	def _rent_main_amount_years(self,cr,uid,ids,field_name,args,contexto):
-		res = {}
-		for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
-			years_val = {}
-
-			percentaje = obj_rent.rent_main_rise
-			years_val['rent_main_rise_year2'] = obj_rent.rent_main_amount_base * (1 + float(percentaje) / 100)
-			years_val['rent_main_rise_year3'] = years_val['rent_main_rise_year2']  * (1 + float(percentaje) / 100)
-			
-			to_exchange = {
-				'obj_rent'      : obj_rent,
-				'vals'          : [('rent_main_rise_year2d',years_val['rent_main_rise_year2']),
-				('rent_main_rise_year3d',years_val['rent_main_rise_year3']),
-				('rent_main_amountd_base',obj_rent.rent_main_amount_base),
-				],
-				'from_currency' : obj_rent.main_currency_id or obj_rent.currency_id,
-				'to_currency'   : obj_rent.main_eqv_currency_id or obj_rent.eqv_currency_id,
-			}
-			
-			exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
-			years_val['rent_main_rise_year2d'] = exchanged['rent_main_rise_year2d']
-			years_val['rent_main_rise_year3d'] = exchanged['rent_main_rise_year3d']
-			
-			#Just to avoid use a separate function
-			years_val['rent_main_amountd_base'] = exchanged['rent_main_amountd_base']
-			
-			res[obj_rent.id] = years_val
-		return res
-	
-	#def _rent_rise_years(self,cr,uid,ids,field_name,args,context=None):
-	def onchange_rise_years(self,cr,uid,ids,field,base,rise):
-		res = {}
-		lines = []
-		#for obj_rent in self.browse(cr,uid,ids):
-		percentaje = rise
-		amount_base = base
-		years = field or 4
-		for x in range(1,years):
-			#debug(x)
-			amount_base	= amount_base * (1 + float(percentaje) / 100)
-			lines.append({'year' : x+1, 'amount' : amount_base})
-		#debug(lines)
-		res['rent_rise_chart_ids'] = lines
-		#debug(res)
-		return {'value' : res}
-	
-	_columns = {
-		'name'                  : fields.char('Name',size=64,required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'ref'                  : fields.char('Reference',size=64,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_rent_client_id'   : fields.many2one('res.partner','Client', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_end_date'         : fields.date('Ending Date', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_ending_motif'     : fields.selection([('early','Early Return'),('expiration','Contract Expiration'),('eviction','No payment eviction'), ('others','Various problems with tenant')],'Ending Motif'),
-		'rent_ending_motif_desc': fields.text('Ending Motif Description'),
-		
-		'rent_rise'             : fields.float('Anual Rise', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		#'rent_rise'             : fields.char('Anual Rise',size=64, required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_amount_base'      : fields.float('Final Price $', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_performance'      : fields.function(_rent_performance, type='char',method = True,string='Performance'),
-		'rent_rise_year2'       : fields.function(_rent_amount_years, type='float',method = True,string='Year 2 $', multi='Years'),
-		'rent_rise_year3'       : fields.function(_rent_amount_years, type='float',method = True,string='Year 3 $', multi='Years'),
-		'rent_amount_per_sqr'   : fields.function(_value_per_sqr, type='float',method = True,string='Amount per Sqr', multi='negot'),
-		
-		'rent_amountd_per_sqr'  : fields.function(_value_per_sqr, type='float',method = True,string='Amount m2 $', multi='negot'),
-		'rent_amountd_base'     : fields.function(_rent_amount_years, type='float',method = True,string='Final Price $', multi='Years'),
-		'rent_rise_year2d'      : fields.function(_rent_amount_years, type='float',method = True,string='Year 2  $', multi='Years'),
-		'rent_rise_year3d'      : fields.function(_rent_amount_years, type='float',method = True,string='Year 3  $', multi='Years'),
-		'rent_show_us_eq'       : fields.boolean('Check USD Currency Equivalent',store=False),
-		'rent_total_us'         : fields.function(_get_total_rent,type='float',method=True,string='Total Paid',multi='total'),
-		
-		'rent_type'             : fields.selection([('Contract','Contract'),('Adendum','Adendum'),('Others','Others')],'Type',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'state'                 : fields.selection([('active','Active'),('finished','Inactive'),('draft','Draft')],'Status', readonly=True),
-		'rent_start_date'       : fields.date('Starting Date', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_total'            : fields.function(_get_total_rent,type='float',method=True,string='Total Paid',multi='total'),
-		'rent_rent_local_id'    : fields.many2one('rent.floor.local','Local', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_rent_parking_id'  : fields.many2one('rent.floor.parking','Parking', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_rent_estate_id'   : fields.many2one('rent.estate','Estate', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_related_real'     : fields.selection([('local','Locals'),('parking','Parking'),('estate','Estates')],'Type of Real Estate', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_years'            : fields.function(_calculate_years,type='integer',method=True,string = 'Years' ,help='Check if you want to calculate a rent for locals'),
-		'rent_modif'            : fields.one2many('rent.rent', 'rent_modif_ref','Contract reference', states={'draft':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_modif_ref'        : fields.many2one('rent.rent', 'Modifications',ondelete='cascade'),
-		'currency_id'           : fields.many2one('res.currency', 'Currency', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'eqv_currency_id'       : fields.many2one('res.currency', 'Currency Equivalence', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_estimates_ids'    : fields.one2many('rent.rent.estimate', 'estimate_rent_id','Estimates',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),         
-		'rent_historic_ids'     : fields.one2many('rent.rent.anual.value', 'anual_value_rent_id','Historic',readonly=True, domain=[('anual_value_type', '=', 'rent')]),
-		'rent_charge_day'       : fields.integer('Charge Day', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indica el dia del mes para realizar los cobros del alquiler.'),
-		'rent_invoice_ids'      : fields.one2many('rent.invoice.rent','invoice_rent_id','Rent Invoices', domain=[('invoice_type', '=', 'rent')],readonly=True),
-		'rent_invoiced_day'     : fields.integer('Invoiced Day', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indicates de how many days before of the charge day will create the invoice'),
-		'rent_grace_period'     : fields.integer('Grace Period', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indicates de how many days after the charge day will allow to paid an invoice without Interest for delay'),
-		
-		'rent_group_id'         : fields.many2one('rent.rent.group','Contract Group',ondelete='cascade', readonly=True),
-		'rent_modif_date'       : fields.date('Modification Date',readonly=True),
-		
-		'rent_inv_account_id'   : fields.many2one('account.account','Invoice Account',help="This account will be used for invoices instead of the default one to value sales for the current rent",required=True,states={'finished':[('readonly',True)]}),
-		'rent_rent_account_id'  : fields.many2one('account.account','Income Account',help="This account will be used for invoices instead of the default one to value sales for the current rent",required=True,states={'finished':[('readonly',True)]}),
-		'rent_rent_acc_int_id'  : fields.many2one('account.account','Interest Account',help="This account will be used for invoices instead of the default one to value expenses for the current rent",required=True,states={'finished':[('readonly',True)]}),
-		#'rent_rent_account_id'  : fields.property(
-		#	'account.account',
-		#	type='many2one',
-		#	relation='account.account',
-		#	string="Income Account",
-		#	method=True,
-		#	view_load=True,
-		#	help="This account will be used for invoices instead of the default one to value sales for the current rent",required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		#'rent_rent_acc_int_id'  : fields.property(
-		#	'account.account',
-		#	type='many2one',
-		#	relation='account.account',
-		#	string="Interest Account",
-		#	method=True,
-		#	view_load=True,
-		#	help="This account will be used for invoices instead of the default one to value expenses for the current rent",required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_rent_real_area'   : fields.function(_get_total_area,type='float',method=True,string='Area'),
-		
-		'rent_main_inc'              : fields.boolean('Include Maintenance Rent',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		
-		#'rent_main_rise'             : fields.char('Anual Rise',size=64, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_main_rise'             : fields.float('Anual Rise', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_main_amount_base'      : fields.float('Final Price $', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_main_performance'      : fields.function(_rent_main_performance, type='char',method = True,string='Performance'),
-		'rent_main_amountd_base'     : fields.function(_rent_main_amount_years, type='float',method = True,string='Final Price $', multi='Years_main'),
-		'rent_main_rise_year2'       : fields.function(_rent_main_amount_years, type='float',method = True,string='Year 2  $', multi='Years_main'),
-		'rent_main_rise_year3'       : fields.function(_rent_main_amount_years, type='float',method = True,string='Year 3  $', multi='Years_main'),
-		'rent_main_rise_year2d'      : fields.function(_rent_main_amount_years, type='float',method = True,string='Year 2  $', multi='Years_main'),
-		'rent_main_rise_year3d'      : fields.function(_rent_main_amount_years, type='float',method = True,string='Year 3  $', multi='Years_main'),
-		'rent_main_show_us_eq'       : fields.boolean('Check USD Currency Equivalent',store=False),
-		'rent_main_estimates_ids'    : fields.one2many('rent.rent.main.estimate', 'estimate_maintenance_id','Estimates',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_main_invoice_ids'      : fields.one2many('rent.invoice.rent','invoice_rent_id','Rent Invoices', domain=[('invoice_type', '=', 'main')],readonly=True),
-		'rent_main_total'            : fields.float('Total Paid'),
-		
-		'main_currency_id'           : fields.many2one('res.currency', 'Currency', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'main_eqv_currency_id'       : fields.many2one('res.currency', 'Currency Equivalence', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		
-		#'rent_main_total_us'         : fields.float('Total Paid $'),
-		'rent_main_historic_ids'     : fields.one2many('rent.rent.anual.value', 'anual_value_rent_id','Historic',readonly=True, domain=[('anual_value_type', '=', 'main')]),      
-		'rent_main_company_id'       : fields.many2one('res.company', 'Supplier Company',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),      
-		
-		'rent_main_charge_day'       : fields.integer('Charge Day',states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indica el dia del mes para realizar los cobros del alquiler.'),
-		'rent_main_invoiced_day'     : fields.integer('Invoiced Day',states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indicates de how many days before of the charge day will create the invoice'),
-		'rent_main_grace_period'     : fields.integer('Grace Period',states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indicates de how many days after the charge day will allow to paid an invoice without Interest for delay'),   
-		
-		'rent_rent_main_account_id'  : fields.many2one('account.account','Income Account',help="This account will be used for invoices instead of the default one to value sales for the current rent",states={'finished':[('readonly',True)]}),
-		'rent_rent_main_acc_int_id'  : fields.many2one('account.account','Interest Account',help="This account will be used for invoices instead of the default one to value expenses for the current rent",states={'finished':[('readonly',True)]}),
-		'rent_inv_main_account_id'   : fields.many2one('account.account','Invoice Account',help="This account will be used for invoices instead of the default one to value expenses for the current rent",states={'finished':[('readonly',True)]}),
-		
-		'rent_main_end_date'         : fields.date('Ending Date', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		'rent_main_start_date'       : fields.date('Starting Date', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
-		
-		'rent_notes'                 : fields.text('Notes',help='Add complementary information about the rent or maintenance'),
-		'main_notes'                 : fields.text('Notes',help='Add complementary information about the rent or maintenance'),
-		
-		'rent_include_water'         : fields.boolean('Include water payment',readonly=True, states={'draft':[('readonly',False)]},help="Check if you want to generate an invoice for the water payment"),
-		'rent_inv_water_account_id'  : fields.many2one('account.account','Water payment Account',help="This account will be used for invoices of water instead of the default one to value expenses for the current rent",states={'finished':[('readonly',True)]}),
-		
-		'company_id'                 : fields.many2one('res.company', 'Company',readonly=True),
-		'rent_deposit'               : fields.float('Deposit', required=True, states={'finished':[('readonly',True)]}),
-		
-		'active'                     : fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the resource record without removing it."),
-		#'rent_rise_chart_ids'        : fields.one2many('rent.rise.estimate','rent_id', 'Rise Chart'),
-		#'rent_rise_chart_years'      : fields.integer('Rise years',help='Indicate the number of years you want to see at the chart of rise estimates'),
-		
-		#'rent_rise_chart2_ids'       : fields.function(_rent_rise_years, type='one2many', obj= 'rent.rise.estimate', method = True,string='Rise for Years'),
-	}
-	
-	_defaults = {
-		'state'        : 'draft',
-		'rent_type'    : 'Contract',
-		'currency_id': _get_currency,
-		'eqv_currency_id': _get_currency_eqv,
-		'main_currency_id': _get_currency,
-		'main_eqv_currency_id': _get_currency_eqv,
-		'rent_amount_base' : 0.00,
-		'rent_main_amount_base' : 0.00,
-		#'rent_rise'     : "%.2f%%" % (0.),
-		#'rent_main_rise': "%.2f%%" % (0.),
-		'rent_charge_day' : 01,
-		'rent_main_charge_day' : 01,
-		'rent_main_performance' : "%.2f%%" % (0.),
-		'rent_modif_date' : date.today(),
-		'active': 1,
-	}
-rent_rent()
+    _name = 'rent.rent'
+    
+    def onchange_estimations(self,cr,uid,ids,field):
+        res = {}
+        obj_sorted = sorted(field,key=lambda estimate: estimate.estimate_performance,reverse=True)
+        priority = 1
+        for obj_record in obj_sorted:
+            vals = {}
+            if obj_record.estimate_state != 'final':
+                if priority == 1:
+                    vals['estimate_state'] = 'recommend'
+                elif priority == 2:
+                    vals['estimate_state'] = 'min'
+                else:
+                    vals['estimate_state'] = 'norec'
+                priority += 1
+            obj_record.write(vals)
+        return True
+        
+    def _get_total_area(self,cr,uid,ids,fields_name,args,context):
+        res = {}
+        for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
+            if obj_rent.rent_related_real == 'local':
+                total = obj_rent.rent_rent_local_id.local_area
+            elif obj_rent.rent_related_real == 'parking':
+                total = obj_rent.rent_rent_parking_id.parking_area
+            else:
+                total = obj_rent.rent_rent_estate_id.estate_area
+            res[obj_rent.id] = total
+        return res
+        
+    def _get_currency(self, cr, uid, context=None):
+        user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid], context=context)[0]
+        if user.company_id:
+            return user.company_id.currency_id.id
+        return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0]
+    
+    def _get_currency_eqv(self, cr, uid, context=None):
+        return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0]
+        
+    def _get_total_rent(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        total = 0
+        for obj_rent in self.browse(cr,uid,ids):
+            if obj_rent.rent_related_real == 'local':
+                obj_local = obj_rent.rent_rent_local_id
+                total = obj_local._local_value(obj_local.id,None,None)[obj_local.id]
+            elif obj_rent.rent_related_real == 'parking':
+                obj_parking = obj_rent.rent_rent_parking_id
+                total = obj_parking._parking_value(obj_parking.id,None,None)[obj_parking.id]
+            else:
+                obj_estado = obj_rent.rent_rent_estate_id
+                total = obj_estado._get_estate_vrm(obj_estado.id,None,None)[obj_estado.id]
+            
+            obj_client = obj_rent.rent_rent_client_id
+            company_currency = (obj_client.company_id and obj_client.company_id.currency_id or (obj_rent.currency_id or self.pool.get('res.currency').browse(cr,uid,self._get_currency(cr,uid,context))))
+            #company_currency = self.pool.get('res.currency').browse(cr,uid,company_currency_id)
+            to_exchange = {
+                'obj_rent' : obj_rent,
+                'vals'     : [('rent_total',total),
+                ],
+                'from_currency' : company_currency,
+                'to_currency'   : obj_rent.currency_id,
+            }
+            exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
+            
+            total = exchanged['rent_total']
+            to_exchange = {
+                'obj_rent' : obj_rent,
+                'vals'     : [('rent_total_us',total),
+                ],
+                'from_currency' : obj_rent.currency_id,
+                'to_currency'   : obj_rent.eqv_currency_id,
+            }
+            exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
+            total_vals = {}
+            total_vals['rent_total'] = total
+            total_vals['rent_total_us'] = exchanged['rent_total_us']
+            res[ obj_rent.id] = total_vals
+        return res
+        
+    def _calculate_years(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for rent_id in ids:
+            obj_rent = self.pool.get('rent.rent').browse(cr,uid,rent_id)
+            if (obj_rent.rent_end_date and  obj_rent.rent_start_date):
+                fin = parser.parse(obj_rent.rent_end_date)
+                inicio = parser.parse(obj_rent.rent_start_date)
+                res[rent_id] = (fin.year - inicio.year)
+        return res
+    
+    def copy (self, cr, uid, id, default=None, context=None):
+        obj_rent = self.browse(cr,uid,id, context=context)
+        if not default:
+            default = {}
+        default['name'] = (obj_rent.name or '') + '(copy)'
+        default.update({
+            'rent_modif' : [],
+            'rent_estimates_ids' : [],
+            'rent_historic_ids' : [],
+            'rent_invoice_ids' : [],
+            'rent_main_estimates_ids' : [],
+            'rent_historic_ids' : [],
+            'rent_main_invoice_ids' : [],
+            'state'      : 'draft',
+        })
+        return super(rent_rent, self).copy(cr, uid, id, default=default, context=context)
+        
+    def create(self,cr,uid, vals,context=None):
+        org_rent = vals
+        try:
+            user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid], context=context)[0]
+            if user.company_id:
+                org_rent.update({
+                #    'company_id'  : user.company_id.id,
+                })
+        #if vals:
+        #    if vals.get('rent_type') == 'Adendum':
+        #        rent_id = vals.get('rent_modif_ref')
+        #        org_rent = self.copy_data(cr,uid,rent_id)
+        #        org_rent.update({
+        #            'rent_type'      : 'Adendum',
+        #            'rent_modif_ref' : rent_id,
+        #        })
+        #        vals.update({
+        #            'rent_modif_ref' : False,
+        #            'rent_type'      : 'Contract',
+        #        })
+        #        #debug(org_rent)
+        #        #debug(vals)
+        #        self.write(cr,uid,[rent_id],vals)
+        except:
+            print ''
+        return super(rent_rent,self).create(cr,uid,org_rent,context)
+            
+    def default_get(self,cr,uid,fields_list,context=None):
+        res = {}
+        if context:
+            type = context.get('rent_type')
+            if type == 'Adendum':
+                rent_id = context.get('active_id')
+                if rent_id:
+                    res = self.copy_data(cr,uid,rent_id)
+                    res['rent_rent_account_id'] = context.get('rent_rent_account_id')
+                    res['rent_rent_acc_int_id']  = context.get('rent_rent_acc_int_id')
+                    if context.get('rent_main_inc'):
+                        obj_rent = self.browse(cr,uid,rent_id)
+                        res['rent_rent_main_account_id']  = context.get('rent_rent_main_account_id')
+                        res['rent_rent_main_acc_int_id']  = context.get('rent_rent_main_acc_int_id')
+                    res.update({
+                        'rent_type'             : type,
+                        'rent_estimates_ids'    : [],
+                        'rent_modif'            : [],
+                        'rent_historic_ids'     : [],
+                        'rent_invoice_ids'      : [],
+                        'state'                 : 'draft',
+                        'rent_main_estimates_ids'    : [],
+                        'rent_main_invoice_ids'      : [],
+                        'rent_main_historic_ids'     : [],
+                        'rent_modif_date'       : None,
+                    })
+            else:
+                res = {
+                    'state'        : 'draft',
+                    'rent_type'    : 'Contract',
+                    'currency_id': self._get_currency(cr,uid,context),
+                    'eqv_currency_id': self._get_currency_eqv(cr,uid,context),
+                    'main_currency_id': self._get_currency(cr,uid,context),
+                    'main_eqv_currency_id': self._get_currency_eqv(cr,uid,context),
+                    'rent_amount_base' : 0.00,
+                    'rent_main_amount_base' : 0.00,
+                    #'rent_rise'     : "%.2f%%" % (0.),
+                    #'rent_main_rise': "%.2f%%" % (0.),
+                    'rent_charge_day' : 01,
+                    'rent_main_charge_day' : 01,
+                    'rent_main_performance' : "%.2f%%" % (0.),
+                    'active': 1,
+                }
+        return res
+        
+    def write(self, cr, uid, ids, vals, context=None):
+        obj_rent = self.pool.get('rent.rent').browse(cr,uid,ids)[0]
+        if 'rent_related_real' in vals:            
+            if (obj_rent.rent_related_real != vals['rent_related_real']):
+                real_type = vals['rent_related_real'] 
+                if real_type == 'local' or real_type == 'parking':
+                    vals['rent_rent_estate_id'] = False
+                if real_type == 'local' or real_type == 'estate':
+                    vals['rent_rent_parking_id'] = False
+                if real_type == 'parking' or real_type == 'estate':
+                    vals['rent_rent_local_id'] = False        
+        super(rent_rent, self).write(cr, uid, ids, vals, context=context)
+        if 'rent_estimates_ids' in vals:
+            obj_rent.onchange_estimations(obj_rent.rent_estimates_ids)
+        #if 'rent_amount_base' in vals: 
+        #    self.register_historic(cr,uid,obj_rent)
+        return True
+        
+    def register_historic(self,cr,uid,obj_rent):
+        #obj_rent = self.browse(cr,uid,ids)[0]
+        if obj_rent:
+            vals = {}
+            is_registrated = False
+            current_date = parser.parse(obj_rent.rent_start_date).date()
+            current_date = current_date.replace(year=date.today().year)
+            for obj_historic in obj_rent.rent_historic_ids:
+                obj_date = parser.parse(obj_historic.anual_value_date).date()
+                if obj_date.year == current_date.year:
+                #if obj_historic.anual_value_date == current_date.isoformat():
+                    is_registrated = True
+                    match_historic = obj_historic
+                    break
+            if not is_registrated:
+                #We need to update the amount_base of the rent, so we can
+                #charge the next part with the rate included
+                percentaje = obj_rent.rent_rise
+                prev_value = obj_rent.rent_amount_base
+                years_val = obj_rent.rent_amount_base * (1 + float(percentaje) / 100)
+                #obj_rent.write({'rent_amount_base' : years_val})
+                vals['rent_amount_base'] = years_val
+                if obj_rent.rent_related_real == 'local':
+                    vals['anual_value_local_ids'] = obj_rent.rent_rent_local_id.id
+            
+                vals['rent_historic_ids'] = [(0,0,{'anual_value_rent_id':obj_rent.id,'anual_value_value':years_val,'anual_value_prev_value' : prev_value,'anual_value_rate' : obj_rent.rent_rise, 'anual_value_date' : current_date, 'anual_value_type' : 'rent', 'anual_value_local_ids':vals.get('anual_value_local_ids',False)})]
+            #else:
+            #    vals['rent_historic_ids'] = [(1,match_historic.id,{'anual_value_value':years_val,'anual_value_rate' : obj_rent.rent_rise})]
+            obj_rent.write(vals)
+        return True
+    
+    def register_main_historic(self,cr,uid,obj_rent):
+        #obj_rent = self.browse(cr,uid,ids)[0]
+        if obj_rent:
+            vals = {}
+            is_registrated = False
+            current_date = parser.parse(obj_rent.rent_main_start_date).date()
+            current_date = current_date.replace(year=date.today().year)
+            for obj_historic in obj_rent.rent_main_historic_ids:
+                obj_date = parser.parse(obj_historic.anual_value_date).date()
+                if obj_date.year == current_date.year:
+                #if obj_historic.anual_value_date == current_date.isoformat():
+                    is_registrated = True
+                    match_historic = obj_historic
+                    break
+            if not is_registrated:
+                #We need to update the amount_base of the rent, so we ca
+                #charge the next part with the rate included
+                amount_base = obj_rent.rent_main_amount_base
+                rise = obj_rent.rent_main_rise
+                percentaje = rise
+                prev_value = amount_base
+                years_val = amount_base * (1 + float(percentaje) / 100)
+                #obj_rent.write({'rent_amount_base' : years_val})
+                vals['rent_main_amount_base'] = years_val
+                if obj_rent.rent_related_real == 'local':
+                    vals['anual_value_local_ids'] = obj_rent.rent_rent_local_id.id
+                vals['rent_main_historic_ids'] = [(0,0,{'anual_value_rent_id':obj_rent.id,'anual_value_value':years_val,'anual_value_prev_value' : prev_value,'anual_value_rate' : rise, 'anual_value_date' : current_date, 'anual_value_type' : 'main','anual_value_local_ids':vals['anual_value_local_ids']})]
+            #else:
+            #    vals['rent_main_historic_ids'] = [(1,match_historic.id,{'anual_value_value':amount_base,'anual_value_rate' : rise})]
+            obj_rent.write(vals)
+        return True
+    def _value_per_sqr(self,cr,uid,ids,field_name,args,context):
+        #Calculates the price per sqr meter using the total area of the real state 
+        #and the final price or amount base of the rent
+        res = {}
+        for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
+            amounts_val = {}
+            valor = obj_rent._get_total_area(obj_rent.id,None,None)[obj_rent.id]
+            amounts_val['rent_amount_per_sqr'] = (obj_rent.rent_amount_base / (valor == 0 and 1.0 or valor)) 
+            
+            to_exchange = {
+                'obj_rent' : obj_rent,
+                'vals'     : [('rent_amountd_per_sqr',amounts_val['rent_amount_per_sqr']),
+                ],
+                'from_currency' : obj_rent.currency_id,
+                'to_currency'   : obj_rent.eqv_currency_id,
+            }
+            
+            exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
+            amounts_val['rent_amountd_per_sqr'] = exchanged['rent_amountd_per_sqr']
+            res[obj_rent.id] = amounts_val
+        return res
+        
+    def _rent_performance(self,cr,uid,ids,field_name,args,context):
+        res = {}
+    #    if args:
+    #        if 'onchange_amount' in args:
+    #            amount = args.get('onchange_amount')
+    #            total = args.get('onchange_total')
+    #            res[0] = "%.2f%%" % ((amount * 12) /  (amount== 0.00 and 1 or total) * 100)
+    #    else:
+        for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
+            res[obj_rent.id] = "%.2f%%" % ((obj_rent.rent_amount_base * 12) /  (obj_rent.rent_total== 0.00 and 1 or obj_rent.rent_total) * 100)
+        return res
+        
+    def _rent_amount_years(self,cr,uid,ids,field_name,args,contexto):
+        res = {}
+        for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
+            years_val = {}
+            
+            percentaje = obj_rent.rent_rise
+            years_val['rent_rise_year2'] = obj_rent.rent_amount_base * (1 + float(percentaje) / 100)
+            years_val['rent_rise_year3'] = years_val['rent_rise_year2']  * (1 + float(percentaje) / 100)
+            
+            to_exchange = {
+                'obj_rent'      : obj_rent,
+                'vals'          : [('rent_rise_year2d',years_val['rent_rise_year2']),
+                ('rent_rise_year3d',years_val['rent_rise_year3']),
+                ('rent_amountd_base',obj_rent.rent_amount_base),
+                ],
+                'from_currency' : obj_rent.currency_id,
+                'to_currency'   : obj_rent.eqv_currency_id,
+            }
+            
+            exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
+            years_val['rent_rise_year2d'] = exchanged['rent_rise_year2d']
+            years_val['rent_rise_year3d'] = exchanged['rent_rise_year3d']
+            
+            #Just to avoid use a separate function
+            years_val['rent_amountd_base'] = exchanged['rent_amountd_base']
+            res[obj_rent.id] = years_val
+        return res
+        
+    def inv_line_create(self, cr, uid,obj_rent,args,type='rent'):
+        res_data = {}
+        obj_company = obj_rent.rent_rent_client_id.company_id or False
+        
+        if type=='rent':
+            res_data['account_id'] = obj_rent.rent_rent_account_id.id
+        elif type == 'main':
+            res_data['account_id'] = obj_rent.rent_rent_main_account_id.id
+        elif type== 'services':
+            res_data['account_id'] = obj_rent.rent_inv_water_account_id.id
+
+        #if obj_company.currency_id.id != obj_rent.currency_id.id:
+        #    new_price = res_data['price_unit'] * obj_rent.currency_id.rate
+        #    res_data['price_unit'] = new_price
+
+        return (0, False, {
+            'name': args['desc'],
+            'account_id': res_data['account_id'],
+            'price_unit': args['amount'] or 0.0,
+            'quantity': 1 ,
+            'product_id': False,
+            'uos_id': False,
+            'invoice_line_tax_id': [(6, 0, [])],
+            'account_analytic_id': False,
+            'invoice_rent_id': obj_rent.id or args.get('rent_id', False),
+        })
+    
+    def invoice_rent(self, cr, uid, ids, args,type='rent',current_date=date.today(),first_inv=False):
+        #Creates the invoice for every rent given as arg, the args is a list of dictionaries 
+        #usually it only has one element. But it can take up 2 records to create an invoice with 2 lines
+        res = {}
+        journal_obj = self.pool.get('account.journal')
+        il = []
+        #debug(first_inv)
+
+        for rlist in args:
+            obj_rent = self.browse(cr,uid,rlist['rent_id'])
+            il.append(self.inv_line_create(cr, uid,obj_rent,rlist,type))
+
+        obj_client = obj_rent.rent_rent_client_id
+        a = obj_rent.rent_inv_account_id.id or obj_rent.rent_rent_account_id.id or obj_client.property_account_receivable.id
+        #a = obj_client.property_account_receivable.id
+        journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=',obj_rent.company_id.id)],limit=1)
+
+        if not journal_ids:
+            raise osv.except_osv(_('Error !'),
+                _('There is no purchase journal defined for this company: "%s" (id:%d)') % (obj_rent.company_id.name, obj_rent.company_id.id))
+        
+        #Determines if today is the previous month for the invoice creation
+        today = current_date
+        #debug(today)
+        if type=='rent':
+            if not first_inv:
+                date_due = (obj_rent.rent_invoiced_day < obj_rent.rent_charge_day and date(today.year,today.month,1) or (today.replace(day=1) + timedelta(days=32)).replace(day=1))
+                date_due = date_due.replace(day=obj_rent.rent_charge_day + obj_rent.rent_grace_period)
+            else:
+                date_due = today +  timedelta(days=obj_rent.rent_grace_period)
+        elif type == 'main':
+            if not first_inv:
+                date_due = (obj_rent.rent_main_invoiced_day < obj_rent.rent_main_charge_day and date(today.year,today.month,1) or (today.replace(day=1) + timedelta(days=32)).replace(day=1))
+                date_due = date_due.replace(day=obj_rent.rent_main_charge_day + obj_rent.rent_main_grace_period)
+            else:
+                date_due = today +  timedelta(days=obj_rent.rent_main_grace_period)
+        
+        desc = "Cobro de %s. Mes %s " % ((type=='rent'and 'alquiler' or 'mantenimiento'),date_due.strftime("%B %Y"))
+        
+        if not first_inv:
+            main_grace = (type=='rent'and obj_rent.rent_grace_period or obj_rent.rent_main_grace_period)
+            invoice_day = (type=='rent'and obj_rent.rent_invoiced_day or obj_rent.rent_main_invoiced_day)
+            
+            inv_date = date_due - timedelta(days= main_grace + invoice_day)
+        else:
+            inv_date = today
+        
+        period_id = False
+        if not period_id:
+            period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=', date_due or time.strftime('%Y-%m-%d')),('date_stop','>=',date_due or time.strftime('%Y-%m-%d')), ('company_id', '=', obj_rent.company_id.id)])
+            if period_ids:
+                period_id = period_ids[0]
+        
+        company_id = (type == 'rent' and obj_rent.company_id.id or (obj_rent.rent_main_company_id and obj_rent.rent_main_company_id.id or False))
+        
+        inv = {
+            'name': desc or obj_rent.name,
+            'reference': obj_rent.name or desc,
+            'account_id': a,
+            'type': 'out_invoice',
+            'partner_id': obj_client.id,
+            'currency_id': (type == 'rent' and obj_rent.currency_id.id or obj_rent.main_currency_id.id),
+            'address_invoice_id': obj_client.address[0].id,
+            'address_contact_id': obj_client.address[0].id,
+            'journal_id': len(journal_ids) and journal_ids[0] or False,
+            'origin': obj_rent.name or desc,
+            'invoice_line': il,
+            'fiscal_position': obj_client.property_account_position.id,
+            'payment_term': obj_client.property_payment_term and o.partner_id.property_payment_term.id or False,
+            'company_id': company_id,
+            'date_invoice' : inv_date or today,
+            'date_due' : date_due,
+            'period_id' : period_id or False,
+        }
+        inv_id = self.pool.get('account.invoice').create(cr, uid, inv, {'type':'out_invoice'})
+        self.pool.get('account.invoice').button_compute(cr, uid, [inv_id], {'type':'out_invoice'}, set_total=True)
+        res['invoice_id'] = inv_id
+        res['rent_id'] = obj_rent.id
+        res['invoice_type'] = type
+        self.register_rent_invoice(cr,uid,ids,res)
+        if type == 'rent' and obj_rent.rent_include_water:
+            #debug("TIENE COBRO DE AGUA")
+            self.invoice_services(cr,uid,[obj_rent.id],inv)
+        
+        return res
+    
+    def first_rent(self,cr,uid,ids,type='rent',current_date=date.today()):
+        #for the given list of ids it creates a list of the invoice data and later calls 
+        #the invoice_rent to create every invoice
+        #debug('GENERACION DE PRIMER PAGO')
+        res = []
+        for obj_rent in ids:
+            today = current_date
+            charge_date = date(today.year,today.month,1)
+             
+            if type == 'rent':
+                init_date = parser.parse(obj_rent.rent_start_date).date()
+            elif type == 'main':
+                init_date = parser.parse(obj_rent.rent_main_start_date).date()
+            
+            init_date = init_date.replace(year=today.year)
+            
+            if (type == 'main' and obj_rent.rent_main_inc) or type == 'rent':
+                res.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': init_date, 'end_date' : charge_date.replace(day=calendar.mdays[charge_date.month])},type))
+            #debug(res)
+            self.invoice_rent(cr,uid,ids,res,type,first_inv=True)
+        return True
+    
+    def _invoice_main_required(self,cr,uid,ids,type='rent',current_date=date.today()):
+        #determines if the ids given require a invoice for the month
+        res = {}
+        for obj_rent in self.browse(cr,uid,ids):
+            is_required = False
+            today = current_date
+            if type == 'rent':
+                    invoice_day = (obj_rent.rent_invoiced_day < obj_rent.rent_charge_day) and (obj_rent.rent_charge_day - obj_rent.rent_invoiced_day) or (calendar.mdays[today.month] - obj_rent.rent_invoiced_day +  obj_rent.rent_charge_day)
+                    inv_rent_list = obj_rent.rent_invoice_ids
+            elif type == 'main':
+                    invoice_day = (obj_rent.rent_main_invoiced_day < obj_rent.rent_main_charge_day) and (obj_rent.rent_main_charge_day - obj_rent.rent_main_invoiced_day) or (calendar.mdays[today.month] - obj_rent.rent_main_invoiced_day + obj_rent.rent_main_charge_day)
+                    inv_rent_list = obj_rent.rent_main_invoice_ids
+            if today.day == invoice_day:
+                if (type == 'main' and obj_rent.rent_main_inc) or type == 'rent':
+                    is_required = True
+                    inv_rent_list = sorted(inv_rent_list,key=lambda reg: time.strptime(reg.invoice_due_date,'%Y-%m-%d'),reverse=True)
+                    i = 0
+                    for obj_inv_reg in inv_rent_list:
+                        i += 1                        
+                        inv_date = parser.parse(obj_inv_reg.invoice_due_date).date()
+                        inv_create = parser.parse(obj_inv_reg.invoice_date).date()
+                        #inv_date = parser.parse(obj_inv_reg.invoice_date).date()
+                        if type == 'rent':
+                            start_date = parser.parse(obj_rent.rent_start_date).date()
+                            charge_date = today+timedelta(days=obj_rent.rent_invoiced_day+obj_rent.rent_grace_period)
+                        elif type == 'main':
+                            start_date = parser.parse(obj_rent.rent_main_start_date).date()
+                            charge_date = today+timedelta(days=obj_rent.rent_main_invoiced_day+obj_rent.rent_main_grace_period)
+                        
+                        #debug(inv_date)
+                        #debug(charge_date)
+                        #debug(today)
+                        if inv_date.month == start_date.month and inv_date.year == start_date.year and len(inv_rent_list) <= 1:
+                            #debug("SOLO TIENE 1 FACTURA")
+                            is_required = True
+                        elif (inv_date.month == charge_date.month and inv_date.year == charge_date.year):
+                        #elif (inv_date.month == today.month and inv_date.year == today.year):
+                            is_required = False
+                            #debug("YA SE ENCONTRO UNA FACTURA QUE COINCIDE SE VA A SALIR")
+                            break
+                            #if (inv_date.month != charge_date.month and inv_date.year != charge_date.year):
+                            #if (inv_date.month != charge_date.month and inv_date.year != charge_date.year) and ():
+                            #    #debug("NECESITA FACTURA")
+                            #    is_required = True
+                        else:
+                            is_required = True
+                            #debug("No se ha encontrado una factura en los registros hasta el momento. %d" % (i))
+                                
+                        #elif (inv_date.month == today.month and inv_date.year == today.year):
+                    #debug("veces iteradas")
+                    #debug(i)
+                    #debug(is_required)
+            res[obj_rent.id] = is_required
+        return res
+    
+    def register_rent_invoice(self,cr,uid,ids,args):
+        obj_rent = self.browse(cr,uid,args['rent_id'])
+        obj_rent.write({'rent_invoice_ids' : [(0,0,{'invoice_id':args['invoice_id'],'invoice_rent_id':obj_rent.id,'invoice_type':args['invoice_type']})]})
+        return True
+    
+    def rent_calc(self,cr,uid,ids,type='rent',current_date=date.today()):
+        #calculates the rent considering the date of change for the anual rate.
+        #Verify if the rent needs to increase the price due to an anual rise
+        #If the rise is at some point of the month it separetes the invoice on 2 lines 
+        #the first one from the first day and the day before the rise, and the second one
+        #from the day of rise to the end of month
+        #debug('GENERACION DE Pago Normal')
+        res = {}
+        res_deposit_fix = []
+        for obj_rent in ids:
+            res_dob_inv = []
+            #debug(current_date)
+            today = current_date
+            
+            if type=='rent':
+                rise_date = parser.parse(obj_rent.rent_start_date).date()
+                charge_date = (obj_rent.rent_invoiced_day < obj_rent.rent_charge_day and date(today.year,today.month,1) or (today.replace(day=1) + timedelta(days=32)).replace(day=1))
+            elif type == 'main':
+                rise_date = parser.parse(obj_rent.rent_main_start_date).date()
+                charge_date = (obj_rent.rent_main_invoiced_day < obj_rent.rent_main_charge_day and date(today.year,today.month,1) or (today.replace(day=1) + timedelta(days=32)).replace(day=1))
+                
+            rise_date = rise_date.replace(year=today.year)
+            
+            if rise_date.month == charge_date.month:
+                if rise_date.day > 1:
+                    #It's necesary to check if the rise is on a day different than the first of every month
+                    res_dob_inv.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': charge_date, 'end_date' : rise_date - timedelta(days=1)},type))
+                    #res_dob_inv.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': charge_date, 'end_date' : rise_date.replace(day=rise_date.day-1)},type))
+                
+                #We need to update the amount_base of the rent, so we can
+                #charge the next part with the rate included
+                #NOTE: Even if the rise is on the second day of the month we apply the previous charge on the first day 
+                #and the new one on the remaining
+                if type=='rent':
+                    self.register_historic(cr,uid,obj_rent)
+                elif type=='main':
+                    self.register_main_historic(cr,uid,obj_rent)
+                obj_rent = self.browse(cr,uid,obj_rent.id)
+                res_dob_inv.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': rise_date, 'end_date' : charge_date.replace(day=calendar.mdays[charge_date.month])},type))
+                res_deposit_fix.append({'rent_id':obj_rent.id,'current_amount':obj_rent.rent_amount_base,'deposit':obj_rent.rent_deposit})
+            else:
+                res_dob_inv.append(self._invoice_data(cr,uid,ids,obj_rent,{'init_date': charge_date, 'end_date' : charge_date.replace(day=calendar.mdays[charge_date.month])},type))
+
+            self.invoice_rent(cr,uid,ids,res_dob_inv,type,today)
+            if res_deposit_fix:
+                self._check_deposit(cr,uid,res_deposit_fix,context=None)
+        return True
+    
+    def invoice_services(self,cr,uid,ids,inv,current_date=date.today()):
+        #It receive a dictionary containing all the data for the invoice of the rent, and updates the values
+        #required to create another invoice for the services
+        #debug('INVOICE FOR SERVICES')
+        il = []
+        rlist = {
+            'amount' : 0.0,
+            'desc'   : '',
+        }
+        desc = 'Pago de servicios de '
+        today = current_date
+        for obj_rent in self.browse(cr,uid,ids):
+            if obj_rent.rent_include_water:
+                charged_month = (obj_rent.rent_invoiced_day < obj_rent.rent_charge_day and today or (today.replace(day=1) - timedelta(days=2)))
+                
+                obj_local = obj_rent.rent_rent_local_id
+                
+                desc = desc + "agua, %s mes de %s" % ( obj_local and (obj_local.local_water_meter_number and "Paja " + obj_local.local_water_meter_number or ''),
+                charged_month.strftime("%B %Y"))
+                
+                rlist.update({
+                            'amount' : 0.0,
+                            'desc'   : desc,
+                })
+                il.append(self.inv_line_create(cr, uid,obj_rent,rlist,type='services'))
+        desc = "Cobro de %s. Mes %s " % ('servicios',charged_month.strftime("%B %Y"))
+
+        currency = self._get_currency(cr,uid)
+        a = obj_rent.rent_inv_water_account_id.id or obj_rent.rent_inv_account_id.id
+        
+        inv.update({
+            'name': desc or obj_rent.name,
+        #    'account_id': a,
+            'currency_id': currency,
+            'invoice_line': il,
+        })
+        inv_id = self.pool.get('account.invoice').create(cr, uid, inv, {'type':'out_invoice'})
+        self.pool.get('account.invoice').button_compute(cr, uid, [inv_id], {'type':'out_invoice'}, set_total=True)
+        return True
+        
+    def _invoice_data(self,cr,uid,ids,obj_rent,date_range,type='rent'):
+        #creates a dictionary with all the needed data of the rent or maintenance
+        init_date = date_range['init_date']
+        end_date = date_range['end_date']
+        month_days = calendar.mdays[init_date.month]
+        charged_days = month_days
+        if (end_date.day == month_days and init_date.day != 1) or (end_date.day != month_days and init_date.day == 1):
+            charged_days = (end_date.day - init_date.day) + 1
+        if type == 'rent':
+            amount_base = obj_rent.rent_amount_base
+        elif type == 'main':
+            amount_base = obj_rent.rent_main_amount_base
+        
+        amount =  charged_days / float(month_days) * amount_base
+        if init_date != end_date:
+            desc = "Cobro de %s. Desde el %s hasta el %s" % ((type=='rent'and 'alquiler' or 'mantenimiento'),init_date.strftime("%A %d %B %Y"),end_date.strftime("%A %d %B %Y"))
+        else:
+            desc = "Cobro de %s. Del %s " % ((type=='rent'and 'alquiler' or 'mantenimiento'),init_date.strftime("%A %d %B %Y"))
+        
+        res = {
+            'rent_id': obj_rent.id,
+            'amount' : amount,
+            'date'   : end_date,
+            'desc'   : desc,
+        }
+        #debug(res)
+        return res
+        
+    def day_invoice_check(self,cr,uid):
+        #MAIN CRONJOB TO BE RUNNED EVERY DAY AN CREATE INVOICES
+        self.cron_rent_invoice(cr,uid,[])
+        return True
+        
+    def cron_rent_invoice(self,cr,uid,ids,context=None):
+        #gets the list of all active rents
+        rent_ids = self.search(cr,uid,[('state','=','active'),('rent_type','=','Contract')])
+        date_list = []
+        #debug('CRONJOB FORCED TEST')
+        #we retrieve the date of today and the last date registered at the log 
+        #this allows to create the list with dates between those two
+        today =date.today()
+        #debug(today)
+        log_id = self.pool.get('rent.invoice.log').search(cr,uid,[],order='log_date desc')
+        if log_id:
+            last_log = self.pool.get('rent.invoice.log').browse(cr,uid,log_id[0])
+            last_date = parser.parse(last_log.log_date).date() + timedelta(days=1)
+        else:
+            #if theres no record we set the today as the last_date assuming that 
+            #the cronjob has never been excecuted and add it to the list
+            last_date = today
+        #debug(last_date)
+        while last_date <= today:
+            date_list.append(last_date)
+            last_date += timedelta(days=1)
+        #once we have all that dates we run the method for each one 
+        #NOTE: date_list contains at least the today date
+        #debug(date_list)
+        for record_date in date_list:
+            is_required = self._invoice_main_required(cr,uid,rent_ids,'rent',record_date)
+            self._method_invoice_caller(cr,uid,rent_ids,is_required,'rent',record_date)
+        
+            #after we invocied all the rents, now we can proceed with the maintenance 
+            #debug("CALCULATING INVOICE FOR MAINTENANCE")
+            is_required = self._invoice_main_required(cr,uid,rent_ids,'main',record_date)
+            self._method_invoice_caller(cr,uid,rent_ids,is_required,'main',record_date)
+        if date_list:
+            log_desc = "CronJob ran for dates between %s to %s" % (date_list[0].strftime("%A %d %B %Y"),(len(date_list) > 1 and date_list[-1] or date_list[0]).strftime("%A %d %B %Y"))
+            self.pool.get('rent.invoice.log').create(cr,uid,{'log_date':today,'log_desc' : log_desc })
+        return True
+    
+    def _method_invoice_caller (self,cr,uid,rent_ids,is_required,type='rent',current_date=date.today()):
+        res_norm_inv = []
+        for obj_rent in self.browse(cr,uid,rent_ids):
+            if is_required[obj_rent.id]: 
+                #res_norm_inv.append(obj_rent.id)
+                res_norm_inv.append(obj_rent)
+        self.rent_calc(cr,uid,res_norm_inv,type,current_date)
+        return True
+    
+    def cron_rent_defaulter_interest(self,cr,uid):
+        #under develop
+        rent_ids = self.search(cr,uid,[('state','=','active')])
+        res = []
+        for obj_rent in self.browse(cr,uid,rent_ids):
+            today = date.today()
+            invoices_ids = self.pool.get('rent.rent.invoice').search(cr,uid,[('invoice_date','=',today.strftime('%Y-%m-%d'))])
+            for obj_invoice_rent in self.pool.get('rent.invoice.rent').browse(cr,uid,invoices_ids):
+                #date_due = parser.parse(obj_invoice_rent.date_due).date()
+                today = date.today()
+                limit_day = parser.parse(obj_invoice_rent.date_due).date().day + (obj_rent.rent_grace_period or 0)
+                if  (today.day > 8 and today.day > limit_dayand) and obj_invoice_rent.residual != 0:
+                    res.append(obj_invoice_rent)
+        return True
+        
+    def cron_rent_date_due_check(self,cr,uid):
+        #TODO: SEND NOTIFICATION TO ADMIN
+        active_rent_ids = self.search(cr,uid,[('state','=','active'),('active','=','true')])
+        current_date = date.today()
+        required_action = []
+        for obj_ren in self.browse(cr,uid,active_rent_ids):
+            custom_month = current_date + timedelta(weeks=24)
+            if obj_ren.rent_end_date == custom_month:
+                required_action.append(obj_ren.id)
+        self._send_notification(cr,uid,required_action,context=None)
+        self._create_negotiation_contract(cr,uid,required_action,context=None)
+        return True
+        
+    def _send_notification(self,cr,uid,ids,context=None):
+        #Method that notifies the user about the problems to solve
+        return True
+        
+    def _create_negotiation_contract(self,cr,uid,ids,context=None):
+        copied = []
+        for rent_id in ids:
+            copied.append(self.copy(cr,uid,rent_id))
+        return True
+    
+    def test_negotiation(self,cr,uid,ids,context=None):
+        test_ids = self.search(cr,uid,[('state','=','draft')])
+        res_deposit_fix = []
+        #debug("ENTRAAAAAAAAAA")
+        for obj_rent in self.browse(cr,uid,test_ids):
+            res_deposit_fix.append({'rent_id':obj_rent.id,'current_amount':obj_rent.rent_amount_base,'deposit':obj_rent.rent_deposit})
+        #debug(res_deposit_fix)
+        self._check_deposit(cr,uid,res_deposit_fix,context=context)
+        return True
+    
+    def _check_deposit(self,cr,uid,args,context=None):
+        #
+        required_act = []
+        for record in args:
+            current = float(record['current_amount'])
+            depo = float(record['deposit'])
+            if current > depo:
+                required_act.append(record['rent_id'])
+        #TODO:ESCRIBIR METODO PARA QUE ALERTE
+        return True
+        
+    def action_aprove_adendum(self,cr,uid,ids,context=None):
+        rent_ids = self.search(cr,uid,[('state','=','active'), ('rent_type','in',['Adendum','Others']),('rent_modif_date','=',False)])
+        #debug(rent_ids)
+        #debug(ids)
+        for rent_aden_id in rent_ids:
+            vals = self.copy_data(cr,uid,rent_aden_id)
+            if vals:
+                if vals.get('rent_type') in ['Adendum','Others']:
+                    rent_id = vals.get('rent_modif_ref')
+                    org_rent = self.copy_data(cr,uid,rent_id)
+                    org_rent.update({
+                        'rent_type'          : vals.get('rent_type'),
+                        'rent_modif_ref'     : rent_id,
+                        'rent_estimates_ids' : [],
+                        'rent_modif'         : [],
+                        'rent_historic_ids'  : [],
+                        'rent_invoice_ids'   : [],
+                        'state'              : 'active',
+                        'rent_modif_date'    : date.today(),
+                    })
+                    vals.update({
+                        'rent_modif_ref'     : False,
+                        'rent_type'          : 'Contract',
+                        'state'              : 'active',
+                        'rent_estimates_ids' : False,
+                    })
+                    self.write(cr,uid,[rent_id],vals)
+                    self.write(cr,uid,[rent_aden_id],org_rent)
+        return True
+        
+    def action_first_invoice(self,cr,uid,ids,context=None):
+        #gets the list of all active rents
+        #debug(ids)
+        #rent_ids = self.search(cr,uid,[('state','=','active'), ('rent_type','in',['Contract'])])
+        #is_required = self._invoice_required(cr,uid,rent_ids)
+        res_first_inv = []
+        res_first_main_inv = []
+        for obj_rent in self.browse(cr,uid,ids):
+            #if is_required[obj_rent.id]: 
+            if obj_rent.rent_type == 'Contract':
+                has_first = self.pool.get('rent.invoice.rent').search(cr,uid,[('invoice_rent_id','=',obj_rent.id),('invoice_type','=','rent')])
+                if not has_first and parser.parse(obj_rent.rent_start_date).date().month == date.today().month:
+                    #res_first_inv.append(obj_rent.id)
+                    if obj_rent.rent_type != "Adendum":
+                        #we only create invoice for the contracts NOT for the adendums
+                        res_first_inv.append(obj_rent)
+                    percentaje = obj_rent.rent_performance.split('%')[0]
+                    #we update the estimates list for the obj
+                    obj_rent.write({'rent_estimates_ids' : [(0,0,{'estimate_performance': float(percentaje),'estimate_rent_id':obj_rent.id,'estimate_date' : date.today(), 'estimate_state':'final'})]})
+                    
+                #We check for maintenance invoice for this we need to heck if the rent hasta a maintenance record
+                if obj_rent.rent_main_inc:
+                    has_main_first = self.pool.get('rent.invoice.rent').search(cr,uid,[('invoice_rent_id','=',obj_rent.id),('invoice_type','=','main')])
+                    if not has_main_first and parser.parse(obj_rent.rent_main_start_date).date().month == date.today().month:
+                        if obj_rent.rent_type != "Adendum":
+                            #we only create invoice for the contracts NOT for the adendums
+                            res_first_main_inv.append(obj_rent)
+                        percentaje = obj_rent.rent_main_performance.split('%')[0]
+                        obj_rent.write({'rent_main_estimates_ids' : [(0,0,{'estimate_performance': float(percentaje),'estimate_rent_id':obj_rent.id,'estimate_date' : date.today(), 'estimate_state':'final'})]})
+        
+        if res_first_inv:
+            self.first_rent(cr,uid,res_first_inv)
+        if res_first_main_inv:
+            self.first_rent(cr,uid,res_first_main_inv,'main')
+        return {}
+    
+    def calculate_negotiation(self,cr,uid,ids,context=None):
+        res = {}
+        return { 'value' : res}
+    
+    def onchange_calculate_exchange(self,cr,uid,ids,field):
+        res = {}
+        ##debug('ONCHANGE')
+        ##debug(ids)
+        #for obj_rent in self.browse(cr,uid,ids):
+        #if field:
+        #    res_total = self._get_total_rent(cr,uid,ids,{'rent_total','rent_total_us'},None,None)
+        #    res['rent_total'] = res_total[0]['rent_total']
+        #    res['rent_total_us'] = res_total[0]['rent_total_us']
+        #    
+        #    res['rent_performance'] = self._rent_performance(cr,uid,ids,'rent_performance',{'onchange_amount':field,'onchange_total' : res['rent_total']},None)[0]
+        #    
+        #    
+        #    res_years = self._rent_amount_years(cr,uid,ids,{'rent_rise_year2','rent_rise_year3','rent_amount_base','rent_rise_year2d','rent_rise_year3d','rent_amountd_base'},None)
+        #    res_sqr = self._value_per_sqr(cr,uid,ids,{'rent_performance','rent_amountd_per_sqr'},None,None)
+        #    res['rent_rise_year2'] = res_years[0]['rent_rise_year2']
+        #    res['rent_rise_year3'] = res_years[0]['rent_rise_year3']
+        #    res['rent_amount_base'] = res_years[0]['rent_amount_base']
+        #    res['rent_rise_year2d'] = res_years[0]['rent_rise_year2d']
+        #    res['rent_rise_year3d'] = res_years[0]['rent_rise_year3d']
+        #    res['rent_amountd_base'] = res_years[0]['rent_amountd_base']
+        #    
+        #    res['rent_performance'] = res_sqr[0]['rent_performance']
+        #    res['rent_amountd_per_sqr'] = res_sqr[0]['rent_amountd_per_sqr']
+        #    
+        #    
+        #for obj_rent in self.browse(cr,uid,ids):
+        #    current_currency = obj_rent.currency_id
+        #    obj_client = obj_rent.rent_rent_client_id
+        #    company_currency = (obj_client.company_id and obj_client.company_id.currency_id.id or self._get_currency(cr,uid,context))
+        #    if company_currency  == current_currency.id:
+        #        if current_currency.name != "USD":
+        #            res['eqv_currency_id'] = pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('name','=','USD')])[0]
+        #        else:
+        #            res['eqv_currency_id'] = company_currency
+        #    if company_currency  != current_currency.id:
+        #        res['eqv_currency_id'] = company_currency
+        #    
+        #    obj_rent.write({'currency_id': current_currency.id, 'eqv_currency_id': res['eqv_currency_id']})
+        return { 'value' : res}
+    
+    def _calculate_exchange(self,cr,uid,ids,args,context=None):
+        val = {}
+        if args:
+            #we search for all the variables so we can exchange currencies
+            obj_rent = args['obj_rent']
+            obj_client = obj_rent.rent_rent_client_id
+            orig_currency  = args['from_currency']
+            dest_currency  = args['to_currency']
+            #Main currency required, for now we asume its the USD
+            main_currency = pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('name','=','USD')])[0]
+            for record in args['vals']:
+                value = record[1]
+                if (orig_currency.id != dest_currency.id):
+                    value = value / orig_currency.rate
+                    if dest_currency.id != main_currency:
+                        value = value * dest_currency.rate
+                val[record[0]] = value
+        return val
+        
+    def _rent_main_performance(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
+            total = 1
+            res[obj_rent.id] = "%.2f%%" % ((obj_rent.rent_main_amount_base * 12) /  (obj_rent.rent_main_total== 0.00 and 1 or obj_rent.rent_main_total) * 100) 
+        return res
+        
+    def _rent_main_amount_years(self,cr,uid,ids,field_name,args,contexto):
+        res = {}
+        for obj_rent in self.pool.get('rent.rent').browse(cr,uid,ids):
+            years_val = {}
+
+            percentaje = obj_rent.rent_main_rise
+            years_val['rent_main_rise_year2'] = obj_rent.rent_main_amount_base * (1 + float(percentaje) / 100)
+            years_val['rent_main_rise_year3'] = years_val['rent_main_rise_year2']  * (1 + float(percentaje) / 100)
+            
+            to_exchange = {
+                'obj_rent'      : obj_rent,
+                'vals'          : [('rent_main_rise_year2d',years_val['rent_main_rise_year2']),
+                ('rent_main_rise_year3d',years_val['rent_main_rise_year3']),
+                ('rent_main_amountd_base',obj_rent.rent_main_amount_base),
+                ],
+                'from_currency' : obj_rent.main_currency_id or obj_rent.currency_id,
+                'to_currency'   : obj_rent.main_eqv_currency_id or obj_rent.eqv_currency_id,
+            }
+            
+            exchanged = self._calculate_exchange(cr,uid,ids,to_exchange)
+            years_val['rent_main_rise_year2d'] = exchanged['rent_main_rise_year2d']
+            years_val['rent_main_rise_year3d'] = exchanged['rent_main_rise_year3d']
+            
+            #Just to avoid use a separate function
+            years_val['rent_main_amountd_base'] = exchanged['rent_main_amountd_base']
+            
+            res[obj_rent.id] = years_val
+        return res
+    
+    #def _rent_rise_years(self,cr,uid,ids,field_name,args,context=None):
+    def onchange_rise_years(self,cr,uid,ids,field,base,rise):
+        res = {}
+        lines = []
+        #for obj_rent in self.browse(cr,uid,ids):
+        percentaje = rise
+        amount_base = base
+        years = field or 4
+        for x in range(1,years):
+            #debug(x)
+            amount_base    = amount_base * (1 + float(percentaje) / 100)
+            lines.append({'year' : x+1, 'amount' : amount_base})
+        #debug(lines)
+        res['rent_rise_chart_ids'] = lines
+        #debug(res)
+        return {'value' : res}
+    
+    _columns = {
+        'name'                  : fields.char('Name',size=64,required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'ref'                  : fields.char('Reference',size=64,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_rent_client_id'   : fields.many2one('res.partner','Client', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_end_date'         : fields.date('Ending Date', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_ending_motif'     : fields.selection([('early','Early Return'),('expiration','Contract Expiration'),('eviction','No payment eviction'), ('others','Various problems with tenant')],'Ending Motif'),
+        'rent_ending_motif_desc': fields.text('Ending Motif Description'),
+        
+        'rent_rise'             : fields.float('Anual Rise', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        #'rent_rise'             : fields.char('Anual Rise',size=64, required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_amount_base'      : fields.float('Final Price $', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_performance'      : fields.function(_rent_performance, type='char',method = True,string='Performance'),
+        'rent_rise_year2'       : fields.function(_rent_amount_years, type='float',method = True,string='Year 2 $', multi='Years'),
+        'rent_rise_year3'       : fields.function(_rent_amount_years, type='float',method = True,string='Year 3 $', multi='Years'),
+        'rent_amount_per_sqr'   : fields.function(_value_per_sqr, type='float',method = True,string='Amount per Sqr', multi='negot'),
+        
+        'rent_amountd_per_sqr'  : fields.function(_value_per_sqr, type='float',method = True,string='Amount m2 $', multi='negot'),
+        'rent_amountd_base'     : fields.function(_rent_amount_years, type='float',method = True,string='Final Price $', multi='Years'),
+        'rent_rise_year2d'      : fields.function(_rent_amount_years, type='float',method = True,string='Year 2  $', multi='Years'),
+        'rent_rise_year3d'      : fields.function(_rent_amount_years, type='float',method = True,string='Year 3  $', multi='Years'),
+        'rent_show_us_eq'       : fields.boolean('Check USD Currency Equivalent',store=False),
+        'rent_total_us'         : fields.function(_get_total_rent,type='float',method=True,string='Total Paid',multi='total'),
+        
+        'rent_type'             : fields.selection([('Contract','Contract'),('Adendum','Adendum'),('Others','Others')],'Type',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'state'                 : fields.selection([('active','Active'),('finished','Inactive'),('draft','Draft')],'Status', readonly=True),
+        'rent_start_date'       : fields.date('Starting Date', required=True, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_total'            : fields.function(_get_total_rent,type='float',method=True,string='Total Paid',multi='total'),
+        'rent_rent_local_id'    : fields.many2one('rent.floor.local','Local', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_rent_parking_id'  : fields.many2one('rent.floor.parking','Parking', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_rent_estate_id'   : fields.many2one('rent.estate','Estate', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_related_real'     : fields.selection([('local','Locals'),('parking','Parking'),('estate','Estates')],'Type of Real Estate', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_years'            : fields.function(_calculate_years,type='integer',method=True,string = 'Years' ,help='Check if you want to calculate a rent for locals'),
+        'rent_modif'            : fields.one2many('rent.rent', 'rent_modif_ref','Contract reference', states={'draft':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_modif_ref'        : fields.many2one('rent.rent', 'Modifications',ondelete='cascade'),
+        'currency_id'           : fields.many2one('res.currency', 'Currency', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'eqv_currency_id'       : fields.many2one('res.currency', 'Currency Equivalence', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_estimates_ids'    : fields.one2many('rent.rent.estimate', 'estimate_rent_id','Estimates',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),         
+        'rent_historic_ids'     : fields.one2many('rent.rent.anual.value', 'anual_value_rent_id','Historic',readonly=True, domain=[('anual_value_type', '=', 'rent')]),
+        'rent_charge_day'       : fields.integer('Charge Day', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indica el dia del mes para realizar los cobros del alquiler.'),
+        'rent_invoice_ids'      : fields.one2many('rent.invoice.rent','invoice_rent_id','Rent Invoices', domain=[('invoice_type', '=', 'rent')],readonly=True),
+        'rent_invoiced_day'     : fields.integer('Invoiced Day', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indicates de how many days before of the charge day will create the invoice'),
+        'rent_grace_period'     : fields.integer('Grace Period', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indicates de how many days after the charge day will allow to paid an invoice without Interest for delay'),
+        
+        'rent_group_id'         : fields.many2one('rent.rent.group','Contract Group',ondelete='cascade', readonly=True),
+        'rent_modif_date'       : fields.date('Modification Date',readonly=True),
+        
+        'rent_inv_account_id'   : fields.many2one('account.account','Invoice Account',help="This account will be used for invoices instead of the default one to value sales for the current rent",required=True,states={'finished':[('readonly',True)]}),
+        'rent_rent_account_id'  : fields.many2one('account.account','Income Account',help="This account will be used for invoices instead of the default one to value sales for the current rent",required=True,states={'finished':[('readonly',True)]}),
+        'rent_rent_acc_int_id'  : fields.many2one('account.account','Interest Account',help="This account will be used for invoices instead of the default one to value expenses for the current rent",required=True,states={'finished':[('readonly',True)]}),
+        #'rent_rent_account_id'  : fields.property(
+        #    'account.account',
+        #    type='many2one',
+        #    relation='account.account',
+        #    string="Income Account",
+        #    method=True,
+        #    view_load=True,
+        #    help="This account will be used for invoices instead of the default one to value sales for the current rent",required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        #'rent_rent_acc_int_id'  : fields.property(
+        #    'account.account',
+        #    type='many2one',
+        #    relation='account.account',
+        #    string="Interest Account",
+        #    method=True,
+        #    view_load=True,
+        #    help="This account will be used for invoices instead of the default one to value expenses for the current rent",required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_rent_real_area'   : fields.function(_get_total_area,type='float',method=True,string='Area'),
+        
+        'rent_main_inc'              : fields.boolean('Include Maintenance Rent',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        
+        #'rent_main_rise'             : fields.char('Anual Rise',size=64, states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_main_rise'             : fields.float('Anual Rise', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_main_amount_base'      : fields.float('Final Price $', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_main_performance'      : fields.function(_rent_main_performance, type='char',method = True,string='Performance'),
+        'rent_main_amountd_base'     : fields.function(_rent_main_amount_years, type='float',method = True,string='Final Price $', multi='Years_main'),
+        'rent_main_rise_year2'       : fields.function(_rent_main_amount_years, type='float',method = True,string='Year 2  $', multi='Years_main'),
+        'rent_main_rise_year3'       : fields.function(_rent_main_amount_years, type='float',method = True,string='Year 3  $', multi='Years_main'),
+        'rent_main_rise_year2d'      : fields.function(_rent_main_amount_years, type='float',method = True,string='Year 2  $', multi='Years_main'),
+        'rent_main_rise_year3d'      : fields.function(_rent_main_amount_years, type='float',method = True,string='Year 3  $', multi='Years_main'),
+        'rent_main_show_us_eq'       : fields.boolean('Check USD Currency Equivalent',store=False),
+        'rent_main_estimates_ids'    : fields.one2many('rent.rent.main.estimate', 'estimate_maintenance_id','Estimates',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_main_invoice_ids'      : fields.one2many('rent.invoice.rent','invoice_rent_id','Rent Invoices', domain=[('invoice_type', '=', 'main')],readonly=True),
+        'rent_main_total'            : fields.float('Total Paid'),
+        
+        'main_currency_id'           : fields.many2one('res.currency', 'Currency', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'main_eqv_currency_id'       : fields.many2one('res.currency', 'Currency Equivalence', required=True,states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        
+        #'rent_main_total_us'         : fields.float('Total Paid $'),
+        'rent_main_historic_ids'     : fields.one2many('rent.rent.anual.value', 'anual_value_rent_id','Historic',readonly=True, domain=[('anual_value_type', '=', 'main')]),      
+        'rent_main_company_id'       : fields.many2one('res.company', 'Supplier Company',states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),      
+        
+        'rent_main_charge_day'       : fields.integer('Charge Day',states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indica el dia del mes para realizar los cobros del alquiler.'),
+        'rent_main_invoiced_day'     : fields.integer('Invoiced Day',states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indicates de how many days before of the charge day will create the invoice'),
+        'rent_main_grace_period'     : fields.integer('Grace Period',states={'active':[('readonly',True)], 'finished':[('readonly',True)]},help='Indicates de how many days after the charge day will allow to paid an invoice without Interest for delay'),   
+        
+        'rent_rent_main_account_id'  : fields.many2one('account.account','Income Account',help="This account will be used for invoices instead of the default one to value sales for the current rent",states={'finished':[('readonly',True)]}),
+        'rent_rent_main_acc_int_id'  : fields.many2one('account.account','Interest Account',help="This account will be used for invoices instead of the default one to value expenses for the current rent",states={'finished':[('readonly',True)]}),
+        'rent_inv_main_account_id'   : fields.many2one('account.account','Invoice Account',help="This account will be used for invoices instead of the default one to value expenses for the current rent",states={'finished':[('readonly',True)]}),
+        
+        'rent_main_end_date'         : fields.date('Ending Date', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        'rent_main_start_date'       : fields.date('Starting Date', states={'active':[('readonly',True)], 'finished':[('readonly',True)]}),
+        
+        'rent_notes'                 : fields.text('Notes',help='Add complementary information about the rent or maintenance'),
+        'main_notes'                 : fields.text('Notes',help='Add complementary information about the rent or maintenance'),
+        
+        'rent_include_water'         : fields.boolean('Include water payment',readonly=True, states={'draft':[('readonly',False)]},help="Check if you want to generate an invoice for the water payment"),
+        'rent_inv_water_account_id'  : fields.many2one('account.account','Water payment Account',help="This account will be used for invoices of water instead of the default one to value expenses for the current rent",states={'finished':[('readonly',True)]}),
+        
+        'company_id'                 : fields.many2one('res.company', 'Company',readonly=True),
+        'rent_deposit'               : fields.float('Deposit', required=True, states={'finished':[('readonly',True)]}),
+        
+        'active'                     : fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the resource record without removing it."),
+        #'rent_rise_chart_ids'        : fields.one2many('rent.rise.estimate','rent_id', 'Rise Chart'),
+        #'rent_rise_chart_years'      : fields.integer('Rise years',help='Indicate the number of years you want to see at the chart of rise estimates'),
+        
+        #'rent_rise_chart2_ids'       : fields.function(_rent_rise_years, type='one2many', obj= 'rent.rise.estimate', method = True,string='Rise for Years'),
+    }
+    
+    _defaults = {
+        'state'        : 'draft',
+        'rent_type'    : 'Contract',
+        'currency_id': _get_currency,
+        'eqv_currency_id': _get_currency_eqv,
+        'main_currency_id': _get_currency,
+        'main_eqv_currency_id': _get_currency_eqv,
+        'rent_amount_base' : 0.00,
+        'rent_main_amount_base' : 0.00,
+        #'rent_rise'     : "%.2f%%" % (0.),
+        #'rent_main_rise': "%.2f%%" % (0.),
+        'rent_charge_day' : 01,
+        'rent_main_charge_day' : 01,
+        'rent_main_performance' : "%.2f%%" % (0.),
+        'rent_modif_date' : date.today(),
+        'active': 1,
+    }
 
 class rent_rise_estimate(osv.osv):
-	#IDEA PARA CALCULO DE AUMENTOS
-	_name = 'rent.rise.estimate'
-	_columns = {
-			'year'         : fields.integer('Year',help='Number of the year as a sequence'),
-			'amount'       : fields.float('Amount (local)'),
-			'currency_id'  : fields.related('rent_id', 'currency_id',type='many2one', relation='rent.rent', string='Currency', readonly=True,store=False),
-			
-			'amount_foreing'       : fields.float('Amount (Foreing)'),
-			'currency_foreing_id'  : fields.related('rent_id', 'eqv_currency_id',type='many2one', relation='rent.rent', string='Currency(out)', readonly=True,store=False),
-			'rent_id'              : fields.many2one('rent.rent','Rent_id'),
-	}
-rent_rise_estimate()
+    #IDEA PARA CALCULO DE AUMENTOS
+    _name = 'rent.rise.estimate'
+    _columns = {
+            'year'         : fields.integer('Year',help='Number of the year as a sequence'),
+            'amount'       : fields.float('Amount (local)'),
+            'currency_id'  : fields.related('rent_id', 'currency_id',type='many2one', relation='rent.rent', string='Currency', readonly=True,store=False),
+            
+            'amount_foreing'       : fields.float('Amount (Foreing)'),
+            'currency_foreing_id'  : fields.related('rent_id', 'eqv_currency_id',type='many2one', relation='rent.rent', string='Currency(out)', readonly=True,store=False),
+            'rent_id'              : fields.many2one('rent.rent','Rent_id'),
+    }
 
 class rent_rent_estimate(osv.osv):
-	_name = 'rent.rent.estimate'
-		
-	def _performance_years(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for obj_estimate in self.pool.get('rent.rent.estimate').browse(cr,uid,ids):
-			if obj_estimate.estimate_performance:
-				res[obj_estimate.id] = 1 / (obj_estimate.estimate_performance / 100.00)
-		return res
-	def _performance_amount(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		amount = 0
-		for obj_estimate in self.pool.get('rent.rent.estimate').browse(cr,uid,ids):
-			obj_rent = obj_estimate.estimate_rent_id
-			amounts_val = {}
-			
-			currency_id = obj_rent.currency_id
-			rate_cr = currency_id.rate
-			rate_us = 1
-			amounts_val['estimate_amountc'] = (obj_estimate.estimate_rent_id.rent_total * (obj_estimate.estimate_performance/100.00)  / 12) / rate_us
-			amounts_val['estimate_amountd'] = (obj_estimate.estimate_rent_id.rent_total * (obj_estimate.estimate_performance/100.00)  / 12) / rate_cr
-			res[obj_estimate.id] = amounts_val
-		return res
-	def _performance_currency(self,cr,uid,ids,field_name,args,contexto):
-		res = {}
-		for obj_estimate in self.pool.get('rent.rent.estimate').browse(cr,uid,ids):
-			obj_rent = obj_estimate.estimate_rent_id
-			
-			currencies_val = {}
-			valor = obj_rent._get_total_area(obj_rent.id,None,None)[obj_rent.id]
-			currencies_val['estimate_colones'] = obj_estimate.estimate_amountc / valor
-			currencies_val['estimate_dollars'] = obj_estimate.estimate_amountd / valor
-			res[obj_estimate.id] = currencies_val
-		return res
-	_columns = {
-		'estimate_performance'       : fields.float('Performance(%)',digits=(12,2), help='This a percentaje number'),
-		'estimate_years'             : fields.function(_performance_years, type='float',method = True,string='Years for reinv.'),
-		'estimate_amountc'           : fields.function(_performance_amount, type='float',method = True,string='Amount', multi=True),
-		'estimate_colones'           : fields.function(_performance_currency, type='float',method = True,string='c / m2',multi='Currency'),
-		'estimate_amountd'           : fields.function(_performance_amount, type='float',method = True,string='Amount $', multi=True),
-		'estimate_dollars'           : fields.function(_performance_currency, type='float',method = True,string='s / m2',multi='Currency'),
-		'estimate_rent_id'            : fields.many2one('rent.rent','Rent'),
-		'estimate_date'              : fields.date('Fecha'),
-		'estimate_state'             : fields.selection([('final','Used'),('recommend','Recommend'),('min','Min'),('norec','Not Recomended')],'Status',readonly=False),
-	}
-	_order = "estimate_date desc"
-	_defaults = {
-		'estimate_date'  : date.today().strftime('%d/%m/%Y'),
-	}
-rent_rent_estimate()
+    _name = 'rent.rent.estimate'
+        
+    def _performance_years(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for obj_estimate in self.pool.get('rent.rent.estimate').browse(cr,uid,ids):
+            if obj_estimate.estimate_performance:
+                res[obj_estimate.id] = 1 / (obj_estimate.estimate_performance / 100.00)
+        return res
+    def _performance_amount(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        amount = 0
+        for obj_estimate in self.pool.get('rent.rent.estimate').browse(cr,uid,ids):
+            obj_rent = obj_estimate.estimate_rent_id
+            amounts_val = {}
+            
+            currency_id = obj_rent.currency_id
+            rate_cr = currency_id.rate
+            rate_us = 1
+            amounts_val['estimate_amountc'] = (obj_estimate.estimate_rent_id.rent_total * (obj_estimate.estimate_performance/100.00)  / 12) / rate_us
+            amounts_val['estimate_amountd'] = (obj_estimate.estimate_rent_id.rent_total * (obj_estimate.estimate_performance/100.00)  / 12) / rate_cr
+            res[obj_estimate.id] = amounts_val
+        return res
+    def _performance_currency(self,cr,uid,ids,field_name,args,contexto):
+        res = {}
+        for obj_estimate in self.pool.get('rent.rent.estimate').browse(cr,uid,ids):
+            obj_rent = obj_estimate.estimate_rent_id
+            
+            currencies_val = {}
+            valor = obj_rent._get_total_area(obj_rent.id,None,None)[obj_rent.id]
+            currencies_val['estimate_colones'] = obj_estimate.estimate_amountc / valor
+            currencies_val['estimate_dollars'] = obj_estimate.estimate_amountd / valor
+            res[obj_estimate.id] = currencies_val
+        return res
+    _columns = {
+        'estimate_performance'       : fields.float('Performance(%)',digits=(12,2), help='This a percentaje number'),
+        'estimate_years'             : fields.function(_performance_years, type='float',method = True,string='Years for reinv.'),
+        'estimate_amountc'           : fields.function(_performance_amount, type='float',method = True,string='Amount', multi=True),
+        'estimate_colones'           : fields.function(_performance_currency, type='float',method = True,string='c / m2',multi='Currency'),
+        'estimate_amountd'           : fields.function(_performance_amount, type='float',method = True,string='Amount $', multi=True),
+        'estimate_dollars'           : fields.function(_performance_currency, type='float',method = True,string='s / m2',multi='Currency'),
+        'estimate_rent_id'            : fields.many2one('rent.rent','Rent'),
+        'estimate_date'              : fields.date('Fecha'),
+        'estimate_state'             : fields.selection([('final','Used'),('recommend','Recommend'),('min','Min'),('norec','Not Recomended')],'Status',readonly=False),
+    }
+    _order = "estimate_date desc"
+    _defaults = {
+        'estimate_date'  : date.today().strftime('%d/%m/%Y'),
+    }
 
 class rent_rent_main_estimate(osv.osv):
-	_name = 'rent.rent.main.estimate'
-		
-	def _performance_years(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		for obj_estimate in self.pool.get('rent.rent.main.estimate').browse(cr,uid,ids):
-			if obj_estimate.estimate_performance:
-				res[obj_estimate.id] = 1 / (obj_estimate.estimate_performance / 100.00)
-		return res
-	def _performance_amount(self,cr,uid,ids,field_name,args,context):
-		res = {}
-		amount = 0
-		for obj_estimate in self.pool.get('rent.rent.main.estimate').browse(cr,uid,ids):
-			obj_rent = obj_estimate.estimate_maintenance_id
-			amounts_val = {}
-			
-			currency_id = obj_rent.main_currency_id or obj_rent.currency_id
-			#debug(currency_id)
-			rate_cr = currency_id.rate
-			rate_us = 1
-			total = obj_estimate.estimate_maintenance_id.rent_main_total
-			amounts_val['estimate_amountc'] = (total * (obj_estimate.estimate_performance/100.00)  / 12) / rate_us
-			amounts_val['estimate_amountd'] = (total * (obj_estimate.estimate_performance/100.00)  / 12) / rate_cr
-			res[obj_estimate.id] = amounts_val
-		return res
-	def _performance_currency(self,cr,uid,ids,field_name,args,contexto):
-		res = {}
-		for obj_estimate in self.pool.get('rent.rent.main.estimate').browse(cr,uid,ids):
-			obj_rent = obj_estimate.estimate_maintenance_id
-			
-			currencies_val = {}
-			valor = obj_rent._get_total_area(obj_rent.id,None,None)[obj_rent.id]
-			#debug(valor)
-			currencies_val['estimate_colones'] = obj_estimate.estimate_amountc / valor
-			currencies_val['estimate_dollars'] = obj_estimate.estimate_amountd / valor
-			res[obj_estimate.id] = currencies_val
-		return res
-	_columns = {
-		'estimate_performance'       : fields.float('Performance(%)',digits=(12,2), help='This a percentaje number'),
-		'estimate_years'             : fields.function(_performance_years, type='float',method = True,string='Years for reinv.'),
-		'estimate_amountc'           : fields.function(_performance_amount, type='float',method = True,string='Amount', multi=True),
-		'estimate_colones'           : fields.function(_performance_currency, type='float',method = True,string='c / m2',multi='Currency'),
-		
-		'estimate_amountd'           : fields.function(_performance_amount, type='float',method = True,string='Amount $', multi=True),
-		'estimate_dollars'           : fields.function(_performance_currency, type='float',method = True,string='s / m2',multi='Currency'),
-		
-		'estimate_maintenance_id'    : fields.many2one('rent.rent','Rent'),
-		'estimate_date'              : fields.date('Fecha'),
-		'estimate_state'             : fields.selection([('final','Used'),('recommend','Recommend'),('min','Min'),('norec','Not Recomended')],'Status',readonly=False),
-	}
-	_order = "estimate_date desc"
-	_defaults = {
-		'estimate_date'  : date.today().strftime('%d/%m/%Y'),
-	}
-rent_rent_main_estimate()
+    _name = 'rent.rent.main.estimate'
+        
+    def _performance_years(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        for obj_estimate in self.pool.get('rent.rent.main.estimate').browse(cr,uid,ids):
+            if obj_estimate.estimate_performance:
+                res[obj_estimate.id] = 1 / (obj_estimate.estimate_performance / 100.00)
+        return res
+    def _performance_amount(self,cr,uid,ids,field_name,args,context):
+        res = {}
+        amount = 0
+        for obj_estimate in self.pool.get('rent.rent.main.estimate').browse(cr,uid,ids):
+            obj_rent = obj_estimate.estimate_maintenance_id
+            amounts_val = {}
+            
+            currency_id = obj_rent.main_currency_id or obj_rent.currency_id
+            #debug(currency_id)
+            rate_cr = currency_id.rate
+            rate_us = 1
+            total = obj_estimate.estimate_maintenance_id.rent_main_total
+            amounts_val['estimate_amountc'] = (total * (obj_estimate.estimate_performance/100.00)  / 12) / rate_us
+            amounts_val['estimate_amountd'] = (total * (obj_estimate.estimate_performance/100.00)  / 12) / rate_cr
+            res[obj_estimate.id] = amounts_val
+        return res
+    def _performance_currency(self,cr,uid,ids,field_name,args,contexto):
+        res = {}
+        for obj_estimate in self.pool.get('rent.rent.main.estimate').browse(cr,uid,ids):
+            obj_rent = obj_estimate.estimate_maintenance_id
+            
+            currencies_val = {}
+            valor = obj_rent._get_total_area(obj_rent.id,None,None)[obj_rent.id]
+            #debug(valor)
+            currencies_val['estimate_colones'] = obj_estimate.estimate_amountc / valor
+            currencies_val['estimate_dollars'] = obj_estimate.estimate_amountd / valor
+            res[obj_estimate.id] = currencies_val
+        return res
+    _columns = {
+        'estimate_performance'       : fields.float('Performance(%)',digits=(12,2), help='This a percentaje number'),
+        'estimate_years'             : fields.function(_performance_years, type='float',method = True,string='Years for reinv.'),
+        'estimate_amountc'           : fields.function(_performance_amount, type='float',method = True,string='Amount', multi=True),
+        'estimate_colones'           : fields.function(_performance_currency, type='float',method = True,string='c / m2',multi='Currency'),
+        
+        'estimate_amountd'           : fields.function(_performance_amount, type='float',method = True,string='Amount $', multi=True),
+        'estimate_dollars'           : fields.function(_performance_currency, type='float',method = True,string='s / m2',multi='Currency'),
+        
+        'estimate_maintenance_id'    : fields.many2one('rent.rent','Rent'),
+        'estimate_date'              : fields.date('Fecha'),
+        'estimate_state'             : fields.selection([('final','Used'),('recommend','Recommend'),('min','Min'),('norec','Not Recomended')],'Status',readonly=False),
+    }
+    _order = "estimate_date desc"
+    _defaults = {
+        'estimate_date'  : date.today().strftime('%d/%m/%Y'),
+    }
 
 class rent_rent_anual_value(osv.osv):
-	_name = 'rent.rent.anual.value'
-	_columns = {
-		'anual_value_rent_id'    : fields.many2one('rent.rent','Rent reference'),
-		'anual_value_prev_value' : fields.float('Prev. Value',help='This value was taken from the record of rent at the indicated date'),
-		'anual_value_value'      : fields.float('Value',help='This value was taken from the record of rent at the indicated date'),
-		'anual_value_date'       : fields.date('Period'),
-		'anual_value_rate'       : fields.char('Anual Rise',size=64),
-		'anual_value_local_ids'      : fields.many2one('rent.floor.local','Local reference'),
-		'anual_value_type'       : fields.selection([('main','Maintenance'),('rent','Rent')],'Type'),
-	}
-	
-rent_rent_anual_value()
+    _name = 'rent.rent.anual.value'
+    _columns = {
+        'anual_value_rent_id'    : fields.many2one('rent.rent','Rent reference'),
+        'anual_value_prev_value' : fields.float('Prev. Value',help='This value was taken from the record of rent at the indicated date'),
+        'anual_value_value'      : fields.float('Value',help='This value was taken from the record of rent at the indicated date'),
+        'anual_value_date'       : fields.date('Period'),
+        'anual_value_rate'       : fields.char('Anual Rise',size=64),
+        'anual_value_local_ids'      : fields.many2one('rent.floor.local','Local reference'),
+        'anual_value_type'       : fields.selection([('main','Maintenance'),('rent','Rent')],'Type'),
+    }
 
 
 #This class changes the references of the invoice
 #to enable it add a refeerence to the rent
 class rent_invoice_line(osv.osv):
-	_name = 'account.invoice.line'
-	_inherit = 'account.invoice.line'
-	
-	def rent_id_change(self, cr, uid, ids, rent, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
-		res = {}
-		#company_id = context.get('company_id',False)
-		#debug(rent)
-		if rent:
-			obj_rent = self.pool.get('rent.rent').browse(cr, uid, rent, context=context)
-			res['name'] = obj_rent.name
-			res['price_unit'] = obj_rent.rent_amount_base
-			
-			if obj_rent.rent_related_real == 'estate':
-				res['account_id'] = obj_rent.rent_rent_estate_id.estate_account_id.id
-			else:
-				res['account_id'] = obj_rent.rent_rent_account_id.id
-				#res['account_id'] = obj_rent.rent_rent_local_id.local_building.building_estate_id.estate_account_id
-				
-			#obj_company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
-			#if obj_company.currency_id.id != obj_rent.currency_id.id:
-			#	new_price = res['price_unit'] * obj_rent.currency_id.rate
-			#	res['price_unit'] = new_price
-		return {'value' : res}
-	
-	def onchange_type(self,cr,uid,ids,field):
-		res = {}
-		res['product_id'] = False
-		res['invoice_rent_id'] = False
+    _name = 'account.invoice.line'
+    _inherit = 'account.invoice.line'
+    
+    def rent_id_change(self, cr, uid, ids, rent, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
+        res = {}
+        #company_id = context.get('company_id',False)
+        #debug(rent)
+        if rent:
+            obj_rent = self.pool.get('rent.rent').browse(cr, uid, rent, context=context)
+            res['name'] = obj_rent.name
+            res['price_unit'] = obj_rent.rent_amount_base
+            
+            if obj_rent.rent_related_real == 'estate':
+                res['account_id'] = obj_rent.rent_rent_estate_id.estate_account_id.id
+            else:
+                res['account_id'] = obj_rent.rent_rent_account_id.id
+                #res['account_id'] = obj_rent.rent_rent_local_id.local_building.building_estate_id.estate_account_id
+                
+            #obj_company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
+            #if obj_company.currency_id.id != obj_rent.currency_id.id:
+            #    new_price = res['price_unit'] * obj_rent.currency_id.rate
+            #    res['price_unit'] = new_price
+        return {'value' : res}
+    
+    def onchange_type(self,cr,uid,ids,field):
+        res = {}
+        res['product_id'] = False
+        res['invoice_rent_id'] = False
 
-		return {'value' : res}
-	
-	_columns = {
-		'invoice_type'    : fields.selection([('rent','Rent'),('product','Product')],'Type',help = 'Select one of this to determine the type of invoice to create'),
-		'invoice_rent_id'    : fields.many2one('rent.rent','Rent id'),
-	}
-	_defaults = {
-		'invoice_type'  : 'rent',
-	}
-rent_invoice_line()
+        return {'value' : res}
+    
+    _columns = {
+        'invoice_type'    : fields.selection([('rent','Rent'),('product','Product')],'Type',help = 'Select one of this to determine the type of invoice to create'),
+        'invoice_rent_id'    : fields.many2one('rent.rent','Rent id'),
+    }
+    _defaults = {
+        'invoice_type'  : 'rent',
+    }
 
 #This class is used to keep reference of all the invoices
 #that have been register to the rent
 class rent_rent_invoice(osv.osv):
-	_name = 'rent.invoice.rent'
-	_columns = {
-		'invoice_id'       : fields.many2one('account.invoice','Invoice', ondelete='cascade'),
-		'invoice_rent_id'  : fields.many2one('rent.rent', 'Rent',ondelete='cascade'),
-		'invoice_date'     : fields.related('invoice_id','date_invoice', type='date',relation='account.invoice',string='Date',readonly=True,store=False),
-		'invoice_due_date' : fields.related('invoice_id','date_due', type='date',relation='account.invoice',string='Due Date',readonly=True,store=False),
-		'invoice_amount'   : fields.related('invoice_id','amount_total', type='float',relation='account.invoice',string='Amount Total',readonly=True,store=False),
-		'invoice_state'    : fields.related('invoice_id','state', type='char',relation='account.invoice',string='State',readonly=True,store=False),
-		'invoice_number'   : fields.related('invoice_id','number', type='char',size=64,relation='account.invoice',string='Invoice Number',readonly=True,store=False),
-		'invouce_residual' : fields.related('invoice_id','residual', type='float',relation='account.invoice',string='Residual',readonly=True,store=False),
-		'invoice_type'     : fields.selection([('main','Maintenance'),('rent','Rent')],'Type'),
-		
-	}
-
-rent_rent_invoice()
+    _name = 'rent.invoice.rent'
+    _columns = {
+        'invoice_id'       : fields.many2one('account.invoice','Invoice', ondelete='cascade'),
+        'invoice_rent_id'  : fields.many2one('rent.rent', 'Rent',ondelete='cascade'),
+        'invoice_date'     : fields.related('invoice_id','date_invoice', type='date',relation='account.invoice',string='Date',readonly=True,store=False),
+        'invoice_due_date' : fields.related('invoice_id','date_due', type='date',relation='account.invoice',string='Due Date',readonly=True,store=False),
+        'invoice_amount'   : fields.related('invoice_id','amount_total', type='float',relation='account.invoice',string='Amount Total',readonly=True,store=False),
+        'invoice_state'    : fields.related('invoice_id','state', type='char',relation='account.invoice',string='State',readonly=True,store=False),
+        'invoice_number'   : fields.related('invoice_id','number', type='char',size=64,relation='account.invoice',string='Invoice Number',readonly=True,store=False),
+        'invouce_residual' : fields.related('invoice_id','residual', type='float',relation='account.invoice',string='Residual',readonly=True,store=False),
+        'invoice_type'     : fields.selection([('main','Maintenance'),('rent','Rent')],'Type'),
+    }
 
 class rent_invoice_log(osv.osv):
-	_name = 'rent.invoice.log'
-	_order = 'log_date'
-	_columns = {
-		'log_date' : fields.date('Date'),
-		'log_desc' : fields.char('Description',size=200),
-		#'log_rent' : fields.many2one('rent.rent','Rent Ref'),
-	}
-rent_invoice_log()
-#
-#
+    _name = 'rent.invoice.log'
+    _order = 'log_date'
+    _columns = {
+        'log_date' : fields.date('Date'),
+        'log_desc' : fields.char('Description',size=200),
+        #'log_rent' : fields.many2one('rent.rent','Rent Ref'),
+    }
+
 class rent_contract(osv.osv):
-	_name = 'rent.contract'
-	
-	def create(self,cr,uid, vals,context=None):
-		#debug("============================CREANDO EL NUEVO CONTRATO")
-		contract_id = super(rent_contract,self).create(cr,uid,vals,context)
-		#debug(contract_id)
-		obj_contract = self.pool.get('rent.contract').browse(cr,uid,contract_id)
-		#debug(obj_contract)
-		i = 0
-		for clause_perm in self.pool.get('rent.contract.clause').search(cr,uid,[('clause_is_basic','=','True')]):
-		#for obj_clause_perm in self.pool.get('rent.contract.clause').browse(cr,uid,clause_perm):
-			#clause_rel_id = self.pool.get('rent.contract.clause.rel').create(cr,uid,{'sequence':i,'rent_contract_id':obj_contract.id,'rent_contract_clause_id' : clause_perm},context)
-			#obj_clause_perm = self.pool.get('rent.contract.clause.rel').browse(cr,uid,clause_rel_id)
-			#if obj_clause_perm:
-			obj_contract.write({'contract_clauses_ids' : [(0,0,{'sequence':i,'rent_contract_id':obj_contract.id,'rent_contract_clause_id' : clause_perm})]})
-			i+=1
-		return obj_contract.id
-				
-	_columns = {
-		'name'             : fields.char('Reference', size=64),
-		'contract_rent_id'    : fields.many2one('rent.rent','Rent Reference'),
-		'contract_clauses_ids' : fields.one2many('rent.contract.clause.rel','rent_contract_id','Clausulas'),
-		#'contract_clauses' : fields.many2many('rent.contract.clause','rent_contract_clause_rel','name','clause_code','Clausulas'),
-		#'contract_design'  : fields.char('Design',size=64),
-	}
-	
-rent_contract()
+    _name = 'rent.contract'
+    
+    def create(self,cr,uid, vals,context=None):
+        #debug("============================CREANDO EL NUEVO CONTRATO")
+        contract_id = super(rent_contract,self).create(cr,uid,vals,context)
+        #debug(contract_id)
+        obj_contract = self.pool.get('rent.contract').browse(cr,uid,contract_id)
+        #debug(obj_contract)
+        i = 0
+        for clause_perm in self.pool.get('rent.contract.clause').search(cr,uid,[('clause_is_basic','=','True')]):
+        #for obj_clause_perm in self.pool.get('rent.contract.clause').browse(cr,uid,clause_perm):
+            #clause_rel_id = self.pool.get('rent.contract.clause.rel').create(cr,uid,{'sequence':i,'rent_contract_id':obj_contract.id,'rent_contract_clause_id' : clause_perm},context)
+            #obj_clause_perm = self.pool.get('rent.contract.clause.rel').browse(cr,uid,clause_rel_id)
+            #if obj_clause_perm:
+            obj_contract.write({'contract_clauses_ids' : [(0,0,{'sequence':i,'rent_contract_id':obj_contract.id,'rent_contract_clause_id' : clause_perm})]})
+            i+=1
+        return obj_contract.id
+                
+    _columns = {
+        'name'             : fields.char('Reference', size=64),
+        'contract_rent_id'    : fields.many2one('rent.rent','Rent Reference'),
+        'contract_clauses_ids' : fields.one2many('rent.contract.clause.rel','rent_contract_id','Clausulas'),
+        #'contract_clauses' : fields.many2many('rent.contract.clause','rent_contract_clause_rel','name','clause_code','Clausulas'),
+        #'contract_design'  : fields.char('Design',size=64),
+    }
 
-#
-#
-#
 class rent_contract_template(osv.osv):
-	_name = 'rent.contract.template'
+    _name = 'rent.contract.template'
 rent_contract_template()
 
 #Class that holds all the clauses for the contracts
 #this class is used to create a custom contract
 #it simulates a sintaxys analizer to subtitute codes with the corresponding clause
 class rent_contract_clause(osv.osv):
-	_name = 'rent.contract.clause'
-	_rec_name = 'clause_code'
-	_columns = {
-		'clause_code'     : fields.char('Reference',size=64,required=True,help='Reference code for the clause, used to create custom contracts'),
-		'clause_subject'  : fields.char('Subject',size=64,required=True),
-		'clause_body'     : fields.text('Body',required=True),
-		'clause_is_basic' : fields.boolean('Priority', help = 'Check if the clause should allways appear on every contract you create'),
-		#'clause_contract' : fields.many2many('rent.contract','rent_contract_clause','id','id','Contracts'),
-	}
-rent_contract_clause()
-
+    _name = 'rent.contract.clause'
+    _rec_name = 'clause_code'
+    _columns = {
+        'clause_code'     : fields.char('Reference',size=64,required=True,help='Reference code for the clause, used to create custom contracts'),
+        'clause_subject'  : fields.char('Subject',size=64,required=True),
+        'clause_body'     : fields.text('Body',required=True),
+        'clause_is_basic' : fields.boolean('Priority', help = 'Check if the clause should allways appear on every contract you create'),
+        #'clause_contract' : fields.many2many('rent.contract','rent_contract_clause','id','id','Contracts'),
+    }
 
 class rent_contract_clause_rel(osv.osv):
-	_name = 'rent.contract.clause.rel'
-	_rec_name = 'rent_contract_id'
-	_columns = {
-		'rent_contract_id'        : fields.many2one('rent.contract','Contract Reference'),
-		'rent_contract_clause_id' : fields.many2one('rent.contract.clause','Contract Reference'),
-		'sequence'                : fields.integer('Sequence'),
-	}
-rent_contract_clause_rel()
+    _name = 'rent.contract.clause.rel'
+    _rec_name = 'rent_contract_id'
+    _columns = {
+        'rent_contract_id'        : fields.many2one('rent.contract','Contract Reference'),
+        'rent_contract_clause_id' : fields.many2one('rent.contract.clause','Contract Reference'),
+        'sequence'                : fields.integer('Sequence'),
+    }

=== modified file 'rent/rent_data.xml'
--- rent/rent_data.xml	2011-12-05 17:47:04 +0000
+++ rent/rent_data.xml	2012-03-29 22:54:18 +0000
@@ -1,3331 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
 	<data noupdate="0">
-		<!--
-		CANTON AND DISTRICT FROM CR
-		-->
-
-		<!--
-		===============================
-			Canton of San José
-		===============================
-		-->
-		<record id="canton_SJ_SJSJ" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">San José</field>
-			<field name = "code">SJSJ</field>
-		</record>
-
-		<record id="district_SJSJ_CAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">El Carmen</field>
-			<field name = "code">CAR</field>
-		</record>
-		<record id="district_SJSJ_MER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">Merced</field>
-			<field name = "code">MER</field>
-		</record>
-		<record id="district_SJSJ_HOS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">Hospital</field>
-			<field name = "code">HOS</field>
-		</record>
-		<record id="district_SJSJ_CAT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">Catedral</field>
-			<field name = "code">CAT</field>
-		</record>
-		<record id="district_SJSJ_ZAP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">Zapote</field>
-			<field name = "code">ZAP</field>
-		</record>
-		<record id="district_SJSJ_SFDR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">San Francisco de Dos Ríos</field>
-			<field name = "code">SFDR</field>
-		</record>
-		<record id="district_SJSJ_URU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">Uruca</field>
-			<field name = "code">URU</field>
-		</record>
-		<record id="district_SJSJ_MR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">Mata Redonda</field>
-			<field name = "code">MR</field>
-		</record>
-		<record id="district_SJSJ_PAV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">Pavas</field>
-			<field name = "code">PAV</field>
-		</record>
-		<record id="district_SJSJ_HAT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">Hatillo</field>
-			<field name = "code">HAT</field>
-		</record>
-		<record id="district_SJSJ_SJSS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_SJSJ"/>
-			<field name="name">San Sebastián</field>
-			<field name = "code">SJSS</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Escazú
-		===============================
-		-->
-		<record id="canton_SJ_ESC" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Escazú</field>
-			<field name = "code">ESC</field>
-		</record>
-
-		<record id="district_ESC_EESC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ESC"/>
-			<field name="name">Escazú</field>
-			<field name = "code">EESC</field>
-		</record>
-		<record id="district_ESC_STAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ESC"/>
-			<field name="name">San Antonio</field>
-			<field name = "code">STAN</field>
-		</record>
-		<record id="district_ESC_STRA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ESC"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">STRA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Desamparados
-		===============================
-		-->
-		<record id="canton_SJ_DES" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Desamparados</field>
-			<field name = "code">DES</field>
-		</record>
-
-		<record id="district_DES_DDES" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">Desamparados</field>
-			<field name = "code">DDES</field>
-		</record>
-		<record id="district_DES_STMI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">San Miguel</field>
-			<field name = "code">STMI</field>
-		</record>
-		<record id="district_DES_SJDD" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">San Juan de Dios</field>
-			<field name = "code">SJDD</field>
-		</record>
-		<record id="district_DES_SRA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">San Rafael Arriba</field>
-			<field name = "code">SRA</field>
-		</record>
-		<record id="district_DES_DSTA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">San Antonio</field>
-			<field name = "code">DSTA</field>
-		</record>
-		<record id="district_DES_FRA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">Frailes</field>
-			<field name = "code">FRA</field>
-		</record>
-		<record id="district_DES_PAT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">Patarrá</field>
-			<field name = "code">PAT</field>
-		</record>
-		<record id="district_DES_STCR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">San Cristóbal</field>
-			<field name = "code">STCR</field>
-		</record>
-		<record id="district_DES_ROS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">Rosario</field>
-			<field name = "code">ROS</field>
-		</record>
-		<record id="district_DES_DAM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">Damas</field>
-			<field name = "code">DAM</field>
-		</record>
-		<record id="district_DES_SRAB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">San Rafael Abajo</field>
-			<field name = "code">SRAB</field>
-		</record>
-		<record id="district_DES_GRA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">Gravilias</field>
-			<field name = "code">GRA</field>
-		</record>
-		<record id="district_DES_LG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DES"/>
-			<field name="name">Los Guido</field>
-			<field name = "code">LG</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Puriscal
-		===============================
-		-->
-		<record id="canton_SJ_PUR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Puriscal</field>
-			<field name = "code">PUR</field>
-		</record>
-
-		<record id="district_PUR_SAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">Santiago</field>
-			<field name = "code">SAN</field>
-		</record>
-		<record id="district_PUR_MS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">Mercedes Sur</field>
-			<field name = "code">MS</field>
-		</record>
-		<record id="district_PUR_BAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">Barbacoas</field>
-			<field name = "code">BAR</field>
-		</record>
-		<record id="district_PUR_GA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">Grifo Alto</field>
-			<field name = "code">GA</field>
-		</record>
-		<record id="district_PUR_PSTR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">PSTR</field>
-		</record>
-		<record id="district_PUR_CAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">Candelarita</field>
-			<field name = "code">CAN</field>
-		</record>
-		<record id="district_PUR_DESI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">Desamparaditos</field>
-			<field name = "code">DESI</field>
-		</record>
-		<record id="district_PUR_PSTA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">San Antonio</field>
-			<field name = "code">PSTA</field>
-		</record>
-		<record id="district_PUR_CHI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PUR"/>
-			<field name="name">Chires</field>
-			<field name = "code">CHI</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Tarrazú
-		===============================
-		-->
-		<record id="canton_SJ_TAR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Tarrazú</field>
-			<field name = "code">TAR</field>
-		</record>
-
-		<record id="district_TAR_TSTM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TAR"/>
-			<field name="name">San Marcos</field>
-			<field name = "code">TSTM</field>
-		</record>
-		<record id="district_TAR_STLO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TAR"/>
-			<field name="name">San Lorenzo</field>
-			<field name = "code">STLO</field>
-		</record>
-		<record id="district_TAR_TSTC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TAR"/>
-			<field name="name">San Carlos</field>
-			<field name = "code">TSTC</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Aserrí
-		===============================
-		-->
-		<record id="canton_SJ_ASE" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Aserrí</field>
-			<field name = "code">ASE</field>
-		</record>
-
-		<record id="district_ASE_AASE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ASE"/>
-			<field name="name">Aserrí</field>
-			<field name = "code">AASE</field>
-		</record>
-		<record id="district_ASE_TTAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ASE"/>
-			<field name="name">Tarbaca</field>
-			<field name = "code">TTAR</field>
-		</record>
-		<record id="district_ASE_VDJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ASE"/>
-			<field name="name">Vuelta de Jorco</field>
-			<field name = "code">VDJ</field>
-		</record>
-		<record id="district_ASE_STGA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ASE"/>
-			<field name="name">San Gabriel</field>
-			<field name = "code">STGA</field>
-		</record>
-		<record id="district_ASE_LEG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ASE"/>
-			<field name="name">Legua</field>
-			<field name = "code">LEG</field>
-		</record>
-		<record id="district_ASE_MON" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ASE"/>
-			<field name="name">Monterrey</field>
-			<field name = "code">MON</field>
-		</record>
-		<record id="district_ASE_SAL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ASE"/>
-			<field name="name">Salitrillos</field>
-			<field name = "code">SAL</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Mora
-		===============================
-		-->
-		<record id="canton_SJ_MOR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Mora</field>
-			<field name = "code">MOR</field>
-		</record>
-
-		<record id="district_MOR_COL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MOR"/>
-			<field name="name">Colón</field>
-			<field name = "code">COL</field>
-		</record>
-		<record id="district_MOR_GUAY" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MOR"/>
-			<field name="name">Guayabo</field>
-			<field name = "code">GUAY</field>
-		</record>
-		<record id="district_MOR_TAB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MOR"/>
-			<field name="name">Tabarcia</field>
-			<field name = "code">TAB</field>
-		</record>
-		<record id="district_MOR_PN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MOR"/>
-			<field name="name">Piedras Negras</field>
-			<field name = "code">PN</field>
-		</record>
-		<record id="district_MOR_PIC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MOR"/>
-			<field name="name">Picagres</field>
-			<field name = "code">PIC</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Goicoechea
-		===============================
-		-->
-		<record id="canton_SJ_GOI" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Goicoechea</field>
-			<field name = "code">GOI</field>
-		</record>
-
-		<record id="district_GOI_GUAD" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_GOI"/>
-			<field name="name">Guadalupe</field>
-			<field name = "code">GUAD</field>
-		</record>
-		<record id="district_GOI_STFR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_GOI"/>
-			<field name="name">San Francisco</field>
-			<field name = "code">STFR</field>
-		</record>
-		<record id="district_GOI_GOCB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_GOI"/>
-			<field name="name">Calle Blancos</field>
-			<field name = "code">GOCB</field>
-		</record>
-		<record id="district_GOI_MDP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_GOI"/>
-			<field name="name">Mata de Plátano</field>
-			<field name = "code">MDP</field>
-		</record>
-		<record id="district_GOI_IP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_GOI"/>
-			<field name="name">Ipís</field>
-			<field name = "code">IP</field>
-		</record>
-		<record id="district_GOI_RR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_GOI"/>
-			<field name="name">Rancho Redondo</field>
-			<field name = "code">RR</field>
-		</record>
-		<record id="district_GOI_PURR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_GOI"/>
-			<field name="name">Purral</field>
-			<field name = "code">PURR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Santa Ana
-		===============================
-		-->
-		<record id="canton_SJ_STA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Santa Ana</field>
-			<field name = "code">STA</field>
-		</record>
-
-		<record id="district_STA_SSTA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_STA"/>
-			<field name="name">Santa Ana</field>
-			<field name = "code">SSTA</field>
-		</record>
-		<record id="district_STA_SALI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_STA"/>
-			<field name="name">Salitral</field>
-			<field name = "code">SALI</field>
-		</record>
-		<record id="district_STA_POZ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_STA"/>
-			<field name="name">Pozos</field>
-			<field name = "code">POZ</field>
-		</record>
-		<record id="district_STA_SURU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_STA"/>
-			<field name="name">Uruca</field>
-			<field name = "code">SURU</field>
-		</record>
-		<record id="district_STA_PIE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_STA"/>
-			<field name="name">Piedades</field>
-			<field name = "code">PIE</field>
-		</record>
-		<record id="district_STA_BRA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_STA"/>
-			<field name="name">Brasil</field>
-			<field name = "code">BRA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Alajuelita
-		===============================
-		-->
-		<record id="canton_SJ_ALA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Alajuelita</field>
-			<field name = "code">ALA</field>
-		</record>
-
-		<record id="district_ALA_AALA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ALA"/>
-			<field name="name">Alajuelita</field>
-			<field name = "code">AALA</field>
-		</record>
-		<record id="district_ALA_ASJO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ALA"/>
-			<field name="name">San Josecito</field>
-			<field name = "code">ASJO</field>
-		</record>
-		<record id="district_ALA_ASTA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ALA"/>
-			<field name="name">San Antonio</field>
-			<field name = "code">ASTA</field>
-		</record>
-		<record id="district_ALA_CON" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ALA"/>
-			<field name="name">Concepción</field>
-			<field name = "code">CON</field>
-		</record>
-		<record id="district_ALA_STFE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ALA"/>
-			<field name="name">San Felipe</field>
-			<field name = "code">STFE</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Vázquez de Coronado
-		===============================
-		-->
-		<record id="canton_SJ_VDC" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Vázquez de Coronado</field>
-			<field name = "code">VDC</field>
-		</record>
-
-		<record id="district_VDC_CSTI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_VDC"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">CSTI</field>
-		</record>
-		<record id="district_VDC_CSTR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_VDC"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">CSTR</field>
-		</record>
-		<record id="district_VDC_DNDJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_VDC"/>
-			<field name="name">Dulce Nombre de Jesús</field>
-			<field name = "code">DNDJ</field>
-		</record>
-		<record id="district_VDC_PATA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_VDC"/>
-			<field name="name">Patalillo</field>
-			<field name = "code">PATA</field>
-		</record>
-		<record id="district_VDC_CAS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_VDC"/>
-			<field name="name">Cascajal</field>
-			<field name = "code">CAS</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Acosta
-		===============================
-		-->
-		<record id="canton_SJ_ACO" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Acosta</field>
-			<field name = "code">ACO</field>
-		</record>
-
-		<record id="district_ACO_ASTI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ACO"/>
-			<field name="name">San Ignacio</field>
-			<field name = "code">ASTI</field>
-		</record>
-		<record id="district_ACO_GUAI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ACO"/>
-			<field name="name">Guaitil</field>
-			<field name = "code">GUAI</field>
-		</record>
-		<record id="district_ACO_APAL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ACO"/>
-			<field name="name">Palmichal</field>
-			<field name = "code">APAL</field>
-		</record>
-		<record id="district_ACO_CANG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ACO"/>
-			<field name="name">Cangrejal</field>
-			<field name = "code">CANG</field>
-		</record>
-		<record id="district_ACO_SABA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_ACO"/>
-			<field name="name">Sabanillas</field>
-			<field name = "code">SABA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Tibás
-		===============================
-		-->
-		<record id="canton_SJ_TIB" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Tibás</field>
-			<field name = "code">TIB</field>
-		</record>
-
-		<record id="district_TIB_STJU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TIB"/>
-			<field name="name">San Juan</field>
-			<field name = "code">STJU</field>
-		</record>
-		<record id="district_TIB_CE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TIB"/>
-			<field name="name">Cinco Esquinas</field>
-			<field name = "code">CE</field>
-		</record>
-		<record id="district_TIB_AL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TIB"/>
-			<field name="name">Anselmo Llorente</field>
-			<field name = "code">AL</field>
-		</record>
-		<record id="district_TIB_LX" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TIB"/>
-			<field name="name">León XIII</field>
-			<field name = "code">LX</field>
-		</record>
-		<record id="district_TIB_COLI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TIB"/>
-			<field name="name">Colima</field>
-			<field name = "code">COLI</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Moravia
-		===============================
-		-->
-		<record id="canton_SJ_MORV" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Moravia</field>
-			<field name = "code">MORV</field>
-		</record>
-
-		<record id="district_MORV_STVI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MORV"/>
-			<field name="name">San Vicente</field>
-			<field name = "code">STVI</field>
-		</record>
-		<record id="district_MORV_STJE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MORV"/>
-			<field name="name">San Jerónimo</field>
-			<field name = "code">STJE</field>
-		</record>
-		<record id="district_MORV_TRI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MORV"/>
-			<field name="name">Trinidad</field>
-			<field name = "code">TRI</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Montes de Oca
-		===============================
-		-->
-		<record id="canton_SJ_MDO" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Montes de Oca</field>
-			<field name = "code">MDO</field>
-		</record>
-
-		<record id="district_MDO_STPE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MDO"/>
-			<field name="name">San Pedro</field>
-			<field name = "code">STPE</field>
-		</record>
-		<record id="district_MDO_SAB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MDO"/>
-			<field name="name">Sabanilla</field>
-			<field name = "code">SAB</field>
-		</record>
-		<record id="district_MDO_MMER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MDO"/>
-			<field name="name">Mercedes</field>
-			<field name = "code">MMER</field>
-		</record>
-		<record id="district_MDO_MSTR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_MDO"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">MSTR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Turrubares
-		===============================
-		-->
-		<record id="canton_SJ_TUR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Turrubares</field>
-			<field name = "code">TUR</field>
-		</record>
-
-		<record id="district_TUR_TSTP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TUR"/>
-			<field name="name">San Pablo</field>
-			<field name = "code">TSTP</field>
-		</record>
-		<record id="district_TUR_TSP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TUR"/>
-			<field name="name">San Pedro</field>
-			<field name = "code">TSP</field>
-		</record>
-		<record id="district_TUR_SJDM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TUR"/>
-			<field name="name">San Juan de Mata</field>
-			<field name = "code">SJDM</field>
-		</record>
-		<record id="district_TUR_STLU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TUR"/>
-			<field name="name">San Luis</field>
-			<field name = "code">STLU</field>
-		</record>
-		<record id="district_TUR_CARA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_TUR"/>
-			<field name="name">Carara</field>
-			<field name = "code">CARA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Dota
-		===============================
-		-->
-		<record id="canton_SJ_DOT" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Dota</field>
-			<field name = "code">DOT</field>
-		</record>
-
-		<record id="district_DOT_DOSM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DOT"/>
-			<field name="name">Santa María</field>
-			<field name = "code">DOSM</field>
-		</record>
-		<record id="district_DOT_JAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DOT"/>
-			<field name="name">Jardín</field>
-			<field name = "code">JAR</field>
-		</record>
-		<record id="district_DOT_COP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_DOT"/>
-			<field name="name">Copey</field>
-			<field name = "code">COP</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Curridabat
-		===============================
-		-->
-		<record id="canton_SJ_CUR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Curridabat</field>
-			<field name = "code">CUR</field>
-		</record>
-
-		<record id="district_CUR_CCUR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_CUR"/>
-			<field name="name">Curridabat</field>
-			<field name = "code">CCUR</field>
-		</record>
-		<record id="district_CUR_GRAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_CUR"/>
-			<field name="name">Granadilla</field>
-			<field name = "code">GRAN</field>
-		</record>
-		<record id="district_CUR_SANC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_CUR"/>
-			<field name="name">Sánchez</field>
-			<field name = "code">SANC</field>
-		</record>
-		<record id="district_CUR_TIR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_CUR"/>
-			<field name="name">Tirrases</field>
-			<field name = "code">TIR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Pérez Zeledón
-		===============================
-		-->
-		<record id="canton_SJ_PZ" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">Pérez Zeledón</field>
-			<field name = "code">PZ</field>
-		</record>
-
-		<record id="district_PZ_SIDG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">San Isidro del General</field>
-			<field name = "code">SIDG</field>
-		</record>
-		<record id="district_PZ_GEN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">General</field>
-			<field name = "code">GEN</field>
-		</record>
-		<record id="district_PZ_DF" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">Daniel Flores</field>
-			<field name = "code">DF</field>
-		</record>
-		<record id="district_PZ_RIV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">Rivas</field>
-			<field name = "code">RIV</field>
-		</record>
-		<record id="district_PZ_PZSP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">San Pedro</field>
-			<field name = "code">PZSP</field>
-		</record>
-		<record id="district_PZ_PLATA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">Platanares</field>
-			<field name = "code">PLATA</field>
-		</record>
-		<record id="district_PZ_PEJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">Pejibaye</field>
-			<field name = "code">PEJ</field>
-		</record>
-		<record id="district_PZ_CAJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">Cajón</field>
-			<field name = "code">CAJ</field>
-		</record>
-		<record id="district_PZ_PZBA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">Barú</field>
-			<field name = "code">PZBA</field>
-		</record>
-		<record id="district_PZ_RN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">Río Nuevo</field>
-			<field name = "code">RN</field>
-		</record>
-		<record id="district_PZ_PPAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_PZ"/>
-			<field name="name">Páramo</field>
-			<field name = "code">PPAR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of León Cortés
-		===============================
-		-->
-		<record id="canton_SJ_LC" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_SJ"/>
-			<field name="name">León Cortés</field>
-			<field name = "code">LC</field>
-		</record>
-
-		<record id="district_LC_LCSP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_LC"/>
-			<field name="name">San Pablo</field>
-			<field name = "code">LCSP</field>
-		</record>
-		<record id="district_LC_SA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_LC"/>
-			<field name="name">San Andrés</field>
-			<field name = "code">SA</field>
-		</record>
-		<record id="district_LC_LLB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_LC"/>
-			<field name="name">Llano Bonito</field>
-			<field name = "code">LLB</field>
-		</record>
-		<record id="district_LC_LCSI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_LC"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">LCSI</field>
-		</record>
-		<record id="district_LC_SC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_LC"/>
-			<field name="name">Santa Cruz</field>
-			<field name = "code">SC</field>
-		</record>
-		<record id="district_LC_LCSA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_SJ_LC"/>
-			<field name="name">San Antonio</field>
-			<field name = "code">LCSA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Heredia
-		===============================
-		-->
-		<record id="canton_H_HER" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">Heredia</field>
-			<field name = "code">HER</field>
-		</record>
-
-		<record id="district_HER_HHER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_HER"/>
-			<field name="name">Heredia</field>
-			<field name = "code">HHER</field>
-		</record>
-		<record id="district_HER_HMER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_HER"/>
-			<field name="name">Mercedes</field>
-			<field name = "code">HMER</field>
-		</record>
-		<record id="district_HER_HSF" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_HER"/>
-			<field name="name">San Francisco</field>
-			<field name = "code">HSF</field>
-		</record>
-		<record id="district_HER_ULL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_HER"/>
-			<field name="name">Ulloa</field>
-			<field name = "code">ULL</field>
-		</record>
-		<record id="district_HER_VAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_HER"/>
-			<field name="name">Varablanca</field>
-			<field name = "code">VAR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Barva
-		===============================
-		-->
-		<record id="canton_H_BARV" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">Barva</field>
-			<field name = "code">BARV</field>
-		</record>
-
-		<record id="district_BARV_BABA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BARV"/>
-			<field name="name">Barva</field>
-			<field name = "code">BABA</field>
-		</record>
-		<record id="district_BARV_BSP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BARV"/>
-			<field name="name">San Pedro</field>
-			<field name = "code">BSP</field>
-		</record>
-		<record id="district_BARV_BSPA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BARV"/>
-			<field name="name">San Pablo</field>
-			<field name = "code">BSPA</field>
-		</record>
-		<record id="district_BARV_BSRO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BARV"/>
-			<field name="name">San Roque</field>
-			<field name = "code">BSRO</field>
-		</record>
-		<record id="district_BARV_BSLU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BARV"/>
-			<field name="name">Santa Lucía</field>
-			<field name = "code">BSLU</field>
-		</record>
-		<record id="district_BARV_BSJM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BARV"/>
-			<field name="name">San José de la Montaña</field>
-			<field name = "code">BSJM</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Santo Domingo
-		===============================
-		-->
-		<record id="canton_H_STDO" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">Santo Domingo</field>
-			<field name = "code">STDO</field>
-		</record>
-
-		<record id="district_STDO_SDSD" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STDO"/>
-			<field name="name">Santo Domingo</field>
-			<field name = "code">SDSD</field>
-		</record>
-		<record id="district_STDO_SDSV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STDO"/>
-			<field name="name">San Vicente</field>
-			<field name = "code">SDSV</field>
-		</record>
-		<record id="district_STDO_SDSM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STDO"/>
-			<field name="name">San Miguel</field>
-			<field name = "code">SDSM</field>
-		</record>
-		<record id="district_STDO_SDPA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STDO"/>
-			<field name="name">Paracito</field>
-			<field name = "code">SDPA</field>
-		</record>
-		<record id="district_STDO_STTO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STDO"/>
-			<field name="name">Santo Tomás</field>
-			<field name = "code">STTO</field>
-		</record>
-		<record id="district_STDO_SDRO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STDO"/>
-			<field name="name">Santa Rosa</field>
-			<field name = "code">SDRO</field>
-		</record>
-		<record id="district_STDO_TURE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STDO"/>
-			<field name="name">Tures</field>
-			<field name = "code">TURE</field>
-		</record>
-		<record id="district_STDO_SDP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STDO"/>
-			<field name="name">Pará</field>
-			<field name = "code">SDP</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Santa Bárbara
-		===============================
-		-->
-		<record id="canton_H_STBA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">Santa Bárbara</field>
-			<field name = "code">STBA</field>
-		</record>
-
-		<record id="district_STBA_SBSB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STBA"/>
-			<field name="name">Santa Bárbara</field>
-			<field name = "code">SBSB</field>
-		</record>
-		<record id="district_STBA_SBSP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STBA"/>
-			<field name="name">San Pedro</field>
-			<field name = "code">SBSP</field>
-		</record>
-		<record id="district_STBA_SBSJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STBA"/>
-			<field name="name">San Juan</field>
-			<field name = "code">SBSJ</field>
-		</record>
-		<record id="district_STBA_JES" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STBA"/>
-			<field name="name">Jesús</field>
-			<field name = "code">JES</field>
-		</record>
-		<record id="district_STBA_SBSD" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STBA"/>
-			<field name="name">Santo Domingo</field>
-			<field name = "code">SBSD</field>
-		</record>
-		<record id="district_STBA_PURA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_STBA"/>
-			<field name="name">Purabá</field>
-			<field name = "code">PURA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of San Rafael
-		===============================
-		-->
-		<record id="canton_H_SAR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">SAR</field>
-		</record>
-
-		<record id="district_SAR_SRSR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAR"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">SRSR</field>
-		</record>
-		<record id="district_SAR_SRSJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAR"/>
-			<field name="name">San Josecito</field>
-			<field name = "code">SRSJ</field>
-		</record>
-		<record id="district_SAR_SRSA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAR"/>
-			<field name="name">Santiago</field>
-			<field name = "code">SRSA</field>
-		</record>
-		<record id="district_SAR_ANG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAR"/>
-			<field name="name">Ángeles</field>
-			<field name = "code">ANG</field>
-		</record>
-		<record id="district_SAR_SRCO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAR"/>
-			<field name="name">Concepción</field>
-			<field name = "code">SRCO</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of San Isidro
-		===============================
-		-->
-		<record id="canton_H_SAI" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">SAI</field>
-		</record>
-
-		<record id="district_SAI_SASI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAI"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">SASI</field>
-		</record>
-		<record id="district_SAI_SISJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAI"/>
-			<field name="name">San José</field>
-			<field name = "code">SISJ</field>
-		</record>
-		<record id="district_SAI_SICO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAI"/>
-			<field name="name">Concepción</field>
-			<field name = "code">SICO</field>
-		</record>
-		<record id="district_SAI_SISF" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAI"/>
-			<field name="name">San Francisco</field>
-			<field name = "code">SISF</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Belén
-		===============================
-		-->
-		<record id="canton_H_BEL" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">Belén</field>
-			<field name = "code">BEL</field>
-		</record>
-
-		<record id="district_BEL_BSA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BEL"/>
-			<field name="name">San Antonio</field>
-			<field name = "code">BSA</field>
-		</record>
-		<record id="district_BEL_RIB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BEL"/>
-			<field name="name">Ribera</field>
-			<field name = "code">RIB</field>
-		</record>
-		<record id="district_BEL_ASU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_BEL"/>
-			<field name="name">Asunción</field>
-			<field name = "code">ASU</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Flores
-		===============================
-		-->
-		<record id="canton_H_FLO" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">Flores</field>
-			<field name = "code">FLO</field>
-		</record>
-
-		<record id="district_FLO_FSJO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_FLO"/>
-			<field name="name">San Joaquín</field>
-			<field name = "code">FSJO</field>
-		</record>
-		<record id="district_FLO_BARRA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_FLO"/>
-			<field name="name">Barrantes</field>
-			<field name = "code">BARRA</field>
-		</record>
-		<record id="district_FLO_LLO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_FLO"/>
-			<field name="name">Llorente</field>
-			<field name = "code">LLO</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of San Pablo
-		===============================
-		-->
-		<record id="canton_H_SAP" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">San Pablo</field>
-			<field name = "code">SAP</field>
-		</record>
-
-		<record id="district_SAP_SPSP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SAP"/>
-			<field name="name">San Pablo</field>
-			<field name = "code">SPSP</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Sarapiquí
-		===============================
-		-->
-		<record id="canton_H_SARA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_H"/>
-			<field name="name">Sarapiquí</field>
-			<field name = "code">SARA</field>
-		</record>
-
-		<record id="district_SARA_PV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SARA"/>
-			<field name="name">Puerto Viejo</field>
-			<field name = "code">PV</field>
-		</record>
-		<record id="district_SARA_LV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SARA"/>
-			<field name="name">La Virgen</field>
-			<field name = "code">LV</field>
-		</record>
-		<record id="district_SARA_HOR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SARA"/>
-			<field name="name">Horquetas</field>
-			<field name = "code">HOR</field>
-		</record>
-		<record id="district_SARA_LDG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SARA"/>
-			<field name="name">Llanuras del Gaspar</field>
-			<field name = "code">LDG</field>
-		</record>
-		<record id="district_SARA_CUR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_H_SARA"/>
-			<field name="name">Cureña</field>
-			<field name = "code">CUR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Alajuela
-		===============================
-		-->
-		<record id="canton_A_ALAJ" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Alajuela</field>
-			<field name = "code">ALAJ</field>
-		</record>
-
-		<record id="district_ALAJ_AALJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Alajuela</field>
-			<field name = "code">AALJ</field>
-		</record>
-		<record id="district_ALAJ_ASJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">San José</field>
-			<field name = "code">ASJ</field>
-		</record>
-		<record id="district_ALAJ_ACAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Carrizal</field>
-			<field name = "code">ACAR</field>
-		</record>
-		<record id="district_ALAJ_ASA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">San Antonio</field>
-			<field name = "code">ASA</field>
-		</record>
-		<record id="district_ALAJ_GUAC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Guácima</field>
-			<field name = "code">GUAC</field>
-		</record>
-		<record id="district_ALAJ_ASI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">ASI</field>
-		</record>
-		<record id="district_ALAJ_ASAB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Sabanilla</field>
-			<field name = "code">ASAB</field>
-		</record>
-		<record id="district_ALAJ_ASR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">ASR</field>
-		</record>
-		<record id="district_ALAJ_ARS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Río Segundo</field>
-			<field name = "code">ARS</field>
-		</record>
-		<record id="district_ALAJ_ADES" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Desamparados</field>
-			<field name = "code">ADES</field>
-		</record>
-		<record id="district_ALAJ_ATU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Turrúcares</field>
-			<field name = "code">ATU</field>
-		</record>
-		<record id="district_ALAJ_ATAM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Tambor</field>
-			<field name = "code">ATAM</field>
-		</record>
-		<record id="district_ALAJ_GARI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Garita</field>
-			<field name = "code">GARI</field>
-		</record>
-		<record id="district_ALAJ_ASAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALAJ"/>
-			<field name="name">Sarapiquí</field>
-			<field name = "code">ASAR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of San Ramón
-		===============================
-		-->
-		<record id="canton_A_SANR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">San Ramón</field>
-			<field name = "code">SANR</field>
-		</record>
-
-		<record id="district_SANR_SASR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">San Ramón</field>
-			<field name = "code">SASR</field>
-		</record>
-		<record id="district_SANR_SSAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Santiago</field>
-			<field name = "code">SSAN</field>
-		</record>
-		<record id="district_SANR_AJU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">San Juan</field>
-			<field name = "code">AJU</field>
-		</record>
-		<record id="district_SANR_SRPN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Piedades Norte</field>
-			<field name = "code">SRPN</field>
-		</record>
-		<record id="district_SANR_PS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Piedades Sur</field>
-			<field name = "code">PS</field>
-		</record>
-		<record id="district_SANR_SSR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">SSR</field>
-		</record>
-		<record id="district_SANR_SSI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">SSI</field>
-		</record>
-		<record id="district_SANR_SANG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Ángeles</field>
-			<field name = "code">SANG</field>
-		</record>
-		<record id="district_SANR_ALF" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Álfaro</field>
-			<field name = "code">ALF</field>
-		</record>
-		<record id="district_SANR_VOLI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Volio</field>
-			<field name = "code">VOLI</field>
-		</record>
-		<record id="district_SANR_CONC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Concepción</field>
-			<field name = "code">CONC</field>
-		</record>
-		<record id="district_SANR_ZAPO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Zapotal</field>
-			<field name = "code">ZAPO</field>
-		</record>
-		<record id="district_SANR_PB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_SANR"/>
-			<field name="name">Peñas Blancas</field>
-			<field name = "code">PB</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Grecia
-		===============================
-		-->
-		<record id="canton_A_GRE" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Grecia</field>
-			<field name = "code">GRE</field>
-		</record>
-
-		<record id="district_GRE_GGRE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GRE"/>
-			<field name="name">Grecia</field>
-			<field name = "code">GGRE</field>
-		</record>
-		<record id="district_GRE_GSI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GRE"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">GSI</field>
-		</record>
-		<record id="district_GRE_GSJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GRE"/>
-			<field name="name">San José</field>
-			<field name = "code">GSJ</field>
-		</record>
-		<record id="district_GRE_STRO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GRE"/>
-			<field name="name">San Roque</field>
-			<field name = "code">STRO</field>
-		</record>
-		<record id="district_GRE_TAC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GRE"/>
-			<field name="name">Tacares</field>
-			<field name = "code">TAC</field>
-		</record>
-		<record id="district_GRE_RC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GRE"/>
-			<field name="name">Río Cuarto</field>
-			<field name = "code">RC</field>
-		</record>
-		<record id="district_GRE_PDP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GRE"/>
-			<field name="name">Puente de Piedra</field>
-			<field name = "code">PDP</field>
-		</record>
-		<record id="district_GRE_BOL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GRE"/>
-			<field name="name">Bolívar</field>
-			<field name = "code">BOL</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of San Mateo
-		===============================
-		-->
-		<record id="canton_A_STMA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">San Mateo</field>
-			<field name = "code">STMA</field>
-		</record>
-
-		<record id="district_STMA_SMA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STMA"/>
-			<field name="name">San Mateo</field>
-			<field name = "code">SMA</field>
-		</record>
-		<record id="district_STMA_DESM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STMA"/>
-			<field name="name">Desmonte</field>
-			<field name = "code">DESM</field>
-		</record>
-		<record id="district_STMA_JM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STMA"/>
-			<field name="name">Jesús María</field>
-			<field name = "code">JM</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Atenas
-		===============================
-		-->
-		<record id="canton_A_ATE" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Atenas</field>
-			<field name = "code">ATE</field>
-		</record>
-
-		<record id="district_ATE_AATE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ATE"/>
-			<field name="name">Atenas</field>
-			<field name = "code">AATE</field>
-		</record>
-		<record id="district_ATE_AJE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ATE"/>
-			<field name="name">Jesús</field>
-			<field name = "code">AJE</field>
-		</record>
-		<record id="district_ATE_MERC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ATE"/>
-			<field name="name">Mercedes</field>
-			<field name = "code">MERC</field>
-		</record>
-		<record id="district_ATE_ATSI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ATE"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">ATSI</field>
-		</record>
-		<record id="district_ATE_ACON" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ATE"/>
-			<field name="name">Concepción</field>
-			<field name = "code">ACON</field>
-		</record>
-		<record id="district_ATE_ATSJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ATE"/>
-			<field name="name">San José</field>
-			<field name = "code">ATSJ</field>
-		</record>
-		<record id="district_ATE_SE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ATE"/>
-			<field name="name">Santa Eulalia</field>
-			<field name = "code">SE</field>
-		</record>
-		<record id="district_ATE_ESCO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ATE"/>
-			<field name="name">Escobal</field>
-			<field name = "code">ESCO</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Naranjo
-		===============================
-		-->
-		<record id="canton_A_NAR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Naranjo</field>
-			<field name = "code">NAR</field>
-		</record>
-
-		<record id="district_NAR_NNAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_NAR"/>
-			<field name="name">Naranjo</field>
-			<field name = "code">NNAR</field>
-		</record>
-		<record id="district_NAR_NSM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_NAR"/>
-			<field name="name">San Miguel</field>
-			<field name = "code">NSM</field>
-		</record>
-		<record id="district_NAR_NSJO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_NAR"/>
-			<field name="name">San José</field>
-			<field name = "code">NSJO</field>
-		</record>
-		<record id="district_NAR_CS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_NAR"/>
-			<field name="name">Cirrí Sur</field>
-			<field name = "code">CS</field>
-		</record>
-		<record id="district_NAR_NSJE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_NAR"/>
-			<field name="name">San Jerónimo</field>
-			<field name = "code">NSJE</field>
-		</record>
-		<record id="district_NAR_NSJU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_NAR"/>
-			<field name="name">San Juan</field>
-			<field name = "code">NSJU</field>
-		</record>
-		<record id="district_NAR_ROSA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_NAR"/>
-			<field name="name">Rosario</field>
-			<field name = "code">ROSA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Palmares
-		===============================
-		-->
-		<record id="canton_A_PAL" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Palmares</field>
-			<field name = "code">PAL</field>
-		</record>
-
-		<record id="district_PAL_PALM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_PAL"/>
-			<field name="name">Palmares</field>
-			<field name = "code">PALM</field>
-		</record>
-		<record id="district_PAL_ZARA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_PAL"/>
-			<field name="name">Zaragoza</field>
-			<field name = "code">ZARA</field>
-		</record>
-		<record id="district_PAL_BA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_PAL"/>
-			<field name="name">Buenos Aires</field>
-			<field name = "code">BA</field>
-		</record>
-		<record id="district_PAL_PSA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_PAL"/>
-			<field name="name">Santiago</field>
-			<field name = "code">PSA</field>
-		</record>
-		<record id="district_PAL_PCAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_PAL"/>
-			<field name="name">Candelaria</field>
-			<field name = "code">PCAN</field>
-		</record>
-		<record id="district_PAL_ESQ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_PAL"/>
-			<field name="name">Esquipulas</field>
-			<field name = "code">ESQ</field>
-		</record>
-		<record id="district_PAL_LGR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_PAL"/>
-			<field name="name">La Granja</field>
-			<field name = "code">LGR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Poás
-		===============================
-		-->
-		<record id="canton_A_POA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Poás</field>
-			<field name = "code">POA</field>
-		</record>
-
-		<record id="district_POA_PSP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_POA"/>
-			<field name="name">San Pedro</field>
-			<field name = "code">PSP</field>
-		</record>
-		<record id="district_POA_PSJU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_POA"/>
-			<field name="name">San Juan</field>
-			<field name = "code">PSJU</field>
-		</record>
-		<record id="district_POA_PSRA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_POA"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">PSRA</field>
-		</record>
-		<record id="district_POA_PCAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_POA"/>
-			<field name="name">Carrillos</field>
-			<field name = "code">PCAR</field>
-		</record>
-		<record id="district_POA_SR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_POA"/>
-			<field name="name">Sabana Redonda</field>
-			<field name = "code">SR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Orotina
-		===============================
-		-->
-		<record id="canton_A_ORO" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Orotina</field>
-			<field name = "code">ORO</field>
-		</record>
-
-		<record id="district_ORO_OORO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ORO"/>
-			<field name="name">Orotina</field>
-			<field name = "code">OORO</field>
-		</record>
-		<record id="district_ORO_MAS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ORO"/>
-			<field name="name">Mastate</field>
-			<field name = "code">MAS</field>
-		</record>
-		<record id="district_ORO_HV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ORO"/>
-			<field name="name">Hacienda Vieja</field>
-			<field name = "code">HV</field>
-		</record>
-		<record id="district_ORO_COY" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ORO"/>
-			<field name="name">Coyolar</field>
-			<field name = "code">COY</field>
-		</record>
-		<record id="district_ORO_CEI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ORO"/>
-			<field name="name">Ceiba</field>
-			<field name = "code">CEI</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of San Carlos
-		===============================
-		-->
-		<record id="canton_A_STCA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">San Carlos</field>
-			<field name = "code">STCA</field>
-		</record>
-
-		<record id="district_STCA_QUE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Quesada</field>
-			<field name = "code">QUE</field>
-		</record>
-		<record id="district_STCA_FLO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Florencia</field>
-			<field name = "code">FLO</field>
-		</record>
-		<record id="district_STCA_BUEN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Buenavista</field>
-			<field name = "code">BUEN</field>
-		</record>
-		<record id="district_STCA_AZ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Aguas Zarcas</field>
-			<field name = "code">AZ</field>
-		</record>
-		<record id="district_STCA_VEN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Venecia</field>
-			<field name = "code">VEN</field>
-		</record>
-		<record id="district_STCA_SCPI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Pital</field>
-			<field name = "code">SCPI</field>
-		</record>
-		<record id="district_STCA_FORT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Fortuna</field>
-			<field name = "code">FORT</field>
-		</record>
-		<record id="district_STCA_TIG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Tigra</field>
-			<field name = "code">TIG</field>
-		</record>
-		<record id="district_STCA_SCPA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Palmera</field>
-			<field name = "code">SCPA</field>
-		</record>
-		<record id="district_STCA_VENA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Venado</field>
-			<field name = "code">VENA</field>
-		</record>
-		<record id="district_STCA_CUT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Cutris</field>
-			<field name = "code">CUT</field>
-		</record>
-		<record id="district_STCA_MONT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Monterrey</field>
-			<field name = "code">MONT</field>
-		</record>
-		<record id="district_STCA_POCO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_STCA"/>
-			<field name="name">Pocosol</field>
-			<field name = "code">POCO</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Alfaro Ruiz
-		===============================
-		-->
-		<record id="canton_A_ALFR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Alfaro Ruiz</field>
-			<field name = "code">ALFR</field>
-		</record>
-
-		<record id="district_ALFR_ZARC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALFR"/>
-			<field name="name">Zarcero</field>
-			<field name = "code">ZARC</field>
-		</record>
-		<record id="district_ALFR_LAG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALFR"/>
-			<field name="name">Laguna</field>
-			<field name = "code">LAG</field>
-		</record>
-		<record id="district_ALFR_TAP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALFR"/>
-			<field name="name">Tapezco</field>
-			<field name = "code">TAP</field>
-		</record>
-		<record id="district_ALFR_ARGU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALFR"/>
-			<field name="name">Guadalupe</field>
-			<field name = "code">ARGU</field>
-		</record>
-		<record id="district_ALFR_ARPA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALFR"/>
-			<field name="name">Palmira</field>
-			<field name = "code">ARPA</field>
-		</record>
-		<record id="district_ALFR_ARZA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALFR"/>
-			<field name="name">Zapote</field>
-			<field name = "code">ARZA</field>
-		</record>
-		<record id="district_ALFR_BRI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_ALFR"/>
-			<field name="name">Brisas</field>
-			<field name = "code">BRI</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Valverde Vega
-		===============================
-		-->
-		<record id="canton_A_VALV" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Valverde Vega</field>
-			<field name = "code">VALV</field>
-		</record>
-
-		<record id="district_VALV_SN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_VALV"/>
-			<field name="name">Sarchí Norte</field>
-			<field name = "code">SN</field>
-		</record>
-		<record id="district_VALV_SS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_VALV"/>
-			<field name="name">Sarchí Sur</field>
-			<field name = "code">SS</field>
-		</record>
-		<record id="district_VALV_VVTA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_VALV"/>
-			<field name="name">Toro Amarillo</field>
-			<field name = "code">VVTA</field>
-		</record>
-		<record id="district_VALV_VVSP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_VALV"/>
-			<field name="name">San Pedro</field>
-			<field name = "code">VVSP</field>
-		</record>
-		<record id="district_VALV_ROD" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_VALV"/>
-			<field name="name">Rodríguez</field>
-			<field name = "code">ROD</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Upala
-		===============================
-		-->
-		<record id="canton_A_UPA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Upala</field>
-			<field name = "code">UPA</field>
-		</record>
-
-		<record id="district_UPA_UUPA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_UPA"/>
-			<field name="name">Upala</field>
-			<field name = "code">UUPA</field>
-		</record>
-		<record id="district_UPA_AC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_UPA"/>
-			<field name="name">Aguas Claras</field>
-			<field name = "code">AC</field>
-		</record>
-		<record id="district_UPA_PIZ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_UPA"/>
-			<field name="name">San José (Pizote)</field>
-			<field name = "code">PIZ</field>
-		</record>
-		<record id="district_UPA_BIJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_UPA"/>
-			<field name="name">Bijagua</field>
-			<field name = "code">BIJ</field>
-		</record>
-		<record id="district_UPA_DEL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_UPA"/>
-			<field name="name">Delicias</field>
-			<field name = "code">DEL</field>
-		</record>
-		<record id="district_UPA_DR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_UPA"/>
-			<field name="name">Dos Ríos</field>
-			<field name = "code">DR</field>
-		</record>
-		<record id="district_UPA_YOL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_UPA"/>
-			<field name="name">Yolillal</field>
-			<field name = "code">YOL</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Los Chiles
-		===============================
-		-->
-		<record id="canton_A_CHIL" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Los Chiles</field>
-			<field name = "code">CHIL</field>
-		</record>
-
-		<record id="district_CHIL_LCH" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_CHIL"/>
-			<field name="name">Los Chiles</field>
-			<field name = "code">LCH</field>
-		</record>
-		<record id="district_CHIL_CN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_CHIL"/>
-			<field name="name">Caño Negro</field>
-			<field name = "code">CN</field>
-		</record>
-		<record id="district_CHIL_EA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_CHIL"/>
-			<field name="name">El Amparo</field>
-			<field name = "code">EA</field>
-		</record>
-		<record id="district_CHIL_STJO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_CHIL"/>
-			<field name="name">San Jorge</field>
-			<field name = "code">STJO</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Guatuso
-		===============================
-		-->
-		<record id="canton_A_GUA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_A"/>
-			<field name="name">Guatuso</field>
-			<field name = "code">GUA</field>
-		</record>
-
-		<record id="district_GUA_GSR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GUA"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">GSR</field>
-		</record>
-		<record id="district_GUA_BUE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GUA"/>
-			<field name="name">Buenavista</field>
-			<field name = "code">BUE</field>
-		</record>
-		<record id="district_GUA_COTE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_A_GUA"/>
-			<field name="name">Cote</field>
-			<field name = "code">COTE</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Cartago
-		===============================
-		-->
-		<record id="canton_C_CART" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_C"/>
-			<field name="name">Cartago</field>
-			<field name = "code">CART</field>
-		</record>
-
-		<record id="district_CART_ORI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Oriental</field>
-			<field name = "code">ORI</field>
-		</record>
-		<record id="district_CART_OCC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Occidental</field>
-			<field name = "code">OCC</field>
-		</record>
-		<record id="district_CART_CCAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Carmen</field>
-			<field name = "code">CCAR</field>
-		</record>
-		<record id="district_CART_STNI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">San Nicolás</field>
-			<field name = "code">STNI</field>
-		</record>
-		<record id="district_CART_AGUA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Aguacaliente (San Francisco)</field>
-			<field name = "code">AGUA</field>
-		</record>
-		<record id="district_CART_GUA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Guadalupe (Arenilla)</field>
-			<field name = "code">GUA</field>
-		</record>
-		<record id="district_CART_CORR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Corralillo</field>
-			<field name = "code">CORR</field>
-		</record>
-		<record id="district_CART_TB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Tierra Blanca</field>
-			<field name = "code">TB</field>
-		</record>
-		<record id="district_CART_DN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Dulce Nombre</field>
-			<field name = "code">DN</field>
-		</record>
-		<record id="district_CART_LLG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Llano Grande</field>
-			<field name = "code">LLG</field>
-		</record>
-		<record id="district_CART_QUEB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_CART"/>
-			<field name="name">Quebradilla</field>
-			<field name = "code">QUEB</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Paraíso
-		===============================
-		-->
-		<record id="canton_C_PARA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_C"/>
-			<field name="name">Paraíso</field>
-			<field name = "code">PARA</field>
-		</record>
-
-		<record id="district_PARA_PAPR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_PARA"/>
-			<field name="name">Paraíso</field>
-			<field name = "code">PAPR</field>
-		</record>
-		<record id="district_PARA_PSAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_PARA"/>
-			<field name="name">Santiago</field>
-			<field name = "code">PSAN</field>
-		</record>
-		<record id="district_PARA_ORO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_PARA"/>
-			<field name="name">Orosi</field>
-			<field name = "code">ORO</field>
-		</record>
-		<record id="district_PARA_CAC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_PARA"/>
-			<field name="name">Cachí</field>
-			<field name = "code">CAC</field>
-		</record>
-		<record id="district_PARA_LLSL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_PARA"/>
-			<field name="name">Llanos de Santa Lucía</field>
-			<field name = "code">LLSL</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of La Unión
-		===============================
-		-->
-		<record id="canton_C_UNI" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_C"/>
-			<field name="name">La Unión</field>
-			<field name = "code">UNI</field>
-		</record>
-
-		<record id="district_UNI_TR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_UNI"/>
-			<field name="name">Tres Ríos</field>
-			<field name = "code">TR</field>
-		</record>
-		<record id="district_UNI_STDI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_UNI"/>
-			<field name="name">San Diego</field>
-			<field name = "code">STDI</field>
-		</record>
-		<record id="district_UNI_LUSJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_UNI"/>
-			<field name="name">San Juan</field>
-			<field name = "code">LUSJ</field>
-		</record>
-		<record id="district_UNI_LUSR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_UNI"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">LUSR</field>
-		</record>
-		<record id="district_UNI_LUCO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_UNI"/>
-			<field name="name">Concepción</field>
-			<field name = "code">LUCO</field>
-		</record>
-		<record id="district_UNI_LUDN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_UNI"/>
-			<field name="name">Dulce Nombre</field>
-			<field name = "code">LUDN</field>
-		</record>
-		<record id="district_UNI_LURA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_UNI"/>
-			<field name="name">San Ramón</field>
-			<field name = "code">LURA</field>
-		</record>
-		<record id="district_UNI_RA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_UNI"/>
-			<field name="name">Río Azul</field>
-			<field name = "code">RA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Jiménez
-		===============================
-		-->
-		<record id="canton_C_JIM" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_C"/>
-			<field name="name">Jiménez</field>
-			<field name = "code">JIM</field>
-		</record>
-
-		<record id="district_JIM_JV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_JIM"/>
-			<field name="name">Juan Viñas</field>
-			<field name = "code">JV</field>
-		</record>
-		<record id="district_JIM_TUC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_JIM"/>
-			<field name="name">Tucurrique</field>
-			<field name = "code">TUC</field>
-		</record>
-		<record id="district_JIM_PEJI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_JIM"/>
-			<field name="name">Pejibaye</field>
-			<field name = "code">PEJI</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Turrialba
-		===============================
-		-->
-		<record id="canton_C_TURR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_C"/>
-			<field name="name">Turrialba</field>
-			<field name = "code">TURR</field>
-		</record>
-
-		<record id="district_TURR_TTURR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Turrialba</field>
-			<field name = "code">TTURR</field>
-		</record>
-		<record id="district_TURR_LS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">La Suiza</field>
-			<field name = "code">LS</field>
-		</record>
-		<record id="district_TURR_PER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Peralta</field>
-			<field name = "code">PER</field>
-		</record>
-		<record id="district_TURR_STCU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Santa Cruz</field>
-			<field name = "code">STCU</field>
-		</record>
-		<record id="district_TURR_STTE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Santa Teresita</field>
-			<field name = "code">STTE</field>
-		</record>
-		<record id="district_TURR_TPAV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Pavones</field>
-			<field name = "code">TPAV</field>
-		</record>
-		<record id="district_TURR_TUIS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Tuis</field>
-			<field name = "code">TUIS</field>
-		</record>
-		<record id="district_TURR_TAY" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Tayutic</field>
-			<field name = "code">TAY</field>
-		</record>
-		<record id="district_TURR_TSTR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Santa Rosa</field>
-			<field name = "code">TSTR</field>
-		</record>
-		<record id="district_TURR_TE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Tres Equis</field>
-			<field name = "code">TE</field>
-		</record>
-		<record id="district_TURR_LI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">La Isabel</field>
-			<field name = "code">LI</field>
-		</record>
-		<record id="district_TURR_CHIR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_TURR"/>
-			<field name="name">Chirripó</field>
-			<field name = "code">CHIR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Alvarado
-		===============================
-		-->
-		<record id="canton_C_ALV" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_C"/>
-			<field name="name">Alvarado</field>
-			<field name = "code">ALV</field>
-		</record>
-
-		<record id="district_ALV_PAC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_ALV"/>
-			<field name="name">Pacayas</field>
-			<field name = "code">PAC</field>
-		</record>
-		<record id="district_ALV_CER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_ALV"/>
-			<field name="name">Cervantes</field>
-			<field name = "code">CER</field>
-		</record>
-		<record id="district_ALV_CAP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_ALV"/>
-			<field name="name">Capellades</field>
-			<field name = "code">CAP</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Oreamuno
-		===============================
-		-->
-		<record id="canton_C_ORE" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_C"/>
-			<field name="name">Oreamuno</field>
-			<field name = "code">ORE</field>
-		</record>
-
-		<record id="district_ORE_OSR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_ORE"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">OSR</field>
-		</record>
-		<record id="district_ORE_COT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_ORE"/>
-			<field name="name">Cot</field>
-			<field name = "code">COT</field>
-		</record>
-		<record id="district_ORE_OPC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_ORE"/>
-			<field name="name">Potrero Cerrado</field>
-			<field name = "code">OPC</field>
-		</record>
-		<record id="district_ORE_CIP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_ORE"/>
-			<field name="name">Cipreses</field>
-			<field name = "code">CIP</field>
-		</record>
-		<record id="district_ORE_OSRO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_ORE"/>
-			<field name="name">Santa Rosa</field>
-			<field name = "code">OSRO</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of El Guarco
-		===============================
-		-->
-		<record id="canton_C_GUAR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_C"/>
-			<field name="name">El Guarco</field>
-			<field name = "code">GUAR</field>
-		</record>
-
-		<record id="district_GUAR_TEJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_GUAR"/>
-			<field name="name">Tejar</field>
-			<field name = "code">TEJ</field>
-		</record>
-		<record id="district_GUAR_ELSI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_GUAR"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">ELSI</field>
-		</record>
-		<record id="district_GUAR_TOB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_GUAR"/>
-			<field name="name">Tobosi</field>
-			<field name = "code">TOB</field>
-		</record>
-		<record id="district_GUAR_PDA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_C_GUAR"/>
-			<field name="name">Patio de Agua</field>
-			<field name = "code">PDA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Liberia
-		===============================
-		-->
-		<record id="canton_G_LIB" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Liberia</field>
-			<field name = "code">LIB</field>
-		</record>
-
-		<record id="district_LIB_LLIB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LIB"/>
-			<field name="name">Liberia</field>
-			<field name = "code">LLIB</field>
-		</record>
-		<record id="district_LIB_CD" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LIB"/>
-			<field name="name">Cañas Dulces</field>
-			<field name = "code">CD</field>
-		</record>
-		<record id="district_LIB_MAY" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LIB"/>
-			<field name="name">Mayorga</field>
-			<field name = "code">MAY</field>
-		</record>
-		<record id="district_LIB_NAC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LIB"/>
-			<field name="name">Nacascolo</field>
-			<field name = "code">NAC</field>
-		</record>
-		<record id="district_LIB_CURU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LIB"/>
-			<field name="name">Curubandé</field>
-			<field name = "code">CURU</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Nicoya
-		===============================
-		-->
-		<record id="canton_G_NICO" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Nicoya</field>
-			<field name = "code">NICO</field>
-		</record>
-
-		<record id="district_NICO_NNIC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NICO"/>
-			<field name="name">Nicoya</field>
-			<field name = "code">NNIC</field>
-		</record>
-		<record id="district_NICO_MAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NICO"/>
-			<field name="name">Mansión</field>
-			<field name = "code">MAN</field>
-		</record>
-		<record id="district_NICO_NSA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NICO"/>
-			<field name="name">San Antonio</field>
-			<field name = "code">NSA</field>
-		</record>
-		<record id="district_NICO_QH" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NICO"/>
-			<field name="name">Quebrada Honda</field>
-			<field name = "code">QH</field>
-		</record>
-		<record id="district_NICO_SAM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NICO"/>
-			<field name="name">Sámara</field>
-			<field name = "code">SAM</field>
-		</record>
-		<record id="district_NICO_NOS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NICO"/>
-			<field name="name">Nosara</field>
-			<field name = "code">NOS</field>
-		</record>
-		<record id="district_NICO_BDN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NICO"/>
-			<field name="name">Belén de Nosarita</field>
-			<field name = "code">BDN</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Santa Cruz
-		===============================
-		-->
-		<record id="canton_G_STCU" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Santa Cruz</field>
-			<field name = "code">STCU</field>
-		</record>
-
-		<record id="district_STCU_SCSC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Santa Cruz</field>
-			<field name = "code">SCSC</field>
-		</record>
-		<record id="district_STCU_BOLS" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Bolsón</field>
-			<field name = "code">BOLS</field>
-		</record>
-		<record id="district_STCU_VDA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Veintisiete de Abril</field>
-			<field name = "code">VDA</field>
-		</record>
-		<record id="district_STCU_TEM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Tempate</field>
-			<field name = "code">TEM</field>
-		</record>
-		<record id="district_STCU_CART" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Cartagena</field>
-			<field name = "code">CART</field>
-		</record>
-		<record id="district_STCU_CUA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Cuajiniquil</field>
-			<field name = "code">CUA</field>
-		</record>
-		<record id="district_STCU_DIR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Diriá</field>
-			<field name = "code">DIR</field>
-		</record>
-		<record id="district_STCU_CV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Cabo Velas</field>
-			<field name = "code">CV</field>
-		</record>
-		<record id="district_STCU_TAM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_STCU"/>
-			<field name="name">Tamarindo</field>
-			<field name = "code">TAM</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Bagaces
-		===============================
-		-->
-		<record id="canton_G_BAG" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Bagaces</field>
-			<field name = "code">BAG</field>
-		</record>
-
-		<record id="district_BAG_BAG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_BAG"/>
-			<field name="name">Bagaces</field>
-			<field name = "code">BAG</field>
-		</record>
-		<record id="district_BAG_FOR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_BAG"/>
-			<field name="name">Fortuna</field>
-			<field name = "code">FOR</field>
-		</record>
-		<record id="district_BAG_MOG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_BAG"/>
-			<field name="name">Mogote</field>
-			<field name = "code">MOG</field>
-		</record>
-		<record id="district_BAG_BRN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_BAG"/>
-			<field name="name">Río Naranjo</field>
-			<field name = "code">BRN</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Carrillo
-		===============================
-		-->
-		<record id="canton_G_CARR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Carrillo</field>
-			<field name = "code">CARR</field>
-		</record>
-
-		<record id="district_CARR_FIL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CARR"/>
-			<field name="name">Filadelfia</field>
-			<field name = "code">FIL</field>
-		</record>
-		<record id="district_CARR_CAPA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CARR"/>
-			<field name="name">Palmira</field>
-			<field name = "code">CAPA</field>
-		</record>
-		<record id="district_CARR_SAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CARR"/>
-			<field name="name">Sardinal</field>
-			<field name = "code">SAR</field>
-		</record>
-		<record id="district_CARR_CBEL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CARR"/>
-			<field name="name">Belén</field>
-			<field name = "code">CBEL</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Cañas
-		===============================
-		-->
-		<record id="canton_G_CANA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Cañas</field>
-			<field name = "code">CANA</field>
-		</record>
-
-		<record id="district_CANA_CCAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CANA"/>
-			<field name="name">Cañas</field>
-			<field name = "code">CCAN</field>
-		</record>
-		<record id="district_CANA_CPAL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CANA"/>
-			<field name="name">Palmira</field>
-			<field name = "code">CPAL</field>
-		</record>
-		<record id="district_CANA_CSM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CANA"/>
-			<field name="name">San Miguel</field>
-			<field name = "code">CSM</field>
-		</record>
-		<record id="district_CANA_BEB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CANA"/>
-			<field name="name">Bebedero</field>
-			<field name = "code">BEB</field>
-		</record>
-		<record id="district_CANA_POR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_CANA"/>
-			<field name="name">Porozal</field>
-			<field name = "code">POR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Abangares
-		===============================
-		-->
-		<record id="canton_G_ABA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Abangares</field>
-			<field name = "code">ABA</field>
-		</record>
-
-		<record id="district_ABA_JUN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_ABA"/>
-			<field name="name">Juntas</field>
-			<field name = "code">JUN</field>
-		</record>
-		<record id="district_ABA_SIE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_ABA"/>
-			<field name="name">Sierra</field>
-			<field name = "code">SIE</field>
-		</record>
-		<record id="district_ABA_ABSU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_ABA"/>
-			<field name="name">San Juan</field>
-			<field name = "code">ABSU</field>
-		</record>
-		<record id="district_ABA_COLO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_ABA"/>
-			<field name="name">Colorado</field>
-			<field name = "code">COLO</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Tilarán
-		===============================
-		-->
-		<record id="canton_G_TIL" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Tilarán</field>
-			<field name = "code">TIL</field>
-		</record>
-
-		<record id="district_TIL_TILA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_TIL"/>
-			<field name="name">Tilarán</field>
-			<field name = "code">TILA</field>
-		</record>
-		<record id="district_TIL_QG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_TIL"/>
-			<field name="name">Quebrada Grande</field>
-			<field name = "code">QG</field>
-		</record>
-		<record id="district_TIL_TRO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_TIL"/>
-			<field name="name">Tronadora</field>
-			<field name = "code">TRO</field>
-		</record>
-		<record id="district_TIL_TISR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_TIL"/>
-			<field name="name">Santa Rosa</field>
-			<field name = "code">TISR</field>
-		</record>
-		<record id="district_TIL_LIBA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_TIL"/>
-			<field name="name">Líbano</field>
-			<field name = "code">LIBA</field>
-		</record>
-		<record id="district_TIL_TM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_TIL"/>
-			<field name="name">Tierras Morenas</field>
-			<field name = "code">TM</field>
-		</record>
-		<record id="district_TIL_ARE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_TIL"/>
-			<field name="name">Arenal</field>
-			<field name = "code">ARE</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Nandayure
-		===============================
-		-->
-		<record id="canton_G_NAN" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Nandayure</field>
-			<field name = "code">NAN</field>
-		</record>
-
-		<record id="district_NAN_CARM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NAN"/>
-			<field name="name">Carmona</field>
-			<field name = "code">CARM</field>
-		</record>
-		<record id="district_NAN_STRI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NAN"/>
-			<field name="name">Santa Rita</field>
-			<field name = "code">STRI</field>
-		</record>
-		<record id="district_NAN_NAZA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NAN"/>
-			<field name="name">Zapotal</field>
-			<field name = "code">NAZA</field>
-		</record>
-		<record id="district_NAN_NASP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NAN"/>
-			<field name="name">San Pablo</field>
-			<field name = "code">NASP</field>
-		</record>
-		<record id="district_NAN_PORV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NAN"/>
-			<field name="name">Porvenir</field>
-			<field name = "code">PORV</field>
-		</record>
-		<record id="district_NAN_BEJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_NAN"/>
-			<field name="name">Bejuco</field>
-			<field name = "code">BEJ</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of La Cruz
-		===============================
-		-->
-		<record id="canton_G_LCR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">La Cruz</field>
-			<field name = "code">LCR</field>
-		</record>
-
-		<record id="district_LCR_LCLC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LCR"/>
-			<field name="name">La Cruz</field>
-			<field name = "code">LCLC</field>
-		</record>
-		<record id="district_LCR_STCE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LCR"/>
-			<field name="name">Santa Cecilia</field>
-			<field name = "code">STCE</field>
-		</record>
-		<record id="district_LCR_LCGA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LCR"/>
-			<field name="name">Garita</field>
-			<field name = "code">LCGA</field>
-		</record>
-		<record id="district_LCR_LCSE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_LCR"/>
-			<field name="name">Santa Elena</field>
-			<field name = "code">LCSE</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Hojancha
-		===============================
-		-->
-		<record id="canton_G_HOJ" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_G"/>
-			<field name="name">Hojancha</field>
-			<field name = "code">HOJ</field>
-		</record>
-
-		<record id="district_HOJ_HOHO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_HOJ"/>
-			<field name="name">Hojancha</field>
-			<field name = "code">HOHO</field>
-		</record>
-		<record id="district_HOJ_HOMR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_HOJ"/>
-			<field name="name">Monte Romo</field>
-			<field name = "code">HOMR</field>
-		</record>
-		<record id="district_HOJ_PC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_HOJ"/>
-			<field name="name">Puerto Carrillo</field>
-			<field name = "code">PC</field>
-		</record>
-		<record id="district_HOJ_HUA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_G_HOJ"/>
-			<field name="name">Huacas</field>
-			<field name = "code">HUA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Puntarenas
-		===============================
-		-->
-		<record id="canton_P_PUNT" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Puntarenas</field>
-			<field name = "code">PUNT</field>
-		</record>
-
-		<record id="district_PUNT_PUN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Puntarenas</field>
-			<field name = "code">PUN</field>
-		</record>
-		<record id="district_PUNT_PITA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Pitahaya</field>
-			<field name = "code">PITA</field>
-		</record>
-		<record id="district_PUNT_CHO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Chomes</field>
-			<field name = "code">CHO</field>
-		</record>
-		<record id="district_PUNT_LEP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Lepanto</field>
-			<field name = "code">LEP</field>
-		</record>
-		<record id="district_PUNT_PAQ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Paquera</field>
-			<field name = "code">PAQ</field>
-		</record>
-		<record id="district_PUNT_MANZ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Manzanillo</field>
-			<field name = "code">MANZ</field>
-		</record>
-		<record id="district_PUNT_PGUA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Guacimal</field>
-			<field name = "code">PGUA</field>
-		</record>
-		<record id="district_PUNT_BARR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Barranca</field>
-			<field name = "code">BARR</field>
-		</record>
-		<record id="district_PUNT_MTVE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Monteverde</field>
-			<field name = "code">MTVE</field>
-		</record>
-		<record id="district_PUNT_IDC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Isla del Coco</field>
-			<field name = "code">IDC</field>
-		</record>
-		<record id="district_PUNT_COB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Cóbano</field>
-			<field name = "code">COB</field>
-		</record>
-		<record id="district_PUNT_CHA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Chacarita</field>
-			<field name = "code">CHA</field>
-		</record>
-		<record id="district_PUNT_PCHI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Chira</field>
-			<field name = "code">PCHI</field>
-		</record>
-		<record id="district_PUNT_ACA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Acapulco</field>
-			<field name = "code">ACA</field>
-		</record>
-		<record id="district_PUNT_ER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">El Roble</field>
-			<field name = "code">ER</field>
-		</record>
-		<record id="district_PUNT_ARA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PUNT"/>
-			<field name="name">Arancibia</field>
-			<field name = "code">ARA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Esparza
-		===============================
-		-->
-		<record id="canton_P_ESP" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Esparza</field>
-			<field name = "code">ESP</field>
-		</record>
-
-		<record id="district_ESP_ES" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_ESP"/>
-			<field name="name">Espíritu Santo</field>
-			<field name = "code">ES</field>
-		</record>
-		<record id="district_ESP_SJG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_ESP"/>
-			<field name="name">San Juan Grande</field>
-			<field name = "code">SJG</field>
-		</record>
-		<record id="district_ESP_MAC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_ESP"/>
-			<field name="name">Macacona</field>
-			<field name = "code">MAC</field>
-		</record>
-		<record id="district_ESP_ESSR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_ESP"/>
-			<field name="name">San Rafael</field>
-			<field name = "code">ESSR</field>
-		</record>
-		<record id="district_ESP_ESSJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_ESP"/>
-			<field name="name">San Jerónimo</field>
-			<field name = "code">ESSJ</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Buenos Aires
-		===============================
-		-->
-		<record id="canton_P_BA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Buenos Aires</field>
-			<field name = "code">BA</field>
-		</record>
-
-		<record id="district_BA_BAB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Buenos Aires</field>
-			<field name = "code">BAB</field>
-		</record>
-		<record id="district_BA_VOL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Volcán</field>
-			<field name = "code">VOL</field>
-		</record>
-		<record id="district_BA_PG" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Potrero Grande</field>
-			<field name = "code">PG</field>
-		</record>
-		<record id="district_BA_BOR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Boruca</field>
-			<field name = "code">BOR</field>
-		</record>
-		<record id="district_BA_PIL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Pilas</field>
-			<field name = "code">PIL</field>
-		</record>
-		<record id="district_BA_BNCO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Colinas</field>
-			<field name = "code">BNCO</field>
-		</record>
-		<record id="district_BA_CHAN" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Chánguena</field>
-			<field name = "code">CHAN</field>
-		</record>
-		<record id="district_BA_BIO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Biolley</field>
-			<field name = "code">BIO</field>
-		</record>
-		<record id="district_BA_BRU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_BA"/>
-			<field name="name">Brunka</field>
-			<field name = "code">BRU</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Montes de Oro
-		===============================
-		-->
-		<record id="canton_P_MDOR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Montes de Oro</field>
-			<field name = "code">MDOR</field>
-		</record>
-
-		<record id="district_MDOR_MIR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_MDOR"/>
-			<field name="name">Miramar</field>
-			<field name = "code">MIR</field>
-		</record>
-		<record id="district_MDOR_UNI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_MDOR"/>
-			<field name="name">Unión</field>
-			<field name = "code">UNI</field>
-		</record>
-		<record id="district_MDOR_MOSI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_MDOR"/>
-			<field name="name">San Isidro</field>
-			<field name = "code">MOSI</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Osa
-		===============================
-		-->
-		<record id="canton_P_OSA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Osa</field>
-			<field name = "code">OSA</field>
-		</record>
-
-		<record id="district_OSA_PCOR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_OSA"/>
-			<field name="name">Puerto Cortés</field>
-			<field name = "code">PCOR</field>
-		</record>
-		<record id="district_OSA_OPAL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_OSA"/>
-			<field name="name">Palmar</field>
-			<field name = "code">OPAL</field>
-		</record>
-		<record id="district_OSA_SIER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_OSA"/>
-			<field name="name">Sierpe</field>
-			<field name = "code">SIER</field>
-		</record>
-		<record id="district_OSA_BB" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_OSA"/>
-			<field name="name">Bahía Ballena</field>
-			<field name = "code">BB</field>
-		</record>
-		<record id="district_OSA_PBL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_OSA"/>
-			<field name="name">Piedras Blancas</field>
-			<field name = "code">PBL</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Aguirre
-		===============================
-		-->
-		<record id="canton_P_AGU" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Aguirre</field>
-			<field name = "code">AGU</field>
-		</record>
-
-		<record id="district_AGU_QUEP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_AGU"/>
-			<field name="name">Quepos</field>
-			<field name = "code">QUEP</field>
-		</record>
-		<record id="district_AGU_SAV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_AGU"/>
-			<field name="name">Savegre</field>
-			<field name = "code">SAV</field>
-		</record>
-		<record id="district_AGU_NARA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_AGU"/>
-			<field name="name">Naranjito</field>
-			<field name = "code">NARA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Golfito
-		===============================
-		-->
-		<record id="canton_P_GOL" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Golfito</field>
-			<field name = "code">GOL</field>
-		</record>
-
-		<record id="district_GOL_GOLF" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_GOL"/>
-			<field name="name">Golfito</field>
-			<field name = "code">GOLF</field>
-		</record>
-		<record id="district_GOL_PJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_GOL"/>
-			<field name="name">Puerto Jiménez</field>
-			<field name = "code">PJ</field>
-		</record>
-		<record id="district_GOL_GGUA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_GOL"/>
-			<field name="name">Guaycará</field>
-			<field name = "code">GGUA</field>
-		</record>
-		<record id="district_GOL_GPAV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_GOL"/>
-			<field name="name">Pavón</field>
-			<field name = "code">GPAV</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Coto Brus
-		===============================
-		-->
-		<record id="canton_P_CB" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Coto Brus</field>
-			<field name = "code">CB</field>
-		</record>
-
-		<record id="district_CB_SV" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_CB"/>
-			<field name="name">San Vito</field>
-			<field name = "code">SV</field>
-		</record>
-		<record id="district_CB_CBSA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_CB"/>
-			<field name="name">Sabalito</field>
-			<field name = "code">CBSA</field>
-		</record>
-		<record id="district_CB_AGU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_CB"/>
-			<field name="name">Aguabuena</field>
-			<field name = "code">AGU</field>
-		</record>
-		<record id="district_CB_LIM" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_CB"/>
-			<field name="name">Limoncito</field>
-			<field name = "code">LIM</field>
-		</record>
-		<record id="district_CB_PIT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_CB"/>
-			<field name="name">Pittier</field>
-			<field name = "code">PIT</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Parrita
-		===============================
-		-->
-		<record id="canton_P_PAR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Parrita</field>
-			<field name = "code">PAR</field>
-		</record>
-
-		<record id="district_PAR_PAPA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_PAR"/>
-			<field name="name">Parrita</field>
-			<field name = "code">PAPA</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Corredores
-		===============================
-		-->
-		<record id="canton_P_COR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Corredores</field>
-			<field name = "code">COR</field>
-		</record>
-
-		<record id="district_COR_COR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_COR"/>
-			<field name="name">Corredor</field>
-			<field name = "code">COR</field>
-		</record>
-		<record id="district_COR_LCU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_COR"/>
-			<field name="name">La Cuesta</field>
-			<field name = "code">LCU</field>
-		</record>
-		<record id="district_COR_CANO" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_COR"/>
-			<field name="name">Canoas</field>
-			<field name = "code">CANO</field>
-		</record>
-		<record id="district_COR_LAU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_COR"/>
-			<field name="name">Laurel</field>
-			<field name = "code">LAU</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Garabito
-		===============================
-		-->
-		<record id="canton_P_GAR" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_P"/>
-			<field name="name">Garabito</field>
-			<field name = "code">GAR</field>
-		</record>
-
-		<record id="district_GAR_JAC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_GAR"/>
-			<field name="name">Jacó</field>
-			<field name = "code">JAC</field>
-		</record>
-		<record id="district_GAR_TAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_P_GAR"/>
-			<field name="name">Tárcoles</field>
-			<field name = "code">TAR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Limón
-		===============================
-		-->
-		<record id="canton_L_LIM" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_L"/>
-			<field name="name">Limón</field>
-			<field name = "code">LIM</field>
-		</record>
-
-		<record id="district_LIM_LILI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_LIM"/>
-			<field name="name">Limón</field>
-			<field name = "code">LILI</field>
-		</record>
-		<record id="district_LIM_VLE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_LIM"/>
-			<field name="name">Valle La Estrella</field>
-			<field name = "code">VLE</field>
-		</record>
-		<record id="district_LIM_RBL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_LIM"/>
-			<field name="name">Río Blanco</field>
-			<field name = "code">RBL</field>
-		</record>
-		<record id="district_LIM_MAT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_LIM"/>
-			<field name="name">Matama</field>
-			<field name = "code">MAT</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Pococí
-		===============================
-		-->
-		<record id="canton_L_POC" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_L"/>
-			<field name="name">Pococí</field>
-			<field name = "code">POC</field>
-		</record>
-
-		<record id="district_POC_GUAP" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_POC"/>
-			<field name="name">Guápiles</field>
-			<field name = "code">GUAP</field>
-		</record>
-		<record id="district_POC_PJI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_POC"/>
-			<field name="name">Jiménez</field>
-			<field name = "code">PJI</field>
-		</record>
-		<record id="district_POC_RIT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_POC"/>
-			<field name="name">Rita</field>
-			<field name = "code">RIT</field>
-		</record>
-		<record id="district_POC_ROX" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_POC"/>
-			<field name="name">Roxana</field>
-			<field name = "code">ROX</field>
-		</record>
-		<record id="district_POC_CARI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_POC"/>
-			<field name="name">Cariari</field>
-			<field name = "code">CARI</field>
-		</record>
-		<record id="district_POC_PCOL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_POC"/>
-			<field name="name">Colorado</field>
-			<field name = "code">PCOL</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Siquirres
-		===============================
-		-->
-		<record id="canton_L_SIQ" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_L"/>
-			<field name="name">Siquirres</field>
-			<field name = "code">SIQ</field>
-		</record>
-
-		<record id="district_SIQ_SISI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_SIQ"/>
-			<field name="name">Siquirres</field>
-			<field name = "code">SISI</field>
-		</record>
-		<record id="district_SIQ_PACU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_SIQ"/>
-			<field name="name">Pacuarito</field>
-			<field name = "code">PACU</field>
-		</record>
-		<record id="district_SIQ_FL" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_SIQ"/>
-			<field name="name">Florida</field>
-			<field name = "code">FL</field>
-		</record>
-		<record id="district_SIQ_GER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_SIQ"/>
-			<field name="name">Germania</field>
-			<field name = "code">GER</field>
-		</record>
-		<record id="district_SIQ_CAI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_SIQ"/>
-			<field name="name">Cairo</field>
-			<field name = "code">CAI</field>
-		</record>
-		<record id="district_SIQ_ALE" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_SIQ"/>
-			<field name="name">Alegría</field>
-			<field name = "code">ALE</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Talamanca
-		===============================
-		-->
-		<record id="canton_L_TALA" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_L"/>
-			<field name="name">Talamanca</field>
-			<field name = "code">TALA</field>
-		</record>
-
-		<record id="district_TALA_BRAT" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_TALA"/>
-			<field name="name">Bratsi</field>
-			<field name = "code">BRAT</field>
-		</record>
-		<record id="district_TALA_SIX" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_TALA"/>
-			<field name="name">Sixaola</field>
-			<field name = "code">SIX</field>
-		</record>
-		<record id="district_TALA_CAH" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_TALA"/>
-			<field name="name">Cahuita</field>
-			<field name = "code">CAH</field>
-		</record>
-		<record id="district_TALA_TELI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_TALA"/>
-			<field name="name">Telire</field>
-			<field name = "code">TELI</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Matina
-		===============================
-		-->
-		<record id="canton_L_MAT" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_L"/>
-			<field name="name">Matina</field>
-			<field name = "code">MAT</field>
-		</record>
-
-		<record id="district_MAT_MATI" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_MAT"/>
-			<field name="name">Matina</field>
-			<field name = "code">MATI</field>
-		</record>
-		<record id="district_MAT_BATA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_MAT"/>
-			<field name="name">Batán</field>
-			<field name = "code">BATA</field>
-		</record>
-		<record id="district_MAT_MCAR" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_MAT"/>
-			<field name="name">Carrandi</field>
-			<field name = "code">MCAR</field>
-		</record>
-
-		<!--
-		===============================
-			Canton of Guácimo
-		===============================
-		-->
-		<record id="canton_L_GUAI" model="rent.canton">
-			<field name="state_id" model="res.country.state" ref="l10n_cr_base.state_L"/>
-			<field name="name">Guácimo</field>
-			<field name = "code">GUAI</field>
-		</record>
-
-		<record id="district_GUAI_GUGU" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_GUAI"/>
-			<field name="name">Guácimo</field>
-			<field name = "code">GUGU</field>
-		</record>
-		<record id="district_GUAI_GMER" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_GUAI"/>
-			<field name="name">Mercedes</field>
-			<field name = "code">GMER</field>
-		</record>
-		<record id="district_GUAI_GPOC" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_GUAI"/>
-			<field name="name">Pocora</field>
-			<field name = "code">GPOC</field>
-		</record>
-		<record id="district_GUAI_GURJ" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_GUAI"/>
-			<field name="name">Río Jiménez</field>
-			<field name = "code">GURJ</field>
-		</record>
-		<record id="district_GUAI_DUA" model="rent.canton.district">
-			<field name="canton_id" model="rent.canton" ref="canton_L_GUAI"/>
-			<field name="name">Duacarí</field>
-			<field name = "code">DUA</field>
-		</record>
 
 	</data>
 </openerp>

=== modified file 'rent/rent_view.xml'
--- rent/rent_view.xml	2012-03-23 20:42:53 +0000
+++ rent/rent_view.xml	2012-03-29 22:54:18 +0000
@@ -1,1646 +1,1455 @@
 <?xml version = "1.0" encoding = "UTF-8"?>
 <openerp>
-	<data>
-		
-		<!--
-		======================================
-				CANTON
-		======================================
-		-->
-
-        <record id="view_canton_tree" model="ir.ui.view">
-            <field name="name">rent.canton.tree</field>
-            <field name="model">rent.canton</field>
-            <field name="type">tree</field>
-            <field name="arch" type="xml">
-                <tree string="Canton">
-                    <field name="name"/>
-                    <field name="code"/>
-                    <field name="state_id"/>
-                </tree>
-            </field>
-        </record>
-
-        <record id="view_canton_form" model="ir.ui.view">
-            <field name="name">rent.canton.form</field>
-            <field name="model">rent.canton</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <form string="Canton">
-                    <field name="state_id" select="1"/>
-                    <field name="name" select="1"/>
-                    <field name="code" select="1"/>
-                </form>
-            </field>
-        </record>
-
-        <record id="action_canton" model="ir.actions.act_window">
-            <field name="name">Canton</field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">rent.canton</field>
-            <field name="view_type">form</field>
-            <field name="view_id" ref="view_canton_tree"/>
-            <field name="help">If you are working on the Costa Rican market, you can manage the different Canton you are working on from here. Each canton is attached to one province.</field>
-        </record>
-		
-		
-		<!--
-		======================================
-				DISTRICT
-		======================================
-		-->
-
-        <record id="view_canton_district_tree" model="ir.ui.view">
-            <field name="name">rent.canton.district.tree</field>
-            <field name="model">rent.canton.district</field>
-            <field name="type">tree</field>
-            <field name="arch" type="xml">
-                <tree string="District">
-                    <field name="name"/>
-                    <field name="code"/>
-                    <field name="canton_id"/>
-                </tree>
-            </field>
-        </record>
-
-        <record id="view_canton_district_form" model="ir.ui.view">
-            <field name="name">rent.canton.district.form</field>
-            <field name="model">rent.canton.district</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <form string="District">
-                    <field name="canton_id" select="1"/>
-                    <field name="name" select="1"/>
-                    <field name="code" select="1"/>
-                </form>
-            </field>
-        </record>
-
-        <record id="action_canton_district" model="ir.actions.act_window">
-            <field name="name">District</field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">rent.canton.district</field>
-            <field name="view_type">form</field>
-            <field name="view_id" ref="view_canton_district_tree"/>
-        </record>
-		
-		
-		
-		<!--
-		======================================
-					CLIENTS
-		======================================
-		-->
-		<record model = "ir.ui.view" id = "client_form_view">
-			<field name = "name">res.partner.form</field>
-			<field name = "model">res.partner</field>
-			<field name = "type">form</field>
-			<field name="inherit_id" ref="base.view_partner_form"/>
-			<field name="arch" type="xml">
-				<data>
-					<!--<field name = "name" position = "after">
-						<field name = "client_birthdate"/>
-					</field>-->
-					<field name = "city" position = "replace"/>
-					<field name = "state_id" position = "replace">
-						<field name = "state_id"/>
-					</field>
-					<field name = "state_id" position = "after">
-						<field name = "canton_id" attrs = "{'readonly':[('state_id','=','')]}"/>
-					</field>
-					<field name = "canton_id" position = "after">
-						<field name = "district_id" attrs = "{'readonly':[('canton_id','=','')]}"/>
-					</field>
-				</data>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "client_tree_view">
-			<field name = "name">res.partner.tree</field>
-			<field name = "model">res.partner</field>
-			<field name = "type">tree</field>
-			<field name="inherit_id" ref="base.view_partner_tree"/>
-			<field name = "arch" type = "xml">
-				<data>
-					<field name = "ref" position = "replace"/>
-					<field name = "city" position = "replace"/>
-					<field name = "user_id" position = "replace"/>
-					<!--<field name = "country" position = "after">
-						<field name = "client_birthdate"/>
-					</field>-->
-				</data>
-			</field>
-		</record>
-		
-		
-		<record model = "ir.actions.act_window" id = "action_client_form_view">
-			<field name = "name">Detalles de Clientes</field>
-			<field name = "res_model">res.partner</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name="domain">[('customer','=','True')]</field>
-			<field name = "view_id" ref = "client_form_view"/>
-		</record>
-		
-		<record model = "ir.actions.act_window.view" id = "action_client_tree_view">
-			<field name = "view_mode">tree</field>
-			<field name = "view_id" ref = "client_tree_view"/>
-			<field name="act_window_id" ref="action_client_form_view"/>
-		</record>
-		
-		
-		<!--
-		======================================
-						CLIENT MENU
-		======================================
-		-->
-		<menuitem id = "rent_manager" name = "Rent" web_icon="data/rent.png"
+    <data>
+        <!--
+        ======================================
+                        MENU
+        ======================================
+        -->
+        <menuitem id = "rent_manager" name = "Rent" web_icon="data/rent.png"
                   web_icon_hover="data/rent-hover.png"/>
-		<menuitem id = "rent_client_menu" name = "Clients" parent = "rent_manager"/>
-		<menuitem id = "rent_client_submenu" name = "Client" parent = "rent_client_menu" action = "action_client_form_view"/>
-		
-		
-		<!--
-		======================================
-					CONTACTS
-		======================================
-		-->
-		<record model = "ir.ui.view" id = "client_contact_form_view">
-			<field name = "name">res.partner.contact.form</field>
-			<field name = "model">res.partner.contact</field>
-			<field name = "type">form</field>
-			<field name="inherit_id" ref="base_contact.view_partner_contact_form"/>
-			<field name="arch" type="xml">
-				<data>
-					<field name = "birthdate" position = "replace"/>
-					<field name = "first_name" position = "after">
-						<field name = "birthdate" attrs = "{'required': 'True'}"/>
-					</field>
-				</data>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "client_contact_tree_view">
-			<field name = "name">res.partner.contact.tree2</field>
-			<field name = "model">res.partner.contact</field>
-			<field name = "type">tree</field>
-			<field name="inherit_id" ref="base_contact.view_partner_contact_tree"/>
-			<field name="arch" type="xml">
-				<data>
-					<field name = "function" position = "after">
-						<field name = "birthdate"/>
-					</field>
-				</data>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_client_contact_form_view">
-			<field name = "name">Contacts</field>
-			<field name = "res_model">res.partner.contact</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref = "client_contact_tree_view"/>
-		</record>
-	<!--	<menuitem id = "rent_client_contact_submenu" name = "Contacts" parent = "rent_client_menu" action = "action_client_contact_form_view"/>-->
-		<!--
-		======================================
-						ESTATES
-		======================================
-		-->
-		<record id = "view_estate_filter" model = "ir.ui.view">
-			<field name = "name">rent.estate.select</field>
-			<field name = "model">rent.estate</field>
-			<field name = "type">search</field>
-			<field name = "arch" type = "xml">
-				<search string = "Search Estate">
-					<group>
-						<filter string = "Rented" icon = "terp-sale" domain = "[('estate_rented','=',True)]"/>
-						<filter string = "Not Rented" icon = "gtk-cancel" domain = "[('estate_rented','=',False)]"/>
-						<separator orientation="vertical"/>
-						<field name="estate_number"/>
-						<field name="estate_owner_id"/>
-					</group>
-					<newline/>
-					<group expand = "0" string = "Group By...">
-						<filter string = "Owners" icon = "terp-personal" domain = "[]" context="{'group_by' : 'estate_owner_id'}"/>
-					</group>
-				</search>
-			</field>
-		</record>
-		<record model = "ir.ui.view" id = "estate_form_view">
-			<field name = "name">rent.estate.form</field>
-			<field name = "model">rent.estate</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "estate Detail">
-					<group col = "4" colspan = "4">
-						<separator string = "General Information" col = "4" colspan = "4"/>
-						<field name = "estate_owner_id"/>
-						<field name = "estate_number"/>
-						<field name = "estate_value" />
-						<field name = "estate_area"  />
-						<field name = "estate_vrn_per_sqr"/>
-						<field name = "estate_account_id"/>
-						<field name = "estate_rented"/>
-						<button colspan="2" name="calculate_vrm" string="Compute Values" type="object" groups="base.group_user" icon="terp-stock_format-scientific"/>
-					</group>
-					<notebook colspan = "4">
-						<page string = "Location"> 
-							<field name = "estate_location_id" colspan="4" nolabel="1" select="1" attrs = "{'readonly' : [('estate_owner_id','=','')]}" domain="[('partner_id','=',estate_owner_id)]"/>
-						</page>
-						<page string = "Buildings">
-							<field name = "estate_buildings_ids" context="{'form_view_ref' : 'rent.building_form_view3', 'tree_view_ref' : 'rent.building_tree_view'}" nolabel="1"/>
-						</page>
-					</notebook>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "estate_tree_view">
-			<field name = "name">rent.estate.tree</field>
-			<field name = "model">rent.estate</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "estate Detail">
-					<field name = "estate_number" select = "1"/>
-					<field name = "estate_owner_id" select = "1"/>
-					<field name = "estate_area" />
-					<field name = "estate_value"/>
-					<field name = "estate_vrn_per_sqr"/>
-					<field name = "estate_rented"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_estate_form_view">
-			<field name = "name">estate Detail</field>
-			<field name = "res_model">rent.estate</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref="estate_tree_view"/>
-			<!--field name="domain">[('estate_owner_id','=',user.company_id.id)]</field-->
-			<field name = "search_view_id" ref = "view_estate_filter"/>
-			<field name="help">Manage the estates that your company owns, to have them available in your system, an estate is a portion of land commonly used for construction, in some cases it can have more than a single estructure, for example 
-			a building. Here yo can set the main data for the estate and also create the buildings that belongs to it.</field>
-		</record>
-		
-		<!--
-		======================================
-						ESTATE MENU
-		======================================
-		-->
-		<menuitem id = "rent_estate_menu" name = "Real Estate" parent = "rent_manager"/>
-		<menuitem id = "rent_estate_submenu" name = "Estate" parent = "rent_estate_menu" action = "action_estate_form_view"/>
-		
-		
-		<!--
-		======================================
-						BUILDING
-		======================================
-		-->
-		
-		<record id = "view_building_filter" model = "ir.ui.view">
-			<field name = "name">rent.building.select</field>
-			<field name = "model">rent.building</field>
-			<field name = "type">search</field>
-			<field name = "arch" type = "xml">
-				<search string = "Search Building">
-					<group>
-						<separator orientation="vertical"/>
-						<field name="name"/>
-						<field name="building_estate_id"/>
-						<field name="building_code"/>
-					</group>
-					<group expand = "0" string = "Group By...">
-						<filter string = "Estates" icon = "terp-go-home" domain = "[]" context="{'group_by' : 'building_estate_id'}"/>
-					</group>
-				</search>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "building_tree_view">
-			<field name = "name">rent.building.tree</field>
-			<field name = "model">rent.building</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string="Building Details">
-					<field name="name"/>
-					<field name="building_company_id"/>
-					<field name="building_date_construction"/>
-					<field name="building_value"/>
-					<field name="building_area"/>
-					<field name = "building_vrn_per_sqr"/>
-					<field name="building_capacity"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model ="ir.ui.view" id = "building_form_view3">
-			<field name = "name">rent.building.form3</field>
-			<field name = "model">rent.building</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Building Details">
-					<group col = "4" colspan = "2">
-						<separator string = "General Information" col = "4" colspan = "4"/>
-						<field name = "name" select = "1"/>
-						<field name = "building_code"/>
-						<field name = "building_company_id"/>
-						<field name = "building_date_construction" select = "1"/>
-						<field name = "building_area"/>
-						<field name = "building_value"/>
-						<field name = "building_capacity"/>
-						<field name = "building_vrn_per_sqr"/>
-					</group>
-					<group col = "4" colspan = "2">
-						<separator string = "Photos" col = "4" colspan = "4"/>
-						<field name = "building_photo" widget = "image" nolabel="1" img_width="200" img_height="180"  colspan = "4"/>
-						<field name = "building_gallery_photo" widget = "url" />
-					</group>
-					<notebook>
-						<page string = "Floors">
-							<field name = "building_floors_ids" mode = "form,tree" nolabel = "1">
-								<form string = "Floor Details">
-									<group col = "4" colspan = "2">
-										<separator string = "General Information" col = "4" colspan = "4"/>
-										<field name = "floor_number"/>
-										<field name = "floor_area"/>
-										<field name = "floor_value"/>
-									</group>
-									<group col = "4" colspan = "2">
-										<separator string = "Design Information" col = "4" colspan = "4"/>
-										<field name = "floor_thickness"/>
-										<field name = "floor_durability"/>
-										<field name = "floor_acabado"/>
-									</group>
-								</form>
-								<tree string="Floor Details">
-									<field name="floor_number"/>
-									<field name="floor_value"/>
-									<field name="floor_area"/>
-								</tree>
-							</field>
-						</page>
-						<!--<page string = "Assets">
-							<field name = "building_asset_id"/>
-						</page>-->
-						<page string = "Machinery">
-							<group col = "4" colspan = "4">
-								<separator string = "Machinery" col = "4" colspan = "4"/>
-								<field name = "building_elevator"/>
-								<field name = "building_elevators_number" attrs="{'readonly':[('building_elevator','!=','True')]}"/>
-								<field name = "building_stairs"/>
-								<field name = "building_stairs_number" attrs="{'readonly':[('building_stairs','!=','True')]}"/>
-							</group>
-						</page>
-					</notebook>
-				</form>
-			</field>
-		</record>
-		
-		
-		<record model = "ir.ui.view" id = "building_tree_view2">
-			<field name = "name">rent.building.tree2</field>
-			<field name = "model">rent.building</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string="Building Details">
-					<field name="name"/>
-					<field name="building_estate_id"/>
-					<field name="building_company_id"/>
-					<field name="building_date_construction"/>
-					<field name="building_value"/>
-					<field name="building_area"/>
-					<field name = "building_vrn_per_sqr"/>
-					<field name="building_capacity"/>
-				</tree>
-			</field>
-		</record>
-		
-		
-		<record model ="ir.ui.view" id = "building_form_view2">
-			<field name = "name">rent.building.form2</field>
-			<field name = "model">rent.building</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Building Details">
-					<group col = "4" colspan = "2">
-						<separator string = "General Information" col = "4" colspan = "4"/>
-						<field name = "name" select = "1"/>
-						<field name = "building_code"/>
-						<field name = "building_estate_id"/>
-						<field name = "building_company_id"/>
-						<field name = "building_date_construction" select = "1"/>
-						<field name = "building_area"/>
-						<field name = "building_value"/>
-						<field name = "building_capacity"/>
-						<field name = "building_vrn_per_sqr"/>
-					</group>
-					<group col = "4" colspan = "2">
-						<separator string = "Photos" col = "4" colspan = "4"/>
-						<field name = "building_photo" widget = "image" nolabel="1" img_width="200" img_height="180"  colspan = "4"/>
-						<field name = "building_gallery_photo" widget = "url" />
-					</group>
-					<notebook>
-						<page string = "Floors">
-							<field name = "building_floors_ids" mode = "form,tree" nolabel = "1">
-								<form string = "Floor Details">
-									<group col = "4" colspan = "2">
-										<separator string = "General Information" col = "4" colspan = "4"/>
-										<field name = "floor_number"/>
-										<field name = "floor_area"/>
-										<field name = "floor_value"/>
-									</group>
-									<group col = "4" colspan = "2">
-										<separator string = "Design Information" col = "4" colspan = "4"/>
-										<field name = "floor_thickness"/>
-										<field name = "floor_durability"/>
-										<field name = "floor_acabado"/>
-									</group>
-								</form>
-								<tree string="Floor Details">
-									<field name="floor_number"/>
-									<field name="floor_value"/>
-									<field name="floor_area"/>
-								</tree>
-							</field>
-						</page>
-						<!--<page string = "Assets">
-							<field name = "building_asset_id"/>
-						</page>-->
-						<page string = "Machinery">
-							<group col = "4" colspan = "4">
-								<separator string = "Machinery" col = "4" colspan = "4"/>
-								<field name = "building_elevator"/>
-								<field name = "building_elevators_number" attrs="{'readonly':[('building_elevator','!=','True')]}"/>
-								<field name = "building_stairs"/>
-								<field name = "building_stairs_number" attrs="{'readonly':[('building_stairs','!=','True')]}"/>
-							</group>
-						</page>
-					</notebook>
-				</form>
-			</field>
-		</record>
-		
-		<!--<record model = "ir.actions.act_window" id = "action_building_form_view">
-			<field name = "name">Building Detail</field>
-			<field name = "res_model">rent.building</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "search_view_id" ref = "view_building_filter"/>
-		</record>-->
-		
-		
-		<record id="action_building_form" model="ir.actions.act_window">
-			<field name="name">building</field>
-			<field name="type">ir.actions.act_window</field>
-			<field name="res_model">rent.building</field>
-			<field name="view_type">form</field>
-			<!--field name="domain">[('building_estate_id.estate_owner_id', '=', uid.company_id.id)]</field-->
-			<field name="help">Manage every parking that belongs to a determined estate. This is the main view where you can create a building record
-			but you can still do it from the estate form</field>
-		</record>
-		
-		<record id="action_building_tree_view2" model="ir.actions.act_window.view">
-			<field name="view_mode">tree</field>
-			<field name="view_id" ref="building_tree_view2"/>
-			<field name="act_window_id" ref="action_building_form"/>
-		</record>
-		
-		<record id="action_building_form_view2" model="ir.actions.act_window.view">
-			<field name="view_mode">form</field>
-			<field name="view_id" ref="building_form_view2"/>
-			<field name="act_window_id" ref="action_building_form"/>
-		</record>
-		
-		<!--
-		======================================
-						BUILDING MENU
-		======================================
-		-->
-		<menuitem id = "rent_building_submenu" name = "Building" parent = "rent_estate_menu" action = "action_building_form" sequence="10"/>
-		
-		<!--
-		======================================
-					FLOOR MENU
-		======================================
-		-->
-		<record id = "view_floor_filter" model = "ir.ui.view">
-			<field name = "name">rent.floor.select</field>
-			<field name = "model">rent.floor</field>
-			<field name = "type">search</field>
-			<field name = "arch" type = "xml">
-				<search string = "Search Floor">
-					<group>
-						<field name="floor_building_id"/>
-					</group>
-					<group expand = "0" string = "Group By...">
-						<filter string = "Edificio" icon = "terp-go-home" domain = "[]" context="{'group_by' : 'floor_building_id'}"/>
-					</group>
-				</search>
-			</field>
-		</record>
-		
-		<record model ="ir.ui.view" id = "floor_form_view">
-			<field name = "name">rent.floor.form2</field>
-			<field name = "model">rent.floor</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Floor Details">
-					<group col = "4" colspan = "2">
-						<separator string = "General Information" col = "4" colspan = "4"/>
-						<field name = "floor_building_id" select = "1"/>
-						<field name = "floor_number"/>
-						<field name = "floor_area"/>
-						<field name = "floor_value"/>
-					</group>
-					<group col = "4" colspan = "2">
-						<separator string = "Design Information" col = "4" colspan = "4"/>
-						<field name = "floor_thickness"/>
-						<field name = "floor_durability"/>
-						<field name = "floor_acabado"/>
-					</group>
-					<notebook colspan = "4">
-						<!--<page string = "Local">
-							<field name = "floor_local" nolabel="1"/>
-						</page>-->
-						<page string = "Parking">
-							<field name = "floor_parking_ids" context="{'form_view_ref' : 'rent.parking_form_view', 'tree_view_ref' : 'rent.parking_tree_view'}" nolabel="1"/>
-						</page>
-					</notebook>
-				</form>
-			</field>
-		</record>
-
-		<record model = "ir.ui.view" id = "floor_tree_view">
-			<field name = "name">rent.floor.tree</field>
-			<field name = "model">rent.floor</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string="Floor Details">
-					<field name="complete_name"/>
-					<field name = "floor_building_id"/>
-					<field name="floor_value"/>
-					<field name="floor_area"/>
-				</tree>
-			</field>
-		</record>
-		
-		
-		<record id="action_floor_form" model="ir.actions.act_window">
-			<field name="name">Floors</field>
-			<field name="type">ir.actions.act_window</field>
-			<field name="res_model">rent.floor</field>
-			<field name="view_type">form</field>
-			<field name = "search_view_id" ref = "view_floor_filter"/>
-			<!--field name="domain">[('floor_building_id.building_estate_id.estate_owner_id','=',uid.company_id.id)]</field-->
-			<field name="help">Manage every floor that belongs to a determined Building. This is the main view where you can create a floor record
-			but you can still do it from the building form</field>
-		</record>
-		<record id="action_floor_form_view1" model="ir.actions.act_window.view">
-			<field eval="10" name="sequence"/>
-			<field name="view_mode">tree</field>
-			<field name="view_id" ref="floor_tree_view"/>
-			<field name="act_window_id" ref="action_floor_form"/>
-		</record>
-		<record id="action_floor_form_view2" model="ir.actions.act_window.view">
-			<field eval="20" name="sequence"/>
-			<field name="view_mode">form</field>
-			<field name="view_id" ref="floor_form_view"/>
-			<field name="act_window_id" ref="action_floor_form"/>
-		</record>
-		<!--
-		======================================
-					FLOOR MENU
-		======================================
-		-->
-		<menuitem id = "rent_floor_submenu" name = "Floors" parent = "rent_estate_menu" action = "action_floor_form"/>
-		
-		
-		<!--
-		======================================
-					LOCAL
-		======================================
-		-->
-		<record id = "view_local_filter" model = "ir.ui.view">
-			<field name = "name">rent.floor.local.select</field>
-			<field name = "model">rent.floor.local</field>
-			<field name = "type">search</field>
-			<field name = "arch" type = "xml">
-				<search string = "Search Local">
-					<group>
-						<filter string = "Rented" icon = "terp-sale" domain = "[('local_rented','=',True)]"/>
-						<filter string = "Not Rented" icon = "gtk-cancel" domain = "[('local_rented','=',False)]"/>
-						<separator orientation="vertical"/>
-						<field name="local_number"/>
-						<field name="local_building"/>
-					</group>
-				</search>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "local_form_view">
-			<field name = "name">rent.floor.local.form</field>
-			<field name = "model">rent.floor.local</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Local Details">
-					<group col = "4" colspan = "2">
-						<separator string = "Photos" col = "4" colspan = "4"/>
-						<field name = "local_photo" widget = "image" nolabel="1" img_width="200" img_height="180" colspan = "4"/>
-						<field name = "local_gallery_photo" widget = "url" colspan = "4"/>
-					</group>
-					<group col = "4" colspan = "2">
-						<separator string = "General Information"/>
-						<field name = "local_building"/>
-						<field name = "local_number"/>
-						<field name = "local_area"/>
-						<field name = "local_huella"/>
-						<separator string = "Miscelanius Information"/>
-						<!--<field name = "local_sqrmeter_price"/>-->
-						<field name = "local_rented"/>
-						<field name = "local_water_meter_number"/>
-						<field name = "local_light_meter_number"/>
-					</group>
-					<notebook>
-						<page string = "Floor List">
-							
-							<field name = "local_local_by_floor_ids" nolabel="1"/>
-							
-						</page>
-						<page string = "Price historic">
-							<field name = "local_rise_historic_ids" nolabel="1"/>
-						</page>
-						<page string = "Notes">
-							<field name = "local_notes" nolabel="1"/>
-						</page>
-					</notebook>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "local_tree_view">
-			<field name = "name">rent.floor.local.tree</field>
-			<field name = "model">rent.floor.local</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Local List">
-					<field name = "local_building"/>
-					<field name = "local_number"/>
-					<!--<field name = "local_value"/>-->
-					<field name = "local_area"/>
-					<field name = "local_rented"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_local_form_view">
-			<field name = "name">Local Detail</field>
-			<field name = "res_model">rent.floor.local</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref = "local_tree_view"/>
-			<field name = "search_view_id" ref = "view_local_filter"/>            
-			<field name="help">Manage every local that belongs to a determined floor. This is the only view where you can create a floor record</field>
-		</record>
-		
-		<menuitem id = "rent_local_submenu" name = "Locals" parent = "rent_estate_menu" action = "action_local_form_view"/>
-		
-		<!--
-		======================================
-					LOCAL BY FLOOR
-		======================================
-		-->
-		
-		<record model = "ir.ui.view" id = "local_floor_form_view">
-			<field name = "name">rent.local.floor.form</field>
-			<field name = "model">rent.local.floor</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Local Details">
-					<group col = "4" colspan = "4">
-						<separator string = "General Information"/>
-						<field name = "local_floor_floor_id" select = "1" on_change = "onchange_floor(local_floor_floor_id)"/>
-						<field name = "local_floor_building" select = "1"/>
-						<!---->
-					</group>
-					<group col = "4" colspan = "4">
-						<separator string = "Floor Specifications"/>
-						<field name = "local_local_floor_id"/>
-						<field name = "local_floor_front"/>
-						<field name = "local_floor_side"/>
-						<field name = "local_sqrmeter_price"/>
-						<field name = "local_floor_value"/>
-						<!---->
-					</group>
-				</form>
-			</field>
-		</record>
-	
-		<record model = "ir.ui.view" id = "local_floor_tree_view">
-			<field name = "name">rent.local.floor.tree</field>
-			<field name = "model">rent.local.floor</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Location in floor list" editable="bottom">
-					<field name = "local_floor_building" select = "1" />
-					<field name = "local_floor_floor_id" select = "1" on_change = "onchange_floor(local_floor_floor_id)"/>
-					<field name = "local_floor_front"/>
-					<field name = "local_floor_side"/>
-					<field name = "local_floor_area"/>
-					<field name = "local_sqrmeter_price" sum = "Sqr Meter Total"/>
-					<field name = "local_floor_value" sum = "Total"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_local_floor_form_view">
-			<field name = "name">Local Detail</field>
-			<field name = "res_model">rent.local.floor</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-		</record>
-		
-		<!--
-		======================================
-					PARKING
-		======================================
-		-->
-		<record id = "view_parking_filter" model = "ir.ui.view">
-			<field name = "name">rent.floor.parking.select</field>
-			<field name = "model">rent.floor.parking</field>
-			<field name = "type">search</field>
-			<field name = "arch" type = "xml">
-				<search string = "Search Parking">
-					<group>
-						<filter string = "Not Rented" icon = "gtk-cancel" domain = "[('parking_rented','=',False)]"/>
-						<separator orientation="vertical"/>
-						<field name="parking_floor_id"/>
-						<field name="parking_number"/>
-					</group>
-				</search>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "parking_tree_view">
-			<field name = "name">rent.floor.parking.tree</field>
-			<field name = "model">rent.floor.parking</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Parking List">
-					<field name = "parking_number"/>
-					<field name = "parking_value"/>
-					<field name = "parking_area"/>
-					<field name = "parking_rented"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "parking_form_view">
-			<field name = "name">rent.floor.parking.form</field>
-			<field name = "model">rent.floor.parking</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Parking Details">
-					<group col = "4" colspan = "4">
-						<separator string = "General Information"/>
-						<field name = "parking_number"/>
-						<field name = "parking_value"/>
-						<field name = "parking_sqrmeter_price"/>
-						<field name = "parking_rented"/>
-					</group>
-					<group col = "4" colspan = "4">
-						<separator string = "Area Specifications Information"/>
-						<field name = "parking_large"/>
-						<field name = "parking_width"/>	
-						<field name = "parking_area"/>
-						<field name = "parking_huella"/>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "parking_tree_view2">
-			<field name = "name">rent.floor.parking.tree2</field>
-			<field name = "model">rent.floor.parking</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Parking List">
-					<field name = "parking_floor_building"/>
-					<field name = "parking_floor_id"/>
-					<field name = "parking_number"/>
-					<field name = "parking_value"/>
-					<field name = "parking_area"/>
-					<field name = "parking_rented"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "parking_form_view2">
-			<field name = "name">rent.floor.parking.form2</field>
-			<field name = "model">rent.floor.parking</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Parking Details">
-					<group col = "4" colspan = "4">
-						<separator string = "General Information"/>
-						<field name = "parking_floor_building"/>
-						<field name = "parking_floor_id" on_change="onchange_floor(parking_floor_id)"/>
-						<field name = "parking_number"/>
-						<field name = "parking_value"/>
-						<field name = "parking_sqrmeter_price"/>
-						<field name = "parking_rented"/>
-					</group>
-					<group col = "4" colspan = "4">
-						<separator string = "Area Specifications Information"/>
-						<field name = "parking_large"/>
-						<field name = "parking_width"/>	
-						<field name = "parking_area"/>
-						<field name = "parking_huella"/>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record id="action_parking_form" model="ir.actions.act_window">
-			<field name="name">Parking</field>
-			<field name="type">ir.actions.act_window</field>
-			<field name="res_model">rent.floor.parking</field>
-			<field name="view_type">form</field>
-			<!--field name="domain">[('parking_floor_id.floor_building_id.building_estate_id.estate_owner_id.id','=',user.company_id.id)]</field-->
-			<field name = "search_view_id" ref = "view_parking_filter"/> 
-			<field name="help">Manage every parking that belongs to a determined floor. This is the main view where you can create a parking record
-			but you can still do it from the floor form</field>
-		</record>
-		
-		<record id="action_parking_tree_view1" model="ir.actions.act_window.view">
-			<field name="view_mode">tree</field>
-			<field name="view_id" ref="parking_tree_view2"/>
-			<field name="act_window_id" ref="action_parking_form"/>
-		</record>
-		
-		<record id="action_parking_form_view1" model="ir.actions.act_window.view">
-			<field name="view_mode">form</field>
-			<field name="view_id" ref="parking_form_view2"/>
-			<field name="act_window_id" ref="action_parking_form"/>
-		</record>
-
-		<!--
-		======================================
-					PARKING MENU
-		======================================
-		-->
-		<menuitem id = "rent_parking_submenu" name = "Parking" parent = "rent_estate_menu" action = "action_parking_form" sequence="10"/>
-		<!--
-		======================================
-					RENT
-		======================================
-		-->
-		<record id = "view_rent_rent_filter" model = "ir.ui.view">
-			<field name = "name">rent.rent.select</field>
-			<field name = "model">rent.rent</field>
-			<field name = "type">search</field>
-			<field name = "arch" type = "xml">
-				<search string = "Search Rents">
-					<group>
-						<filter string = "Draft" name ="draft" icon = "terp-document-new" domain = "[('state','=','draft')]"/>
-						<filter string = "Active" name = "active" icon = "terp-camera_test" domain = "[('state','=','active')]" />
-						<filter string = "Finished" icon = "gtk-cancel" domain = "[('state','=','finished')]"/>
-						<separator orientation="vertical"/>
-						<field name="name"/>
-						<field name="rent_related_real"/>
-						<field name="rent_start_date"/>
-						<field name="rent_end_date"/>
-					</group>
-					<newline/>
-					<group colspan="4" expand = "0" string = "Group By...">
-						<filter string = "Type" icon = "terp-stock_symbol-selection" domain = "[]" context="{'group_by' : 'rent_type'}"/>
-						<filter string = "Status" icon = "terp-stock_zoom" domain = "[]" context="{'group_by' : 'state'}"/>
-					</group>
-				</search>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "rent_form_view">
-			<field name = "name">rent.rent.form</field>
-			<field name = "model">rent.rent</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Rent Detail">
-					<group col = "4" colspan = "4">
-						<separator string = "Information" colspan = "4"/>
-						<field name = "name"/>
-						<field name = "ref"/>
-						<field name = "rent_rent_client_id" select  = "1"/>
-						<field name = "rent_type"/>
-						<field name = "rent_group_id" />
-						<field name = "rent_related_real" />
-						<group colspan = "2" col = "6">
-							<field name = "active"/>
-							<field name = "rent_include_water" attrs = "{'invisible' : [('rent_related_real','not in',['local'])], 'readonly' : [('rent_rent_local_id.local_water_meter_number','=','')]}"/>
-						</group>
-						<group colspan = "2" col = "6">
-							<field name = "rent_main_inc"/>
-							<field name = "company_id"/>
-						</group>
-					</group>
-					<notebook>
-						<page string = "Rent">
-							<group col = "4" colspan = "4">
-								<separator string = "Accounting" colspan = "4"/>
-								<field name="rent_rent_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"  groups="base.group_extended"/>
-								<field name="rent_rent_acc_int_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
-								<field name="rent_inv_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
-								<field name="rent_inv_water_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
-							</group>
-							<group col = "4" colspan = "4">
-								<field name = "rent_charge_day"/>
-								<field name = "rent_invoiced_day"/>
-								<field name = "rent_grace_period"/>
-								<field name = "rent_years"/>
-								<field name = "rent_start_date" attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_type','!=','Contract')]}"/>
-								<field name = "rent_end_date"/>
-							</group>
-							<group col = "4" colspan = "2">
-								<separator string = "Negotiation Information" colspan = "4"/>
-								<field name = "rent_amount_base"/>
-								<field name = "rent_total"/>
-								<field name = "rent_rise_year2"/>
-								<field name = "rent_performance"/>
-								<field name = "rent_rise_year3"/>
-								<field name = "rent_amount_per_sqr"/>
-								<field name = "rent_rise"/>	
-								<field name = "rent_rent_real_area"/>
-								<field name = "rent_deposit"/>
-								<field name = "currency_id"/>
-								<!--<field name = "rent_rise_chart_years" on_change = "onchange_rise_years(rent_rise_chart_years,rent_amount_base,rent_rise)"/>-->
-								<label string = "  "/>
-								<button name = "calculate_negotiation" string="Compute Values" type="object" icon="terp-stock_format-scientific"/>
-								<field name = "rent_show_us_eq"/>
-								<!-- <field name = "rent_rise_chart_ids" nolabel="1" colspan = "4"/> -->								
-							</group>
-							<group col = "4" colspan = "2" attrs = "{'invisible': [('rent_show_us_eq','!=','True')]}">
-								<separator string = "USD Currency Equivalence" colspan = "4"/>
-								<field name = "rent_amountd_base"/>
-								<field name = "rent_total_us"/>
-								<field name = "rent_rise_year2d"/>
-								<field name = "rent_amountd_per_sqr"/>
-								<field name = "rent_rise_year3d"/>
-								<field name = "eqv_currency_id"/>
-							</group>
-							<group col = "4" colspan = "4" attrs = "{'invisible':[('state','!=','finished')]}">
-								<separator string = "Contract Termination" colspan = "4"/>
-								<field name = "rent_ending_motif"/>
-								<field name = "rent_ending_motif_desc"/>
-							</group>
-							<notebook>
-								<page string = "Detail">
-									<group col = "4" colspan = "4" attrs = "{'invisible':[('rent_related_real','=','')]}">
-										<separator string = "Real Estate Information" colspan = "4"/>
-											<field name = "rent_rent_local_id"  attrs = "{ 'required' : [('rent_related_real','=','local'),('state','=','draft')], 'invisible': ['|',('rent_related_real','=',''),('rent_related_real','!=','local')], 'readonly': ['|',('rent_related_real','!=','local'),('state','!=','draft')]}"/>
-											<field name = "rent_rent_parking_id" attrs = " { 'required' : [('rent_related_real','=','parking'),('state','=','draft')], 'invisible': ['|',('rent_related_real','=',''),('rent_related_real','!=','parking')], 'readonly': ['|',('rent_related_real','!=','parking'),('state','!=','draft')]}"/>
-											<field name = "rent_rent_estate_id"  attrs = " { 'required' : [('rent_related_real','=','estate'),('state','=','draft')], 'invisible': ['|',('rent_related_real','=',''),('rent_related_real','!=','estate')], 'readonly': ['|',('rent_related_real','!=','estate'),('state','!=','draft')]}"/>
-									</group>
-								</page>
-								<page string = "Calculations">
-									<field name = "rent_estimates_ids" nolabel="1"/>
-								</page>
-								<page string = "Aumentos" attrs = "{'invisible': [('rent_type','!=','Contract')]}">
-									<field name = "rent_historic_ids" nolabel="1"/>
-								</page>
-								<page string = "Facturas" attrs = "{'invisible': [('rent_type','!=','Contract')]}">
-									<field name = "rent_invoice_ids" nolabel="1"/>
-								</page>
-								<page string = "Modifications" attrs = "{'invisible': [('rent_type','!=','Contract')]}">
-									<field name = "rent_modif" attrs="{'readonly' : [('rent_type','!=','Contract')]}" 
-									default_get = "{
-										'rent_type'           : 'Adendum',
-										'rent_rent_account_id': rent_rent_account_id,
-										'rent_rent_acc_int_id': rent_rent_acc_int_id,
-									}"
-									nolabel="1"
-									context="{'tree_view_ref' : 'rent.rent_adendum_tree_view'}"/>
-								</page>
-								<page string = "Notes">
-									<field name = "rent_notes" nolabel="1"/>
-								</page>
-							</notebook>
-						</page>
-						
-						<page string = "Maintenance">
-							<group col = "4" colspan = "4">
-								<separator string = "General Information" colspan = "4"/>
-								<field name = "rent_main_company_id" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name = "rent_main_start_date" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name = "rent_main_end_date" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-							</group>
-							<group col = "4" colspan = "4">
-								<separator string = "Accounting" colspan = "4"/>
-								<field name="rent_rent_main_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"  groups="base.group_extended" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name="rent_rent_main_acc_int_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name="rent_inv_main_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name = "rent_main_charge_day" attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name = "rent_main_invoiced_day" attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name = "rent_main_grace_period" attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								
-							</group>
-							<group col = "4" colspan = "2">
-								<separator string = "Financial Information" colspan = "4"/>
-								<field name = "rent_main_amount_base"  attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name = "rent_main_total"  attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name = "rent_main_rise_year2"/>
-								<field name = "rent_main_performance"/>
-								<field name = "rent_main_rise_year3"/>
-								<field name = "rent_main_rise"  attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
-								<field name = "main_currency_id"/>
-								<field name = "rent_main_show_us_eq"/>
-								<label string = "  "/>
-								<button name = "calculate_negotiation" string="Compute Values" type="object" icon="terp-stock_format-scientific"/>
-							</group>
-							<group col = "2" colspan = "2" attrs = "{'invisible': [('rent_main_show_us_eq','!=','True')]}">
-								<separator string = "USD Currency Equivalence" colspan = "4"/>
-								<field name = "rent_main_amountd_base"/>
-								<field name = "rent_main_rise_year2d"/>
-								<field name = "rent_main_rise_year3d"/>
-								<field name = "main_eqv_currency_id"/>
-							</group>
-							<notebook>
-								<page string = "Calculations">
-									<field name = "rent_main_estimates_ids" nolabel="1"  attrs = "{'readonly' : [('rent_main_inc','!=','True')]}"/>
-								</page>
-								<page string = "Aumentos">
-									<field name = "rent_main_historic_ids" nolabel="1"/>
-								</page>
-								<page string = "Facturas">
-									<field name = "rent_main_invoice_ids" nolabel="1"/>
-								</page>
-								<page string = "Notes">
-									<field name = "main_notes" nolabel="1"/>
-								</page>
-							</notebook>
-						</page>
-					</notebook>
-					<group col = "6" colspan = "4">
-						<field name = "state"/>
-						<button name = "cron_rent_invoice" string="Check for Invoices" type="object" icon="terp-stock_format-scientific"/>
-						<button name="rent_finish" states="active" string="Finish" icon="gtk-cancel" attrs = "{'invisible': [('rent_type','!=','Contract')]}"/>
-						<button name="rent_active" states="draft" string="Approve" icon="terp-camera_test"/>
-						<button 
-							name="%(action_view_rent_make_group)d"
-							string="Create new Group"
-							type="action"
-							states="active"
-							icon="gtk-go-forward"
-							attrs="{'invisible': ['|',('rent_type', '!=', 'Contract'),('state', '!=', 'active')]}"/>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "rent_tree_view">
-			<field name = "name">rent.rent.tree</field>
-			<field name = "model">rent.rent</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Rent List" colors="blue:state in ('draft');black:state in ('active');gray:state in ('finished')">
-					<field name = "name"/>
-					<field name = "rent_type"/>
-					<field name = "rent_related_real"/>
-					<field name = "state"/>
-					<field name = "rent_start_date"/>
-					<field name = "rent_end_date"/>
-					<field name = "rent_amount_base"/>
-					<field name = "rent_rise"/>
-					<button name="rent_active" states="draft" string="Approve" icon="terp-camera_test"/>
-					<button name="rent_finish" states="active" string="Finish" icon="gtk-cancel"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "rent_tree_view2">
-			<field name = "name">rent.rent.tree2</field>
-			<field name = "model">rent.rent</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Rent List" colors="blue:state in ('draft');black:state in ('active');gray:state in ('finished')">
-					<field name = "name"/>
-					<field name = "rent_rent_client_id"/>
-					<field name = "rent_related_real"/>
-					<field name = "rent_amount_base"/>
-					<field name = "currency_id"/>
-					<field name = "rent_rise"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "rent_adendum_tree_view">
-			<field name = "name">rent.rent.adendum.tree</field>
-			<field name = "model">rent.rent</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Adendum List" colors="blue:state in ('draft');black:state in ('active');gray:state in ('finished')">
-					<field name = "rent_type"/>
-					<field name = "rent_related_real"/>
-					<field name = "state"/>
-					<field name = "rent_end_date"/>
-					<field name = "rent_amount_base"/>
-					<field name = "rent_rise"/>
-					<field name = "currency_id"/>
-					<field name = "rent_modif_date"/>
-					<button name="rent_active" states="draft" string="Approve" icon="terp-camera_test"/>
-				</tree>
-			</field>
-		</record>
-		<record model = "ir.actions.act_window" id = "action_rent_form_view">
-			<field name = "name">Rent Details</field>
-			<field name = "res_model">rent.rent</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref = "rent_tree_view"/>
-			<field name="domain">[('rent_type','=','Contract')]</field>
-			<field name="context">{"search_default_active":1}</field>
-			<field name = "search_view_id" ref = "view_rent_rent_filter"/>
-		</record>
-		
-		<!--
-		======================================
-					RENT MENU
-		======================================
-		-->
-		<menuitem id = "rent_rent_menu" name = "Rent" parent = "rent_manager"/>
-		<menuitem id = "rent_rent_submenu" name = "Rents" parent = "rent_rent_menu" action = "action_rent_form_view"/>
-		
-		
-		<!--
-		======================================
-					RENT estimateS
-		======================================
-		-->
-		
-		<record model = "ir.ui.view" id = "rent_estimate_tree_view">
-			<field name = "name">rent.rent.estimate.tree</field>
-			<field name = "model">rent.rent.estimate</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree editable = "top" string = "Calculations List" colors="green:estimate_state in ('final');blue:estimate_state in ('recommend');red:estimate_state in ('min');gray:estimate_state in ('norec')">
-					<field name = "estimate_date"/>
-					<field name = "estimate_performance"/>
-					<field name = "estimate_years"/>
-					<field name = "estimate_amountc"/>
-					<field name = "estimate_amountd"/>
-					<field name = "estimate_colones"/>
-					<field name = "estimate_dollars"/>
-					<field name = "estimate_state"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "rent_estimate_form_view">
-			<field name = "name">rent.rent.estimate.form</field>
-			<field name = "model">rent.rent.estimate</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Estimates">
-					<group col="4" colspan="4">
-						<separator colspan = "4" string = "Calculos"/>
-						<group>
-							<field name = "estimate_performance"/>
-							<field name = "estimate_years"/>
-						</group>
-						<group>
-							<field name = "estimate_amountc"/>
-							<field name = "estimate_date"/>
-							<field name = "estimate_colones"/>
-						</group>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_rent_estimate_form_view">
-			<field name = "name">Calculations Details</field>
-			<field name = "res_model">rent.rent.estimate</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref = "rent_estimate_tree_view"/>
-		</record>
-		
-		
-		
-		
-		<!--
-		======================================
-					RENT MAINTENANCE estimateS
-		======================================
-		-->
-		
-		<record model = "ir.ui.view" id = "rent_main_estimate_tree_view">
-			<field name = "name">rent.rent.main.estimate.tree</field>
-			<field name = "model">rent.rent.main.estimate</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree editable = "top" string = "Calculations List" colors="green:estimate_state in ('final');blue:estimate_state in ('recommend');red:estimate_state in ('min');gray:estimate_state in ('norec')">
-					<field name = "estimate_date"/>
-					<field name = "estimate_performance"/>
-					<field name = "estimate_years"/>
-					<field name = "estimate_amountc"/>
-					<field name = "estimate_amountd"/>
-					<field name = "estimate_colones"/>					
-					<field name = "estimate_dollars"/>					
-					<field name = "estimate_state"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "rent_main_estimate_form_view">
-			<field name = "name">rent.rent.main.estimate.form</field>
-			<field name = "model">rent.rent.main.estimate.</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Estimates">
-					<group col="4" colspan="4">
-						<separator colspan = "4" string = "Calculos"/>
-						<group>
-							<field name = "estimate_performance"/>
-							<field name = "estimate_years"/>
-						</group>
-						<group>
-							<field name = "estimate_amountc"/>
-							<field name = "estimate_date"/>
-							<field name = "estimate_colones"/>
-						</group>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_rent_main_estimate_form_view">
-			<field name = "name">Calculations Details</field>
-			<field name = "res_model">rent.rent.estimate</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref = "rent_main_estimate_tree_view"/>
-		</record>
-		
-		
-		
-		<!--
-		======================================
-					RENT History
-		======================================
-		-->
-		
-		<record model = "ir.ui.view" id = "rent_anual_value_tree_view">
-			<field name = "name">rent.rent.estimate.tree</field>
-			<field name = "model">rent.rent.anual.value</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree  string = "Value History">
-					<field name = "anual_value_date"/>
-					<field name = "anual_value_value"/>
-					<field name = "anual_value_prev_value"/>
-					<field name = "anual_value_rate"/>					
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "rent_anual_value_form_view">
-			<field name = "name">rent.rent.estimate.form</field>
-			<field name = "model">rent.rent.anual.value</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Estimates">
-					<group col="4" colspan="4">
-						<separator colspan = "4" string = "Calculos"/>
-						<group>
-							<field name = "anual_value_value"/>
-							<field name = "anual_value_rate"/>
-							<field name = "anual_value_date"/>
-						</group>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_rent_anual_value_form_view">
-			<field name = "name">Calculations Details</field>
-			<field name = "res_model">rent.rent.anual.value</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref = "rent_anual_value_tree_view"/>
-		</record>
-		
-		<!--
-		======================================
-					RENT INVOICE LINE
-		======================================
-		-->
-		<record model = "ir.ui.view" id = "rent_invoice_form_view">
-			<field name = "name">rent.invoice.form</field>
-			<field name = "model">account.invoice.line</field>
-			<field name = "type">form</field>
-			<field name = "inherit_id" ref = "account.view_invoice_line_form"/>
-			<field name = "arch" type="xml">
-				<data>
-					<field name="product_id" position="before">
-						<field name = "invoice_type" on_change = "onchange_type(invoice_type)"/>
-					</field>
-					<field name="product_id" position="replace"/>
-					<field name="uos_id" position="replace"/>
-					<field name="invoice_type" position="after">
-						<field name = "invoice_rent_id" on_change="rent_id_change(invoice_rent_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})" attrs="{'invisible' : [('invoice_type','=','product')]}"
-						context="{'tree_view_ref' : 'rent.rent_tree_view2'}"/>
-					</field>
-					<field name="invoice_rent_id" position="after">
-						<field name = "product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})" attrs="{'invisible' : [('invoice_type','=','rent')]}"/>
-						<field name="uos_id"  on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})" attrs="{'invisible' : [('invoice_type','=','rent')]}"/>
-					</field>
-				</data>
-			</field>
-		</record>
-		
-		
-		<!--
-		======================================
-					RENT INVOICE
-		======================================
-		-->
-		<record model = "ir.ui.view" id = "rent_invoices_form_view">
-			<field name = "name">rent.invoice.rent.form</field>
-			<field name = "model">rent.invoice.rent</field>
-			<field name = "type">form</field>
-			<field name = "arch" type="xml">
-				<form string = "Invoices">
-					<field name="invoice_id"/>
-					<field name="invoice_date"/>
-					<field name="invoice_state"/>
-					<field name="invoice_number"/>
-					<field name="invouce_residual"/>
-				</form>
-			</field>
-		</record>
-		
-		
-		<record model = "ir.ui.view" id = "rent_invoices_tree_view">
-			<field name = "name">rent.invoice.rent.tree</field>
-			<field name = "model">rent.invoice.rent</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type="xml">
-				<tree string = "Invoices">
-					<field name="invoice_id"/>
-					<field name="invoice_date"/>
-					<field name="invoice_state"/>
-					<field name="invoice_number"/>
-					<field name="invouce_residual"/>
-				</tree>
-			</field>
-		</record>
-		<!--
-		======================================
-					CONTRACTS
-		======================================
-		-->
-		<record model = "ir.ui.view" id = "contract_form_view">
-			<field name = "name">rent.contract.form</field>
-			<field name = "model">rent.contract</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Contrato">
-					<group col = "4" colspan = "4">
-						<separator colspan = "4" string = "General Data"/>
-						<field name = "name"/>
-						<field name = "contract_rent_id" domain = "['|',('state','=','draft'), ('state','=','active'),('rent_type'.'!=','Adendum')]"/>
-					</group>
-					<group col = "4" colspan = "4">
-						<separator colspan = "4" string = "General Data"/>
-						<field colspan = "4" name = "contract_clauses_ids" nolabel = "1"/>
-						<!--<field name = "contract_design"/>-->
-					</group>
-					<group col="4" colspan="4">
-						<separator colspan = "4" string = "Legend"/>
-						<label string = "Use any of the code down to specife where should go special data to be retreived such as partners name, date, and others. Place it in the body of the clause as you need it"/>
-						<group>
-							<label colspan="4" string="Client name : %%(cli)s"/>
-							<label colspan="4" string="Company name: %%(com)s"/>
-						</group>
-						<group>
-							<label colspan="4" string="Total paid: %%(tot)s"/>
-							<label colspan="4" string="Starting Date: %%(sd)s"/>
-							<label colspan="4" string="Ending Date: %%(ed)s"/>
-						</group>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "contract_tree_view">
-			<field name = "name">rent.contract.tree</field>
-			<field name = "model">rent.contract</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Contract">
-						<field name = "name"/>
-						<field name = "contract_rent_id"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_contract_form_view">
-			<field name = "name">Contracts</field>
-			<field name = "res_model">rent.contract</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-		</record>
-		
-		<!--
-		======================================
-					CONTRACT MENU
-		======================================
-		-->
-		<!--<menuitem id = "rent_contract_submenu" name = "Contracts" parent = "rent_rent_menu" action = "action_contract_form_view"/>-->
-		
-		<!--
-		======================================
-					CLAUSES
-		======================================
-		-->
-		
-		<record model = "ir.ui.view" id = "contract_clause_form_view">
-			<field name = "name">rent.contract.clause.form</field>
-			<field name = "model">rent.contract.clause</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Clauses">
-					<group col = "4" colspan = "4">
-						<separator colspan = "4" string = "Reference Data"/>
-						<field name = "clause_code" select = "1"/>
-						<field name = "clause_is_basic" select = "1"/>
-						<field name = "clause_subject" select = "1"/>
-						
-					</group>
-					<group col = "4" colspan = "4">
-						<separator colspan = "4" string = "Body"/>
-						<field name = "clause_body" nolabel="1"/>
-					</group>
-					<group col="4" colspan="4">
-						<separator colspan = "4" string = "Legend"/>
-						<label string = "Use any of the code down to specife where should go special data to be retreived such as partners name, date, and others. Place it in the body of the clause as you need it"/>
-						<group>
-							<label colspan="4" string="Client name : %%(cli)s"/>
-							<label colspan="4" string="Company name: %%(com)s"/>
-						</group>
-						<group>
-							<label colspan="4" string="Total paid: %%(tot)s"/>
-							<label colspan="4" string="Starting Date: %%(sd)s"/>
-							<label colspan="4" string="Ending Date: %%(ed)s"/>
-						</group>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "contract_clause_tree_view">
-			<field name = "name">rent.contract.clause.tree</field>
-			<field name = "model">rent.contract.clause</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Clause">
-						<field name = "clause_code" select = "1"/>
-						<field name = "clause_subject" select = "1"/>
-						<field name = "clause_is_basic" select = "1"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_contract_clause_form_view">
-			<field name = "name">Clauses</field>
-			<field name = "res_model">rent.contract.clause</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-		</record>
-		
-		<!--
-		======================================
-					CONTRACT CLAUSE MENU
-		======================================
-		-->
-		<!--<menuitem id = "rent_contract_clause_submenu" name = "Clauses" parent = "rent_rent_menu" action = "action_contract_clause_form_view"/>-->
-		
-		<!--
-		======================================
-					CLAUSE BY CONTRACT MENU
-		======================================
-		-->
-		<record model = "ir.ui.view" id = "clause_by_contract_form_view">
-			<field name = "name">clause.contract.clause.rel.form</field>
-			<field name = "model">rent.contract.clause.rel</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Clausula de Contrato">
-					<field name = "sequence"/>
-					<field name = "rent_contract_clause_id"/>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "clause_by_contract_tree_view">
-			<field name = "name">clause.contract.clause.rel.tree</field>
-			<field name = "model">rent.contract.clause.rel</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Clausula de Contrato">
-					<field name = "sequence"/>
-					<field name = "rent_contract_clause_id"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_clause_by_contract_form_view">
-			<field name = "name">Clause by Contract</field>
-			<field name = "res_model">rent.contract.clause.rel</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref = "clause_by_contract_tree_view"/>
-		</record>
-		
-		
-		<!--
-		======================================
-					RENT GROUP
-		======================================
-		-->
-		<record model = "ir.ui.view" id = "rent_rent_group_form_view">
-			<field name = "name">rent.rent.group.form</field>
-			<field name = "model">rent.rent.group</field>
-			<field name = "type">form</field>
-			<field name = "arch" type = "xml">
-				<form string = "Rent Group">
-					<group col = "4" colspan = "4">
-						<separator string = "Details" colspan = "4"/>
-						<field name = "name"/>
-					</group>
-					<group col = "4" colspan = "4">
-						<separator string = "Rents" colspan = "4"/>
-						<field name = "rent_rent_ids" context="{'tree_view_ref' : 'rent.rent_tree_view'}" nolabel="1"/>
-					</group>
-				</form>
-			</field>
-		</record>
-		
-		<record model = "ir.ui.view" id = "rent_rent_group_tree_view">
-			<field name = "name">rent.rent.group.tree</field>
-			<field name = "model">rent.rent.group</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Rent Group List">
-					<field name = "name"/>
-					<field name = "rent_rent_ids"/>
-				</tree>
-			</field>
-		</record>
-		
-		<record model = "ir.actions.act_window" id = "action_rent_group_form_view">
-			<field name = "name">Rent Group</field>
-			<field name = "res_model">rent.rent.group</field>
-			<field name = "type">ir.actions.act_window</field>
-			<field name = "view_type">form</field>
-			<field name = "view_mode">tree,form</field>
-			<field name = "view_id" ref = "rent_rent_group_tree_view"/>
-		</record>
-		<menuitem id = "rent_rent_group_submenu" name = "Rent group" parent = "rent_rent_menu" action = "action_rent_group_form_view"/>
-		
-		
-		<!--
-		======================================
-					RENT RISE ESTIMATE
-		======================================
-		-->
-		
-		<record model = "ir.ui.view" id = "rent_rent_group_tree_view">
-			<field name = "name">rent.rise.estimate.tree</field>
-			<field name = "model">rent.rise.estimate</field>
-			<field name = "type">tree</field>
-			<field name = "arch" type = "xml">
-				<tree string = "Rise Estimation">
-					<field name = "year"/>
-					<field name = "amount"/>
-				</tree>
-			</field>
-		</record>
-	</data>
+        <menuitem id = "rent_client_menu" name = "Customers" parent = "rent_manager"/>
+        <menuitem id="menu_account_customer" name="Customers"
+            parent="rent_client_menu"
+            action="base.action_partner_customer_form" sequence="100"/>
+        
+        <!--
+        ======================================
+                        ESTATES
+        ======================================
+        -->
+        <record id = "view_estate_filter" model = "ir.ui.view">
+            <field name = "name">rent.estate.select</field>
+            <field name = "model">rent.estate</field>
+            <field name = "type">search</field>
+            <field name = "arch" type = "xml">
+                <search string = "Search Estate">
+                    <group>
+                        <filter string = "Rented" icon = "terp-sale" domain = "[('estate_rented','=',True)]"/>
+                        <filter string = "Not Rented" icon = "gtk-cancel" domain = "[('estate_rented','=',False)]"/>
+                        <separator orientation="vertical"/>
+                        <field name="estate_number"/>
+                        <field name="estate_owner_id"/>
+                    </group>
+                    <newline/>
+                    <group expand = "0" string = "Group By...">
+                        <filter string = "Owners" icon = "terp-personal" domain = "[]" context="{'group_by' : 'estate_owner_id'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+        <record model = "ir.ui.view" id = "estate_form_view">
+            <field name = "name">rent.estate.form</field>
+            <field name = "model">rent.estate</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "estate Detail">
+                    <group col = "4" colspan = "4">
+                        <separator string = "General Information" col = "4" colspan = "4"/>
+                        <field name = "estate_owner_id"/>
+                        <field name = "estate_number"/>
+                        <field name = "estate_value" />
+                        <field name = "estate_area"  />
+                        <field name = "estate_vrn_per_sqr"/>
+                        <field name = "estate_account_id"/>
+                        <field name = "estate_rented"/>
+                        <button colspan="2" name="calculate_vrm" string="Compute Values" type="object" groups="base.group_user" icon="terp-stock_format-scientific"/>
+                    </group>
+                    <notebook colspan = "4">
+                        <page string = "Location"> 
+                            <field name = "estate_location_id" colspan="4" nolabel="1" select="1" attrs = "{'readonly' : [('estate_owner_id','=','')]}" domain="[('partner_id','=',estate_owner_id)]"/>
+                        </page>
+                        <page string = "Buildings">
+                            <field name = "estate_buildings_ids" context="{'form_view_ref' : 'rent.building_form_view3', 'tree_view_ref' : 'rent.building_tree_view'}" nolabel="1"/>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "estate_tree_view">
+            <field name = "name">rent.estate.tree</field>
+            <field name = "model">rent.estate</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "estate Detail">
+                    <field name = "estate_number" select = "1"/>
+                    <field name = "estate_owner_id" select = "1"/>
+                    <field name = "estate_area" />
+                    <field name = "estate_value"/>
+                    <field name = "estate_vrn_per_sqr"/>
+                    <field name = "estate_rented"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_estate_form_view">
+            <field name = "name">estate Detail</field>
+            <field name = "res_model">rent.estate</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "view_id" ref="estate_tree_view"/>
+            <!--field name="domain">[('estate_owner_id','=',user.company_id.id)]</field-->
+            <field name = "search_view_id" ref = "view_estate_filter"/>
+            <field name="help">Manage the estates that your company owns, to have them available in your system, an estate is a portion of land commonly used for construction, in some cases it can have more than a single estructure, for example 
+            a building. Here yo can set the main data for the estate and also create the buildings that belongs to it.</field>
+        </record>
+        
+        <!--
+        ======================================
+                        ESTATE MENU
+        ======================================
+        -->
+        <menuitem id = "rent_estate_menu" name = "Real Estate" parent = "rent_manager"/>
+        <menuitem id = "rent_estate_submenu" name = "Estate" parent = "rent_estate_menu" action = "action_estate_form_view"/>
+        
+        
+        <!--
+        ======================================
+                        BUILDING
+        ======================================
+        -->
+        
+        <record id = "view_building_filter" model = "ir.ui.view">
+            <field name = "name">rent.building.select</field>
+            <field name = "model">rent.building</field>
+            <field name = "type">search</field>
+            <field name = "arch" type = "xml">
+                <search string = "Search Building">
+                    <group>
+                        <separator orientation="vertical"/>
+                        <field name="name"/>
+                        <field name="building_estate_id"/>
+                        <field name="building_code"/>
+                    </group>
+                    <group expand = "0" string = "Group By...">
+                        <filter string = "Estates" icon = "terp-go-home" domain = "[]" context="{'group_by' : 'building_estate_id'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "building_tree_view">
+            <field name = "name">rent.building.tree</field>
+            <field name = "model">rent.building</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string="Building Details">
+                    <field name="name"/>
+                    <field name="building_company_id"/>
+                    <field name="building_date_construction"/>
+                    <field name="building_value"/>
+                    <field name="building_area"/>
+                    <field name = "building_vrn_per_sqr"/>
+                    <field name="building_capacity"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model ="ir.ui.view" id = "building_form_view3">
+            <field name = "name">rent.building.form3</field>
+            <field name = "model">rent.building</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Building Details">
+                    <group col = "4" colspan = "2">
+                        <separator string = "General Information" col = "4" colspan = "4"/>
+                        <field name = "name" select = "1"/>
+                        <field name = "building_code"/>
+                        <field name = "building_company_id"/>
+                        <field name = "building_date_construction" select = "1"/>
+                        <field name = "building_area"/>
+                        <field name = "building_value"/>
+                        <field name = "building_capacity"/>
+                        <field name = "building_vrn_per_sqr"/>
+                    </group>
+                    <group col = "4" colspan = "2">
+                        <separator string = "Photos" col = "4" colspan = "4"/>
+                        <field name = "building_photo" widget = "image" nolabel="1" img_width="200" img_height="180"  colspan = "4"/>
+                        <field name = "building_gallery_photo" widget = "url" />
+                    </group>
+                    <notebook>
+                        <page string = "Floors">
+                            <field name = "building_floors_ids" mode = "form,tree" nolabel = "1">
+                                <form string = "Floor Details">
+                                    <group col = "4" colspan = "2">
+                                        <separator string = "General Information" col = "4" colspan = "4"/>
+                                        <field name = "floor_number"/>
+                                        <field name = "floor_area"/>
+                                        <field name = "floor_value"/>
+                                    </group>
+                                    <group col = "4" colspan = "2">
+                                        <separator string = "Design Information" col = "4" colspan = "4"/>
+                                        <field name = "floor_thickness"/>
+                                        <field name = "floor_durability"/>
+                                        <field name = "floor_acabado"/>
+                                    </group>
+                                </form>
+                                <tree string="Floor Details">
+                                    <field name="floor_number"/>
+                                    <field name="floor_value"/>
+                                    <field name="floor_area"/>
+                                </tree>
+                            </field>
+                        </page>
+                        <!--<page string = "Assets">
+                            <field name = "building_asset_id"/>
+                        </page>-->
+                        <page string = "Machinery">
+                            <group col = "4" colspan = "4">
+                                <separator string = "Machinery" col = "4" colspan = "4"/>
+                                <field name = "building_elevator"/>
+                                <field name = "building_elevators_number" attrs="{'readonly':[('building_elevator','!=','True')]}"/>
+                                <field name = "building_stairs"/>
+                                <field name = "building_stairs_number" attrs="{'readonly':[('building_stairs','!=','True')]}"/>
+                            </group>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
+        
+        
+        <record model = "ir.ui.view" id = "building_tree_view2">
+            <field name = "name">rent.building.tree2</field>
+            <field name = "model">rent.building</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string="Building Details">
+                    <field name="name"/>
+                    <field name="building_estate_id"/>
+                    <field name="building_company_id"/>
+                    <field name="building_date_construction"/>
+                    <field name="building_value"/>
+                    <field name="building_area"/>
+                    <field name = "building_vrn_per_sqr"/>
+                    <field name="building_capacity"/>
+                </tree>
+            </field>
+        </record>
+        
+        
+        <record model ="ir.ui.view" id = "building_form_view2">
+            <field name = "name">rent.building.form2</field>
+            <field name = "model">rent.building</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Building Details">
+                    <group col = "4" colspan = "2">
+                        <separator string = "General Information" col = "4" colspan = "4"/>
+                        <field name = "name" select = "1"/>
+                        <field name = "building_code"/>
+                        <field name = "building_estate_id"/>
+                        <field name = "building_company_id"/>
+                        <field name = "building_date_construction" select = "1"/>
+                        <field name = "building_area"/>
+                        <field name = "building_value"/>
+                        <field name = "building_capacity"/>
+                        <field name = "building_vrn_per_sqr"/>
+                    </group>
+                    <group col = "4" colspan = "2">
+                        <separator string = "Photos" col = "4" colspan = "4"/>
+                        <field name = "building_photo" widget = "image" nolabel="1" img_width="200" img_height="180"  colspan = "4"/>
+                        <field name = "building_gallery_photo" widget = "url" />
+                    </group>
+                    <notebook>
+                        <page string = "Floors">
+                            <field name = "building_floors_ids" mode = "form,tree" nolabel = "1">
+                                <form string = "Floor Details">
+                                    <group col = "4" colspan = "2">
+                                        <separator string = "General Information" col = "4" colspan = "4"/>
+                                        <field name = "floor_number"/>
+                                        <field name = "floor_area"/>
+                                        <field name = "floor_value"/>
+                                    </group>
+                                    <group col = "4" colspan = "2">
+                                        <separator string = "Design Information" col = "4" colspan = "4"/>
+                                        <field name = "floor_thickness"/>
+                                        <field name = "floor_durability"/>
+                                        <field name = "floor_acabado"/>
+                                    </group>
+                                </form>
+                                <tree string="Floor Details">
+                                    <field name="floor_number"/>
+                                    <field name="floor_value"/>
+                                    <field name="floor_area"/>
+                                </tree>
+                            </field>
+                        </page>
+                        <!--<page string = "Assets">
+                            <field name = "building_asset_id"/>
+                        </page>-->
+                        <page string = "Machinery">
+                            <group col = "4" colspan = "4">
+                                <separator string = "Machinery" col = "4" colspan = "4"/>
+                                <field name = "building_elevator"/>
+                                <field name = "building_elevators_number" attrs="{'readonly':[('building_elevator','!=','True')]}"/>
+                                <field name = "building_stairs"/>
+                                <field name = "building_stairs_number" attrs="{'readonly':[('building_stairs','!=','True')]}"/>
+                            </group>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
+        
+        <!--<record model = "ir.actions.act_window" id = "action_building_form_view">
+            <field name = "name">Building Detail</field>
+            <field name = "res_model">rent.building</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "search_view_id" ref = "view_building_filter"/>
+        </record>-->
+        
+        
+        <record id="action_building_form" model="ir.actions.act_window">
+            <field name="name">building</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">rent.building</field>
+            <field name="view_type">form</field>
+            <!--field name="domain">[('building_estate_id.estate_owner_id', '=', uid.company_id.id)]</field-->
+            <field name="help">Manage every parking that belongs to a determined estate. This is the main view where you can create a building record
+            but you can still do it from the estate form</field>
+        </record>
+        
+        <record id="action_building_tree_view2" model="ir.actions.act_window.view">
+            <field name="view_mode">tree</field>
+            <field name="view_id" ref="building_tree_view2"/>
+            <field name="act_window_id" ref="action_building_form"/>
+        </record>
+        
+        <record id="action_building_form_view2" model="ir.actions.act_window.view">
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="building_form_view2"/>
+            <field name="act_window_id" ref="action_building_form"/>
+        </record>
+        
+        <!--
+        ======================================
+                        BUILDING MENU
+        ======================================
+        -->
+        <menuitem id = "rent_building_submenu" name = "Building" parent = "rent_estate_menu" action = "action_building_form" sequence="10"/>
+        
+        <!--
+        ======================================
+                    FLOOR MENU
+        ======================================
+        -->
+        <record id = "view_floor_filter" model = "ir.ui.view">
+            <field name = "name">rent.floor.select</field>
+            <field name = "model">rent.floor</field>
+            <field name = "type">search</field>
+            <field name = "arch" type = "xml">
+                <search string = "Search Floor">
+                    <group>
+                        <field name="floor_building_id"/>
+                    </group>
+                    <group expand = "0" string = "Group By...">
+                        <filter string = "Edificio" icon = "terp-go-home" domain = "[]" context="{'group_by' : 'floor_building_id'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+        
+        <record model ="ir.ui.view" id = "floor_form_view">
+            <field name = "name">rent.floor.form2</field>
+            <field name = "model">rent.floor</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Floor Details">
+                    <group col = "4" colspan = "2">
+                        <separator string = "General Information" col = "4" colspan = "4"/>
+                        <field name = "floor_building_id" select = "1"/>
+                        <field name = "floor_number"/>
+                        <field name = "floor_area"/>
+                        <field name = "floor_value"/>
+                    </group>
+                    <group col = "4" colspan = "2">
+                        <separator string = "Design Information" col = "4" colspan = "4"/>
+                        <field name = "floor_thickness"/>
+                        <field name = "floor_durability"/>
+                        <field name = "floor_acabado"/>
+                    </group>
+                    <notebook colspan = "4">
+                        <!--<page string = "Local">
+                            <field name = "floor_local" nolabel="1"/>
+                        </page>-->
+                        <page string = "Parking">
+                            <field name = "floor_parking_ids" context="{'form_view_ref' : 'rent.parking_form_view', 'tree_view_ref' : 'rent.parking_tree_view'}" nolabel="1"/>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
+
+        <record model = "ir.ui.view" id = "floor_tree_view">
+            <field name = "name">rent.floor.tree</field>
+            <field name = "model">rent.floor</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string="Floor Details">
+                    <field name="complete_name"/>
+                    <field name = "floor_building_id"/>
+                    <field name="floor_value"/>
+                    <field name="floor_area"/>
+                </tree>
+            </field>
+        </record>
+        
+        
+        <record id="action_floor_form" model="ir.actions.act_window">
+            <field name="name">Floors</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">rent.floor</field>
+            <field name="view_type">form</field>
+            <field name = "search_view_id" ref = "view_floor_filter"/>
+            <!--field name="domain">[('floor_building_id.building_estate_id.estate_owner_id','=',uid.company_id.id)]</field-->
+            <field name="help">Manage every floor that belongs to a determined Building. This is the main view where you can create a floor record
+            but you can still do it from the building form</field>
+        </record>
+        <record id="action_floor_form_view1" model="ir.actions.act_window.view">
+            <field eval="10" name="sequence"/>
+            <field name="view_mode">tree</field>
+            <field name="view_id" ref="floor_tree_view"/>
+            <field name="act_window_id" ref="action_floor_form"/>
+        </record>
+        <record id="action_floor_form_view2" model="ir.actions.act_window.view">
+            <field eval="20" name="sequence"/>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="floor_form_view"/>
+            <field name="act_window_id" ref="action_floor_form"/>
+        </record>
+        <!--
+        ======================================
+                    FLOOR MENU
+        ======================================
+        -->
+        <menuitem id = "rent_floor_submenu" name = "Floors" parent = "rent_estate_menu" action = "action_floor_form"/>
+        
+        
+        <!--
+        ======================================
+                    LOCAL
+        ======================================
+        -->
+        <record id = "view_local_filter" model = "ir.ui.view">
+            <field name = "name">rent.floor.local.select</field>
+            <field name = "model">rent.floor.local</field>
+            <field name = "type">search</field>
+            <field name = "arch" type = "xml">
+                <search string = "Search Local">
+                    <group>
+                        <filter string = "Rented" icon = "terp-sale" domain = "[('local_rented','=',True)]"/>
+                        <filter string = "Not Rented" icon = "gtk-cancel" domain = "[('local_rented','=',False)]"/>
+                        <separator orientation="vertical"/>
+                        <field name="local_number"/>
+                        <field name="local_building"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "local_form_view">
+            <field name = "name">rent.floor.local.form</field>
+            <field name = "model">rent.floor.local</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Local Details">
+                    <group col = "4" colspan = "2">
+                        <separator string = "Photos" col = "4" colspan = "4"/>
+                        <field name = "local_photo" widget = "image" nolabel="1" img_width="200" img_height="180" colspan = "4"/>
+                        <field name = "local_gallery_photo" widget = "url" colspan = "4"/>
+                    </group>
+                    <group col = "4" colspan = "2">
+                        <separator string = "General Information"/>
+                        <field name = "local_building"/>
+                        <field name = "local_number"/>
+                        <field name = "local_area"/>
+                        <field name = "local_huella"/>
+                        <separator string = "Miscelanius Information"/>
+                        <!--<field name = "local_sqrmeter_price"/>-->
+                        <field name = "local_rented"/>
+                        <field name = "local_water_meter_number"/>
+                        <field name = "local_light_meter_number"/>
+                    </group>
+                    <notebook>
+                        <page string = "Floor List">
+                            
+                            <field name = "local_local_by_floor_ids" nolabel="1"/>
+                            
+                        </page>
+                        <page string = "Price historic">
+                            <field name = "local_rise_historic_ids" nolabel="1"/>
+                        </page>
+                        <page string = "Notes">
+                            <field name = "local_notes" nolabel="1"/>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "local_tree_view">
+            <field name = "name">rent.floor.local.tree</field>
+            <field name = "model">rent.floor.local</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Local List">
+                    <field name = "local_building"/>
+                    <field name = "local_number"/>
+                    <!--<field name = "local_value"/>-->
+                    <field name = "local_area"/>
+                    <field name = "local_rented"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_local_form_view">
+            <field name = "name">Local Detail</field>
+            <field name = "res_model">rent.floor.local</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "view_id" ref = "local_tree_view"/>
+            <field name = "search_view_id" ref = "view_local_filter"/>            
+            <field name="help">Manage every local that belongs to a determined floor. This is the only view where you can create a floor record</field>
+        </record>
+        
+        <menuitem id = "rent_local_submenu" name = "Locals" parent = "rent_estate_menu" action = "action_local_form_view"/>
+        
+        <!--
+        ======================================
+                    LOCAL BY FLOOR
+        ======================================
+        -->
+        
+        <record model = "ir.ui.view" id = "local_floor_form_view">
+            <field name = "name">rent.local.floor.form</field>
+            <field name = "model">rent.local.floor</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Local Details">
+                    <group col = "4" colspan = "4">
+                        <separator string = "General Information"/>
+                        <field name = "local_floor_floor_id" select = "1" on_change = "onchange_floor(local_floor_floor_id)"/>
+                        <field name = "local_floor_building" select = "1"/>
+                        <!---->
+                    </group>
+                    <group col = "4" colspan = "4">
+                        <separator string = "Floor Specifications"/>
+                        <field name = "local_local_floor_id"/>
+                        <field name = "local_floor_front"/>
+                        <field name = "local_floor_side"/>
+                        <field name = "local_sqrmeter_price"/>
+                        <field name = "local_floor_value"/>
+                        <!---->
+                    </group>
+                </form>
+            </field>
+        </record>
+    
+        <record model = "ir.ui.view" id = "local_floor_tree_view">
+            <field name = "name">rent.local.floor.tree</field>
+            <field name = "model">rent.local.floor</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Location in floor list" editable="bottom">
+                    <field name = "local_floor_building" select = "1" />
+                    <field name = "local_floor_floor_id" select = "1" on_change = "onchange_floor(local_floor_floor_id)"/>
+                    <field name = "local_floor_front"/>
+                    <field name = "local_floor_side"/>
+                    <field name = "local_floor_area"/>
+                    <field name = "local_sqrmeter_price" sum = "Sqr Meter Total"/>
+                    <field name = "local_floor_value" sum = "Total"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_local_floor_form_view">
+            <field name = "name">Local Detail</field>
+            <field name = "res_model">rent.local.floor</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+        </record>
+        
+        <!--
+        ======================================
+                    PARKING
+        ======================================
+        -->
+        <record id = "view_parking_filter" model = "ir.ui.view">
+            <field name = "name">rent.floor.parking.select</field>
+            <field name = "model">rent.floor.parking</field>
+            <field name = "type">search</field>
+            <field name = "arch" type = "xml">
+                <search string = "Search Parking">
+                    <group>
+                        <filter string = "Not Rented" icon = "gtk-cancel" domain = "[('parking_rented','=',False)]"/>
+                        <separator orientation="vertical"/>
+                        <field name="parking_floor_id"/>
+                        <field name="parking_number"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "parking_tree_view">
+            <field name = "name">rent.floor.parking.tree</field>
+            <field name = "model">rent.floor.parking</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Parking List">
+                    <field name = "parking_number"/>
+                    <field name = "parking_value"/>
+                    <field name = "parking_area"/>
+                    <field name = "parking_rented"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "parking_form_view">
+            <field name = "name">rent.floor.parking.form</field>
+            <field name = "model">rent.floor.parking</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Parking Details">
+                    <group col = "4" colspan = "4">
+                        <separator string = "General Information"/>
+                        <field name = "parking_number"/>
+                        <field name = "parking_value"/>
+                        <field name = "parking_sqrmeter_price"/>
+                        <field name = "parking_rented"/>
+                    </group>
+                    <group col = "4" colspan = "4">
+                        <separator string = "Area Specifications Information"/>
+                        <field name = "parking_large"/>
+                        <field name = "parking_width"/> 
+                        <field name = "parking_area"/>
+                        <field name = "parking_huella"/>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "parking_tree_view2">
+            <field name = "name">rent.floor.parking.tree2</field>
+            <field name = "model">rent.floor.parking</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Parking List">
+                    <field name = "parking_floor_building"/>
+                    <field name = "parking_floor_id"/>
+                    <field name = "parking_number"/>
+                    <field name = "parking_value"/>
+                    <field name = "parking_area"/>
+                    <field name = "parking_rented"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "parking_form_view2">
+            <field name = "name">rent.floor.parking.form2</field>
+            <field name = "model">rent.floor.parking</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Parking Details">
+                    <group col = "4" colspan = "4">
+                        <separator string = "General Information"/>
+                        <field name = "parking_floor_building"/>
+                        <field name = "parking_floor_id" on_change="onchange_floor(parking_floor_id)"/>
+                        <field name = "parking_number"/>
+                        <field name = "parking_value"/>
+                        <field name = "parking_sqrmeter_price"/>
+                        <field name = "parking_rented"/>
+                    </group>
+                    <group col = "4" colspan = "4">
+                        <separator string = "Area Specifications Information"/>
+                        <field name = "parking_large"/>
+                        <field name = "parking_width"/> 
+                        <field name = "parking_area"/>
+                        <field name = "parking_huella"/>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record id="action_parking_form" model="ir.actions.act_window">
+            <field name="name">Parking</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">rent.floor.parking</field>
+            <field name="view_type">form</field>
+            <!--field name="domain">[('parking_floor_id.floor_building_id.building_estate_id.estate_owner_id.id','=',user.company_id.id)]</field-->
+            <field name = "search_view_id" ref = "view_parking_filter"/> 
+            <field name="help">Manage every parking that belongs to a determined floor. This is the main view where you can create a parking record
+            but you can still do it from the floor form</field>
+        </record>
+        
+        <record id="action_parking_tree_view1" model="ir.actions.act_window.view">
+            <field name="view_mode">tree</field>
+            <field name="view_id" ref="parking_tree_view2"/>
+            <field name="act_window_id" ref="action_parking_form"/>
+        </record>
+        
+        <record id="action_parking_form_view1" model="ir.actions.act_window.view">
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="parking_form_view2"/>
+            <field name="act_window_id" ref="action_parking_form"/>
+        </record>
+
+        <!--
+        ======================================
+                    PARKING MENU
+        ======================================
+        -->
+        <menuitem id = "rent_parking_submenu" name = "Parking" parent = "rent_estate_menu" action = "action_parking_form" sequence="10"/>
+        <!--
+        ======================================
+                    RENT
+        ======================================
+        -->
+        <record id = "view_rent_rent_filter" model = "ir.ui.view">
+            <field name = "name">rent.rent.select</field>
+            <field name = "model">rent.rent</field>
+            <field name = "type">search</field>
+            <field name = "arch" type = "xml">
+                <search string = "Search Rents">
+                    <group>
+                        <filter string = "Draft" name ="draft" icon = "terp-document-new" domain = "[('state','=','draft')]"/>
+                        <filter string = "Active" name = "active" icon = "terp-camera_test" domain = "[('state','=','active')]" />
+                        <filter string = "Finished" icon = "gtk-cancel" domain = "[('state','=','finished')]"/>
+                        <separator orientation="vertical"/>
+                        <field name="name"/>
+                        <field name="rent_related_real"/>
+                        <field name="rent_start_date"/>
+                        <field name="rent_end_date"/>
+                    </group>
+                    <newline/>
+                    <group colspan="4" expand = "0" string = "Group By...">
+                        <filter string = "Type" icon = "terp-stock_symbol-selection" domain = "[]" context="{'group_by' : 'rent_type'}"/>
+                        <filter string = "Status" icon = "terp-stock_zoom" domain = "[]" context="{'group_by' : 'state'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "rent_form_view">
+            <field name = "name">rent.rent.form</field>
+            <field name = "model">rent.rent</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Rent Detail">
+                    <group col = "4" colspan = "4">
+                        <separator string = "Information" colspan = "4"/>
+                        <field name = "name"/>
+                        <field name = "ref"/>
+                        <field name = "rent_rent_client_id" select  = "1"/>
+                        <field name = "rent_type"/>
+                        <field name = "rent_group_id" />
+                        <field name = "rent_related_real" />
+                        <group colspan = "2" col = "6">
+                            <field name = "active"/>
+                            <field name = "rent_include_water" attrs = "{'invisible' : [('rent_related_real','not in',['local'])], 'readonly' : [('rent_rent_local_id.local_water_meter_number','=','')]}"/>
+                        </group>
+                        <group colspan = "2" col = "6">
+                            <field name = "rent_main_inc"/>
+                            <field name = "company_id"/>
+                        </group>
+                    </group>
+                    <notebook>
+                        <page string = "Rent">
+                            <group col = "4" colspan = "4">
+                                <separator string = "Accounting" colspan = "4"/>
+                                <field name="rent_rent_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"  groups="base.group_extended"/>
+                                <field name="rent_rent_acc_int_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
+                                <field name="rent_inv_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
+                                <field name="rent_inv_water_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
+                            </group>
+                            <group col = "4" colspan = "4">
+                                <field name = "rent_charge_day"/>
+                                <field name = "rent_invoiced_day"/>
+                                <field name = "rent_grace_period"/>
+                                <field name = "rent_years"/>
+                                <field name = "rent_start_date" attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_type','!=','Contract')]}"/>
+                                <field name = "rent_end_date"/>
+                            </group>
+                            <group col = "4" colspan = "2">
+                                <separator string = "Negotiation Information" colspan = "4"/>
+                                <field name = "rent_amount_base"/>
+                                <field name = "rent_total"/>
+                                <field name = "rent_rise_year2"/>
+                                <field name = "rent_performance"/>
+                                <field name = "rent_rise_year3"/>
+                                <field name = "rent_amount_per_sqr"/>
+                                <field name = "rent_rise"/> 
+                                <field name = "rent_rent_real_area"/>
+                                <field name = "rent_deposit"/>
+                                <field name = "currency_id"/>
+                                <!--<field name = "rent_rise_chart_years" on_change = "onchange_rise_years(rent_rise_chart_years,rent_amount_base,rent_rise)"/>-->
+                                <label string = "  "/>
+                                <button name = "calculate_negotiation" string="Compute Values" type="object" icon="terp-stock_format-scientific"/>
+                                <field name = "rent_show_us_eq"/>
+                                <!-- <field name = "rent_rise_chart_ids" nolabel="1" colspan = "4"/> -->                                
+                            </group>
+                            <group col = "4" colspan = "2" attrs = "{'invisible': [('rent_show_us_eq','!=','True')]}">
+                                <separator string = "USD Currency Equivalence" colspan = "4"/>
+                                <field name = "rent_amountd_base"/>
+                                <field name = "rent_total_us"/>
+                                <field name = "rent_rise_year2d"/>
+                                <field name = "rent_amountd_per_sqr"/>
+                                <field name = "rent_rise_year3d"/>
+                                <field name = "eqv_currency_id"/>
+                            </group>
+                            <group col = "4" colspan = "4" attrs = "{'invisible':[('state','!=','finished')]}">
+                                <separator string = "Contract Termination" colspan = "4"/>
+                                <field name = "rent_ending_motif"/>
+                                <field name = "rent_ending_motif_desc"/>
+                            </group>
+                            <notebook>
+                                <page string = "Detail">
+                                    <group col = "4" colspan = "4" attrs = "{'invisible':[('rent_related_real','=','')]}">
+                                        <separator string = "Real Estate Information" colspan = "4"/>
+                                            <field name = "rent_rent_local_id"  attrs = "{ 'required' : [('rent_related_real','=','local'),('state','=','draft')], 'invisible': ['|',('rent_related_real','=',''),('rent_related_real','!=','local')], 'readonly': ['|',('rent_related_real','!=','local'),('state','!=','draft')]}"/>
+                                            <field name = "rent_rent_parking_id" attrs = " { 'required' : [('rent_related_real','=','parking'),('state','=','draft')], 'invisible': ['|',('rent_related_real','=',''),('rent_related_real','!=','parking')], 'readonly': ['|',('rent_related_real','!=','parking'),('state','!=','draft')]}"/>
+                                            <field name = "rent_rent_estate_id"  attrs = " { 'required' : [('rent_related_real','=','estate'),('state','=','draft')], 'invisible': ['|',('rent_related_real','=',''),('rent_related_real','!=','estate')], 'readonly': ['|',('rent_related_real','!=','estate'),('state','!=','draft')]}"/>
+                                    </group>
+                                </page>
+                                <page string = "Calculations">
+                                    <field name = "rent_estimates_ids" nolabel="1"/>
+                                </page>
+                                <page string = "Aumentos" attrs = "{'invisible': [('rent_type','!=','Contract')]}">
+                                    <field name = "rent_historic_ids" nolabel="1"/>
+                                </page>
+                                <page string = "Facturas" attrs = "{'invisible': [('rent_type','!=','Contract')]}">
+                                    <field name = "rent_invoice_ids" nolabel="1"/>
+                                </page>
+                                <page string = "Modifications" attrs = "{'invisible': [('rent_type','!=','Contract')]}">
+                                    <field name = "rent_modif" attrs="{'readonly' : [('rent_type','!=','Contract')]}" 
+                                    default_get = "{
+                                        'rent_type'           : 'Adendum',
+                                        'rent_rent_account_id': rent_rent_account_id,
+                                        'rent_rent_acc_int_id': rent_rent_acc_int_id,
+                                    }"
+                                    nolabel="1"
+                                    context="{'tree_view_ref' : 'rent.rent_adendum_tree_view'}"/>
+                                </page>
+                                <page string = "Notes">
+                                    <field name = "rent_notes" nolabel="1"/>
+                                </page>
+                            </notebook>
+                        </page>
+                        
+                        <page string = "Maintenance">
+                            <group col = "4" colspan = "4">
+                                <separator string = "General Information" colspan = "4"/>
+                                <field name = "rent_main_company_id" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name = "rent_main_start_date" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name = "rent_main_end_date" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                            </group>
+                            <group col = "4" colspan = "4">
+                                <separator string = "Accounting" colspan = "4"/>
+                                <field name="rent_rent_main_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"  groups="base.group_extended" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name="rent_rent_main_acc_int_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name="rent_inv_main_account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended" attrs = "{'readonly' : ['|',('rent_main_inc','!=','True'),('state','!=','draft')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name = "rent_main_charge_day" attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name = "rent_main_invoiced_day" attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name = "rent_main_grace_period" attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                
+                            </group>
+                            <group col = "4" colspan = "2">
+                                <separator string = "Financial Information" colspan = "4"/>
+                                <field name = "rent_main_amount_base"  attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name = "rent_main_total"  attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name = "rent_main_rise_year2"/>
+                                <field name = "rent_main_performance"/>
+                                <field name = "rent_main_rise_year3"/>
+                                <field name = "rent_main_rise"  attrs = "{'readonly' : ['|',('state','!=','draft'),('rent_main_inc','!=','True')], 'required' : [('rent_main_inc','=','True'),('state','!=','draft')]}"/>
+                                <field name = "main_currency_id"/>
+                                <field name = "rent_main_show_us_eq"/>
+                                <label string = "  "/>
+                                <button name = "calculate_negotiation" string="Compute Values" type="object" icon="terp-stock_format-scientific"/>
+                            </group>
+                            <group col = "2" colspan = "2" attrs = "{'invisible': [('rent_main_show_us_eq','!=','True')]}">
+                                <separator string = "USD Currency Equivalence" colspan = "4"/>
+                                <field name = "rent_main_amountd_base"/>
+                                <field name = "rent_main_rise_year2d"/>
+                                <field name = "rent_main_rise_year3d"/>
+                                <field name = "main_eqv_currency_id"/>
+                            </group>
+                            <notebook>
+                                <page string = "Calculations">
+                                    <field name = "rent_main_estimates_ids" nolabel="1"  attrs = "{'readonly' : [('rent_main_inc','!=','True')]}"/>
+                                </page>
+                                <page string = "Aumentos">
+                                    <field name = "rent_main_historic_ids" nolabel="1"/>
+                                </page>
+                                <page string = "Facturas">
+                                    <field name = "rent_main_invoice_ids" nolabel="1"/>
+                                </page>
+                                <page string = "Notes">
+                                    <field name = "main_notes" nolabel="1"/>
+                                </page>
+                            </notebook>
+                        </page>
+                    </notebook>
+                    <group col = "6" colspan = "4">
+                        <field name = "state"/>
+                        <button name = "cron_rent_invoice" string="Check for Invoices" type="object" icon="terp-stock_format-scientific"/>
+                        <button name="rent_finish" states="active" string="Finish" icon="gtk-cancel" attrs = "{'invisible': [('rent_type','!=','Contract')]}"/>
+                        <button name="rent_active" states="draft" string="Approve" icon="terp-camera_test"/>
+                        <button 
+                            name="%(action_view_rent_make_group)d"
+                            string="Create new Group"
+                            type="action"
+                            states="active"
+                            icon="gtk-go-forward"
+                            attrs="{'invisible': ['|',('rent_type', '!=', 'Contract'),('state', '!=', 'active')]}"/>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "rent_tree_view">
+            <field name = "name">rent.rent.tree</field>
+            <field name = "model">rent.rent</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Rent List" colors="blue:state in ('draft');black:state in ('active');gray:state in ('finished')">
+                    <field name = "name"/>
+                    <field name = "rent_type"/>
+                    <field name = "rent_related_real"/>
+                    <field name = "state"/>
+                    <field name = "rent_start_date"/>
+                    <field name = "rent_end_date"/>
+                    <field name = "rent_amount_base"/>
+                    <field name = "rent_rise"/>
+                    <button name="rent_active" states="draft" string="Approve" icon="terp-camera_test"/>
+                    <button name="rent_finish" states="active" string="Finish" icon="gtk-cancel"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "rent_tree_view2">
+            <field name = "name">rent.rent.tree2</field>
+            <field name = "model">rent.rent</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Rent List" colors="blue:state in ('draft');black:state in ('active');gray:state in ('finished')">
+                    <field name = "name"/>
+                    <field name = "rent_rent_client_id"/>
+                    <field name = "rent_related_real"/>
+                    <field name = "rent_amount_base"/>
+                    <field name = "currency_id"/>
+                    <field name = "rent_rise"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "rent_adendum_tree_view">
+            <field name = "name">rent.rent.adendum.tree</field>
+            <field name = "model">rent.rent</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Adendum List" colors="blue:state in ('draft');black:state in ('active');gray:state in ('finished')">
+                    <field name = "rent_type"/>
+                    <field name = "rent_related_real"/>
+                    <field name = "state"/>
+                    <field name = "rent_end_date"/>
+                    <field name = "rent_amount_base"/>
+                    <field name = "rent_rise"/>
+                    <field name = "currency_id"/>
+                    <field name = "rent_modif_date"/>
+                    <button name="rent_active" states="draft" string="Approve" icon="terp-camera_test"/>
+                </tree>
+            </field>
+        </record>
+        <record model = "ir.actions.act_window" id = "action_rent_form_view">
+            <field name = "name">Rent Details</field>
+            <field name = "res_model">rent.rent</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "view_id" ref = "rent_tree_view"/>
+            <field name="domain">[('rent_type','=','Contract')]</field>
+            <field name="context">{"search_default_active":1}</field>
+            <field name = "search_view_id" ref = "view_rent_rent_filter"/>
+        </record>
+        
+        <!--
+        ======================================
+                    RENT MENU
+        ======================================
+        -->
+        <menuitem id = "rent_rent_menu" name = "Rent" parent = "rent_manager"/>
+        <menuitem id = "rent_rent_submenu" name = "Rents" parent = "rent_rent_menu" action = "action_rent_form_view"/>
+        
+        
+        <!--
+        ======================================
+                    RENT estimateS
+        ======================================
+        -->
+        
+        <record model = "ir.ui.view" id = "rent_estimate_tree_view">
+            <field name = "name">rent.rent.estimate.tree</field>
+            <field name = "model">rent.rent.estimate</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree editable = "top" string = "Calculations List" colors="green:estimate_state in ('final');blue:estimate_state in ('recommend');red:estimate_state in ('min');gray:estimate_state in ('norec')">
+                    <field name = "estimate_date"/>
+                    <field name = "estimate_performance"/>
+                    <field name = "estimate_years"/>
+                    <field name = "estimate_amountc"/>
+                    <field name = "estimate_amountd"/>
+                    <field name = "estimate_colones"/>
+                    <field name = "estimate_dollars"/>
+                    <field name = "estimate_state"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "rent_estimate_form_view">
+            <field name = "name">rent.rent.estimate.form</field>
+            <field name = "model">rent.rent.estimate</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Estimates">
+                    <group col="4" colspan="4">
+                        <separator colspan = "4" string = "Calculos"/>
+                        <group>
+                            <field name = "estimate_performance"/>
+                            <field name = "estimate_years"/>
+                        </group>
+                        <group>
+                            <field name = "estimate_amountc"/>
+                            <field name = "estimate_date"/>
+                            <field name = "estimate_colones"/>
+                        </group>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_rent_estimate_form_view">
+            <field name = "name">Calculations Details</field>
+            <field name = "res_model">rent.rent.estimate</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "view_id" ref = "rent_estimate_tree_view"/>
+        </record>
+        
+        
+        
+        
+        <!--
+        ======================================
+                    RENT MAINTENANCE estimateS
+        ======================================
+        -->
+        
+        <record model = "ir.ui.view" id = "rent_main_estimate_tree_view">
+            <field name = "name">rent.rent.main.estimate.tree</field>
+            <field name = "model">rent.rent.main.estimate</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree editable = "top" string = "Calculations List" colors="green:estimate_state in ('final');blue:estimate_state in ('recommend');red:estimate_state in ('min');gray:estimate_state in ('norec')">
+                    <field name = "estimate_date"/>
+                    <field name = "estimate_performance"/>
+                    <field name = "estimate_years"/>
+                    <field name = "estimate_amountc"/>
+                    <field name = "estimate_amountd"/>
+                    <field name = "estimate_colones"/>                  
+                    <field name = "estimate_dollars"/>                  
+                    <field name = "estimate_state"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "rent_main_estimate_form_view">
+            <field name = "name">rent.rent.main.estimate.form</field>
+            <field name = "model">rent.rent.main.estimate.</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Estimates">
+                    <group col="4" colspan="4">
+                        <separator colspan = "4" string = "Calculos"/>
+                        <group>
+                            <field name = "estimate_performance"/>
+                            <field name = "estimate_years"/>
+                        </group>
+                        <group>
+                            <field name = "estimate_amountc"/>
+                            <field name = "estimate_date"/>
+                            <field name = "estimate_colones"/>
+                        </group>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_rent_main_estimate_form_view">
+            <field name = "name">Calculations Details</field>
+            <field name = "res_model">rent.rent.estimate</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "view_id" ref = "rent_main_estimate_tree_view"/>
+        </record>
+        
+        
+        
+        <!--
+        ======================================
+                    RENT History
+        ======================================
+        -->
+        
+        <record model = "ir.ui.view" id = "rent_anual_value_tree_view">
+            <field name = "name">rent.rent.estimate.tree</field>
+            <field name = "model">rent.rent.anual.value</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree  string = "Value History">
+                    <field name = "anual_value_date"/>
+                    <field name = "anual_value_value"/>
+                    <field name = "anual_value_prev_value"/>
+                    <field name = "anual_value_rate"/>                  
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "rent_anual_value_form_view">
+            <field name = "name">rent.rent.estimate.form</field>
+            <field name = "model">rent.rent.anual.value</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Estimates">
+                    <group col="4" colspan="4">
+                        <separator colspan = "4" string = "Calculos"/>
+                        <group>
+                            <field name = "anual_value_value"/>
+                            <field name = "anual_value_rate"/>
+                            <field name = "anual_value_date"/>
+                        </group>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_rent_anual_value_form_view">
+            <field name = "name">Calculations Details</field>
+            <field name = "res_model">rent.rent.anual.value</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "view_id" ref = "rent_anual_value_tree_view"/>
+        </record>
+        
+        <!--
+        ======================================
+                    RENT INVOICE LINE
+        ======================================
+        -->
+        <record model = "ir.ui.view" id = "rent_invoice_form_view">
+            <field name = "name">rent.invoice.form</field>
+            <field name = "model">account.invoice.line</field>
+            <field name = "type">form</field>
+            <field name = "inherit_id" ref = "account.view_invoice_line_form"/>
+            <field name = "arch" type="xml">
+                <data>
+                    <field name="product_id" position="before">
+                        <field name = "invoice_type" on_change = "onchange_type(invoice_type)"/>
+                    </field>
+                    <field name="product_id" position="replace"/>
+                    <field name="uos_id" position="replace"/>
+                    <field name="invoice_type" position="after">
+                        <field name = "invoice_rent_id" on_change="rent_id_change(invoice_rent_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})" attrs="{'invisible' : [('invoice_type','=','product')]}"
+                        context="{'tree_view_ref' : 'rent.rent_tree_view2'}"/>
+                    </field>
+                    <field name="invoice_rent_id" position="after">
+                        <field name = "product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})" attrs="{'invisible' : [('invoice_type','=','rent')]}"/>
+                        <field name="uos_id"  on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})" attrs="{'invisible' : [('invoice_type','=','rent')]}"/>
+                    </field>
+                </data>
+            </field>
+        </record>
+        
+        
+        <!--
+        ======================================
+                    RENT INVOICE
+        ======================================
+        -->
+        <record model = "ir.ui.view" id = "rent_invoices_form_view">
+            <field name = "name">rent.invoice.rent.form</field>
+            <field name = "model">rent.invoice.rent</field>
+            <field name = "type">form</field>
+            <field name = "arch" type="xml">
+                <form string = "Invoices">
+                    <field name="invoice_id"/>
+                    <field name="invoice_date"/>
+                    <field name="invoice_state"/>
+                    <field name="invoice_number"/>
+                    <field name="invouce_residual"/>
+                </form>
+            </field>
+        </record>
+        
+        
+        <record model = "ir.ui.view" id = "rent_invoices_tree_view">
+            <field name = "name">rent.invoice.rent.tree</field>
+            <field name = "model">rent.invoice.rent</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type="xml">
+                <tree string = "Invoices">
+                    <field name="invoice_id"/>
+                    <field name="invoice_date"/>
+                    <field name="invoice_state"/>
+                    <field name="invoice_number"/>
+                    <field name="invouce_residual"/>
+                </tree>
+            </field>
+        </record>
+        <!--
+        ======================================
+                    CONTRACTS
+        ======================================
+        -->
+        <record model = "ir.ui.view" id = "contract_form_view">
+            <field name = "name">rent.contract.form</field>
+            <field name = "model">rent.contract</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Contrato">
+                    <group col = "4" colspan = "4">
+                        <separator colspan = "4" string = "General Data"/>
+                        <field name = "name"/>
+                        <field name = "contract_rent_id" domain = "['|',('state','=','draft'), ('state','=','active'),('rent_type'.'!=','Adendum')]"/>
+                    </group>
+                    <group col = "4" colspan = "4">
+                        <separator colspan = "4" string = "General Data"/>
+                        <field colspan = "4" name = "contract_clauses_ids" nolabel = "1"/>
+                        <!--<field name = "contract_design"/>-->
+                    </group>
+                    <group col="4" colspan="4">
+                        <separator colspan = "4" string = "Legend"/>
+                        <label string = "Use any of the code down to specife where should go special data to be retreived such as partners name, date, and others. Place it in the body of the clause as you need it"/>
+                        <group>
+                            <label colspan="4" string="Client name : %%(cli)s"/>
+                            <label colspan="4" string="Company name: %%(com)s"/>
+                        </group>
+                        <group>
+                            <label colspan="4" string="Total paid: %%(tot)s"/>
+                            <label colspan="4" string="Starting Date: %%(sd)s"/>
+                            <label colspan="4" string="Ending Date: %%(ed)s"/>
+                        </group>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "contract_tree_view">
+            <field name = "name">rent.contract.tree</field>
+            <field name = "model">rent.contract</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Contract">
+                        <field name = "name"/>
+                        <field name = "contract_rent_id"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_contract_form_view">
+            <field name = "name">Contracts</field>
+            <field name = "res_model">rent.contract</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+        </record>
+        
+        <!--
+        ======================================
+                    CONTRACT MENU
+        ======================================
+        -->
+        <!--<menuitem id = "rent_contract_submenu" name = "Contracts" parent = "rent_rent_menu" action = "action_contract_form_view"/>-->
+        
+        <!--
+        ======================================
+                    CLAUSES
+        ======================================
+        -->
+        
+        <record model = "ir.ui.view" id = "contract_clause_form_view">
+            <field name = "name">rent.contract.clause.form</field>
+            <field name = "model">rent.contract.clause</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Clauses">
+                    <group col = "4" colspan = "4">
+                        <separator colspan = "4" string = "Reference Data"/>
+                        <field name = "clause_code" select = "1"/>
+                        <field name = "clause_is_basic" select = "1"/>
+                        <field name = "clause_subject" select = "1"/>
+                        
+                    </group>
+                    <group col = "4" colspan = "4">
+                        <separator colspan = "4" string = "Body"/>
+                        <field name = "clause_body" nolabel="1"/>
+                    </group>
+                    <group col="4" colspan="4">
+                        <separator colspan = "4" string = "Legend"/>
+                        <label string = "Use any of the code down to specife where should go special data to be retreived such as partners name, date, and others. Place it in the body of the clause as you need it"/>
+                        <group>
+                            <label colspan="4" string="Client name : %%(cli)s"/>
+                            <label colspan="4" string="Company name: %%(com)s"/>
+                        </group>
+                        <group>
+                            <label colspan="4" string="Total paid: %%(tot)s"/>
+                            <label colspan="4" string="Starting Date: %%(sd)s"/>
+                            <label colspan="4" string="Ending Date: %%(ed)s"/>
+                        </group>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "contract_clause_tree_view">
+            <field name = "name">rent.contract.clause.tree</field>
+            <field name = "model">rent.contract.clause</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Clause">
+                        <field name = "clause_code" select = "1"/>
+                        <field name = "clause_subject" select = "1"/>
+                        <field name = "clause_is_basic" select = "1"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_contract_clause_form_view">
+            <field name = "name">Clauses</field>
+            <field name = "res_model">rent.contract.clause</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+        </record>
+        
+        <!--
+        ======================================
+                    CONTRACT CLAUSE MENU
+        ======================================
+        -->
+        <!--<menuitem id = "rent_contract_clause_submenu" name = "Clauses" parent = "rent_rent_menu" action = "action_contract_clause_form_view"/>-->
+        
+        <!--
+        ======================================
+                    CLAUSE BY CONTRACT MENU
+        ======================================
+        -->
+        <record model = "ir.ui.view" id = "clause_by_contract_form_view">
+            <field name = "name">clause.contract.clause.rel.form</field>
+            <field name = "model">rent.contract.clause.rel</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Clausula de Contrato">
+                    <field name = "sequence"/>
+                    <field name = "rent_contract_clause_id"/>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "clause_by_contract_tree_view">
+            <field name = "name">clause.contract.clause.rel.tree</field>
+            <field name = "model">rent.contract.clause.rel</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Clausula de Contrato">
+                    <field name = "sequence"/>
+                    <field name = "rent_contract_clause_id"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_clause_by_contract_form_view">
+            <field name = "name">Clause by Contract</field>
+            <field name = "res_model">rent.contract.clause.rel</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "view_id" ref = "clause_by_contract_tree_view"/>
+        </record>
+        
+        
+        <!--
+        ======================================
+                    RENT GROUP
+        ======================================
+        -->
+        <record model = "ir.ui.view" id = "rent_rent_group_form_view">
+            <field name = "name">rent.rent.group.form</field>
+            <field name = "model">rent.rent.group</field>
+            <field name = "type">form</field>
+            <field name = "arch" type = "xml">
+                <form string = "Rent Group">
+                    <group col = "4" colspan = "4">
+                        <separator string = "Details" colspan = "4"/>
+                        <field name = "name"/>
+                    </group>
+                    <group col = "4" colspan = "4">
+                        <separator string = "Rents" colspan = "4"/>
+                        <field name = "rent_rent_ids" context="{'tree_view_ref' : 'rent.rent_tree_view'}" nolabel="1"/>
+                    </group>
+                </form>
+            </field>
+        </record>
+        
+        <record model = "ir.ui.view" id = "rent_rent_group_tree_view">
+            <field name = "name">rent.rent.group.tree</field>
+            <field name = "model">rent.rent.group</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Rent Group List">
+                    <field name = "name"/>
+                    <field name = "rent_rent_ids"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record model = "ir.actions.act_window" id = "action_rent_group_form_view">
+            <field name = "name">Rent Group</field>
+            <field name = "res_model">rent.rent.group</field>
+            <field name = "type">ir.actions.act_window</field>
+            <field name = "view_type">form</field>
+            <field name = "view_mode">tree,form</field>
+            <field name = "view_id" ref = "rent_rent_group_tree_view"/>
+        </record>
+        <menuitem id = "rent_rent_group_submenu" name = "Rent group" parent = "rent_rent_menu" action = "action_rent_group_form_view"/>
+        
+        
+        <!--
+        ======================================
+                    RENT RISE ESTIMATE
+        ======================================
+        -->
+        
+        <record model = "ir.ui.view" id = "rent_rent_group_tree_view">
+            <field name = "name">rent.rise.estimate.tree</field>
+            <field name = "model">rent.rise.estimate</field>
+            <field name = "type">tree</field>
+            <field name = "arch" type = "xml">
+                <tree string = "Rise Estimation">
+                    <field name = "year"/>
+                    <field name = "amount"/>
+                </tree>
+            </field>
+        </record>
+    </data>
 </openerp>
 
 


Follow ups