← Back to team overview

clearcorp team mailing list archive

[Merge] lp:~juan-munoz-clearcorp/openerp-ccorp-addons/958016-rent-6.1 into lp:openerp-ccorp-addons/6.1

 

Juan Felipe Muñoz Ramos has proposed merging lp:~juan-munoz-clearcorp/openerp-ccorp-addons/958016-rent-6.1 into lp:openerp-ccorp-addons/6.1.

Requested reviews:
  CLEARCORP development team (clearcorp)

For more details, see:
https://code.launchpad.net/~juan-munoz-clearcorp/openerp-ccorp-addons/958016-rent-6.1/+merge/99117

Migration to OpenERP 6.1
Changes:
        Removed import debug and debug metods calls
-- 
https://code.launchpad.net/~juan-munoz-clearcorp/openerp-ccorp-addons/958016-rent-6.1/+merge/99117
Your team CLEARCORP development team is requested to review the proposed merge of lp:~juan-munoz-clearcorp/openerp-ccorp-addons/958016-rent-6.1 into lp:openerp-ccorp-addons/6.1.
=== modified file 'account_voucher_payment_method/account_voucher_payment_method.py'
--- account_voucher_payment_method/account_voucher_payment_method.py	2012-03-17 21:50:30 +0000
+++ account_voucher_payment_method/account_voucher_payment_method.py	2012-03-23 20:51:18 +0000
@@ -57,6 +57,7 @@
 		for l in line_cr_ids:
 			credit += l['amount']
 		return abs(amount - abs(credit - debit))
+<<<<<<< TREE
 
 	#def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
 		#"""price
@@ -200,6 +201,151 @@
 		##debug(default)
 		#return default
 
+=======
+	
+	def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
+		"""price
+		Returns a dict that contains new values and context
+
+		@param partner_id: latest value from user input for field partner_id
+		@param args: other arguments
+		@param context: context arguments, like lang, time zone
+
+		@return: Returns a dict which contains new values, and context
+		"""
+		if context is None:
+			context = {}
+		if not journal_id:
+			return {}
+		context_multi_currency = context.copy()
+		if date:
+			context_multi_currency.update({'date': date})
+
+		line_pool = self.pool.get('account.voucher.line')
+		line_ids = ids and line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) or False
+		if line_ids:
+			line_pool.unlink(cr, uid, line_ids)
+
+		currency_pool = self.pool.get('res.currency')
+		move_line_pool = self.pool.get('account.move.line')
+		partner_pool = self.pool.get('res.partner')
+		journal_pool = self.pool.get('account.journal')
+
+		vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context)
+		vals = vals.get('value')
+		currency_id = vals.get('currency_id', currency_id)
+		default = {
+			'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id':currency_id},
+		}
+
+		if not partner_id:
+			#debug("DEFAULT EN EL IF SIN PARTNER")
+			#debug(default)
+			return default
+
+		if not partner_id and ids:
+			line_ids = line_pool.search(cr, uid, [('voucher_id', '=', ids[0])])
+			if line_ids:
+				line_pool.unlink(cr, uid, line_ids)
+			return default
+
+		journal = journal_pool.browse(cr, uid, journal_id, context=context)
+		partner = partner_pool.browse(cr, uid, partner_id, context=context)
+		account_id = False
+		if journal.type in ('sale','sale_refund'):
+			account_id = partner.property_account_receivable.id
+		elif journal.type in ('purchase', 'purchase_refund','expense'):
+			account_id = partner.property_account_payable.id
+		else:
+			account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
+
+		default['value']['account_id'] = account_id
+
+		if journal.type not in ('cash', 'bank','payment'):
+			#debug("DEFAULT EN EL IF journal no de dinero banco o pagos")
+			#debug(default)
+			return default
+
+		total_credit = 0.0
+		total_debit = 0.0
+		account_type = 'receivable'
+		if ttype == 'payment':
+			account_type = 'payable'
+			total_debit = price or 0.0
+		else:
+			total_credit = price or 0.0
+			account_type = 'receivable'
+
+		if not context.get('move_line_ids', False):
+			domain = [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id), ('journal_id.payment_method','=',False)]
+			if context.get('invoice_id', False):
+				domain.append(('invoice', '=', context['invoice_id']))
+			ids = move_line_pool.search(cr, uid, domain, context=context)
+			#debug("no encuentra movelines en el contexto")
+			#debug(ids)
+		else:
+			ids = context['move_line_ids']
+			#debug("SI encuentra movelines en el contexto")
+			#debug(ids)
+		ids.reverse()
+		moves = move_line_pool.browse(cr, uid, ids, context=context)
+
+		company_currency = journal.company_id.currency_id.id
+		if company_currency != currency_id and ttype == 'payment':
+			total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit, context=context_multi_currency)
+		elif company_currency != currency_id and ttype == 'receipt':
+			total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit, context=context_multi_currency)
+
+		for line in moves:
+			if line.credit and line.reconcile_partial_id and ttype == 'receipt':
+				continue
+			if line.debit and line.reconcile_partial_id and ttype == 'payment':
+				continue
+			total_credit += line.credit or 0.0
+			total_debit += line.debit or 0.0
+		for line in moves:
+			if line.credit and line.reconcile_partial_id and ttype == 'receipt':
+				continue
+			if line.debit and line.reconcile_partial_id and ttype == 'payment':
+				continue
+			original_amount = line.credit or line.debit or 0.0
+			amount_unreconciled = currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, abs(line.amount_residual_currency), context=context_multi_currency)
+			rs = {
+				'name':line.move_id.name,
+				'type': line.credit and 'dr' or 'cr',
+				'move_line_id':line.id,
+				'account_id':line.account_id.id,
+				'amount_original': currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, line.currency_id and abs(line.amount_currency) or original_amount, context=context_multi_currency),
+				'date_original':line.date,
+				'date_due':line.date_maturity,
+				'amount_unreconciled': amount_unreconciled,
+			}
+
+			if line.credit:
+				amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_debit), context=context_multi_currency))
+				rs['amount'] = amount
+				total_debit -= amount
+			else:
+				amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_credit), context=context_multi_currency))
+				rs['amount'] = amount
+				total_credit -= amount
+
+			default['value']['line_ids'].append(rs)
+			if rs['type'] == 'cr':
+				default['value']['line_cr_ids'].append(rs)
+			else:
+				default['value']['line_dr_ids'].append(rs)
+
+			if ttype == 'payment' and len(default['value']['line_cr_ids']) > 0:
+				default['value']['pre_line'] = 1
+			elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0:
+				default['value']['pre_line'] = 1
+			default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price)
+		#debug(price)
+		#debug(default)
+		return default
+	
+>>>>>>> MERGE-SOURCE
 	def proforma_voucher_mirror(self, cr, uid, ids, context=None):
 		super(account_voucher_journal_payment, self).action_move_line_create(cr, uid, ids, context=context)
 		voucher = self.browse(cr,1,ids,context=context)[0]

=== renamed directory 'TODO-6.1/rent' => 'rent'
=== modified file 'rent/rent.py'
--- TODO-6.1/rent/rent.py	2012-01-13 21:46:01 +0000
+++ rent/rent.py	2012-03-23 20:51:18 +0000
@@ -20,7 +20,7 @@
 #
 ##############################################################################
 from osv import osv, fields
-from tools import debug
+#from tools import #debug
 import time
 import pooler
 from dateutil import parser
@@ -461,10 +461,10 @@
 	#		return []
 	#	reads = self.read(cr, uid, ids, ['parking_number','parking_floor_id'], context=context)
 	#	res = []
-	#	debug('NOMBREPARKEO+==================================')
+	#	#debug('NOMBREPARKEO+==================================')
 	#	for record in reads:
-	#		debug(record)
-	#		debug(record['parking_floor_id'][1])
+	#		#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']
@@ -657,8 +657,8 @@
 		#			'rent_modif_ref' : False,
 		#			'rent_type'      : 'Contract',
 		#		})
-		#		debug(org_rent)
-		#		debug(vals)
+		#		#debug(org_rent)
+		#		#debug(vals)
 		#		self.write(cr,uid,[rent_id],vals)
 		except:
 			print ''
@@ -884,7 +884,7 @@
 		res = {}
 		journal_obj = self.pool.get('account.journal')
 		il = []
-		debug(first_inv)
+		#debug(first_inv)
 
 		for rlist in args:
 			obj_rent = self.browse(cr,uid,rlist['rent_id'])
@@ -901,7 +901,7 @@
 		
 		#Determines if today is the previous month for the invoice creation
 		today = current_date
-		debug(today)
+		#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))
@@ -959,7 +959,7 @@
 		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")
+			#debug("TIENE COBRO DE AGUA")
 			self.invoice_services(cr,uid,[obj_rent.id],inv)
 		
 		return res
@@ -967,7 +967,7 @@
 	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')
+		#debug('GENERACION DE PRIMER PAGO')
 		res = []
 		for obj_rent in ids:
 			today = current_date
@@ -982,7 +982,7 @@
 			
 			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)
+			#debug(res)
 			self.invoice_rent(cr,uid,ids,res,type,first_inv=True)
 		return True
 	
@@ -1015,29 +1015,29 @@
 							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)
+						#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")
+							#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")
+							#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")
+							#	#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))
+							#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)
+					#debug("veces iteradas")
+					#debug(i)
+					#debug(is_required)
 			res[obj_rent.id] = is_required
 		return res
 	
@@ -1052,12 +1052,12 @@
 		#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')
+		#debug('GENERACION DE Pago Normal')
 		res = {}
 		res_deposit_fix = []
 		for obj_rent in ids:
 			res_dob_inv = []
-			debug(current_date)
+			#debug(current_date)
 			today = current_date
 			
 			if type=='rent':
@@ -1097,7 +1097,7 @@
 	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')
+		#debug('INVOICE FOR SERVICES')
 		il = []
 		rlist = {
 			'amount' : 0.0,
@@ -1159,7 +1159,7 @@
 			'date'   : end_date,
 			'desc'   : desc,
 		}
-		debug(res)
+		#debug(res)
 		return res
 		
 	def day_invoice_check(self,cr,uid):
@@ -1171,11 +1171,11 @@
 		#gets the list of all active rents
 		rent_ids = self.search(cr,uid,[('state','=','active'),('rent_type','=','Contract')])
 		date_list = []
-		debug('CRONJOB FORCED TEST')
+		#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)
+		#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])
@@ -1184,19 +1184,19 @@
 			#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)
+		#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)
+		#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")
+			#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:
@@ -1254,10 +1254,10 @@
 	def test_negotiation(self,cr,uid,ids,context=None):
 		test_ids = self.search(cr,uid,[('state','=','draft')])
 		res_deposit_fix = []
-		debug("ENTRAAAAAAAAAA")
+		#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)
+		#debug(res_deposit_fix)
 		self._check_deposit(cr,uid,res_deposit_fix,context=context)
 		return True
 	
@@ -1274,8 +1274,8 @@
 		
 	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)
+		#debug(rent_ids)
+		#debug(ids)
 		for rent_aden_id in rent_ids:
 			vals = self.copy_data(cr,uid,rent_aden_id)
 			if vals:
@@ -1304,7 +1304,7 @@
 		
 	def action_first_invoice(self,cr,uid,ids,context=None):
 		#gets the list of all active rents
-		debug(ids)
+		#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 = []
@@ -1344,8 +1344,8 @@
 	
 	def onchange_calculate_exchange(self,cr,uid,ids,field):
 		res = {}
-		#debug('ONCHANGE')
-		#debug(ids)
+		##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)
@@ -1447,12 +1447,12 @@
 		amount_base = base
 		years = field or 4
 		for x in range(1,years):
-			debug(x)
+			#debug(x)
 			amount_base	= amount_base * (1 + float(percentaje) / 100)
 			lines.append({'year' : x+1, 'amount' : amount_base})
-		debug(lines)
+		#debug(lines)
 		res['rent_rise_chart_ids'] = lines
-		debug(res)
+		#debug(res)
 		return {'value' : res}
 	
 	_columns = {
@@ -1673,7 +1673,7 @@
 			amounts_val = {}
 			
 			currency_id = obj_rent.main_currency_id or obj_rent.currency_id
-			debug(currency_id)
+			#debug(currency_id)
 			rate_cr = currency_id.rate
 			rate_us = 1
 			total = obj_estimate.estimate_maintenance_id.rent_main_total
@@ -1688,7 +1688,7 @@
 			
 			currencies_val = {}
 			valor = obj_rent._get_total_area(obj_rent.id,None,None)[obj_rent.id]
-			debug(valor)
+			#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
@@ -1736,7 +1736,7 @@
 	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)
+		#debug(rent)
 		if rent:
 			obj_rent = self.pool.get('rent.rent').browse(cr, uid, rent, context=context)
 			res['name'] = obj_rent.name
@@ -1804,11 +1804,11 @@
 	_name = 'rent.contract'
 	
 	def create(self,cr,uid, vals,context=None):
-		debug("============================CREANDO EL NUEVO CONTRATO")
+		#debug("============================CREANDO EL NUEVO CONTRATO")
 		contract_id = super(rent_contract,self).create(cr,uid,vals,context)
-		debug(contract_id)
+		#debug(contract_id)
 		obj_contract = self.pool.get('rent.contract').browse(cr,uid,contract_id)
-		debug(obj_contract)
+		#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):

=== modified file 'rent/rent_view.xml'
--- TODO-6.1/rent/rent_view.xml	2012-01-06 22:46:01 +0000
+++ rent/rent_view.xml	2012-03-23 20:51:18 +0000
@@ -281,7 +281,7 @@
 			<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="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>
@@ -500,7 +500,7 @@
 			<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="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>
@@ -597,7 +597,7 @@
 			<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="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>
@@ -873,7 +873,7 @@
 			<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="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>

=== modified file 'rent/security/rent_security.xml'
--- TODO-6.1/rent/security/rent_security.xml	2011-12-05 17:47:04 +0000
+++ rent/security/rent_security.xml	2012-03-23 20:51:18 +0000
@@ -8,5 +8,43 @@
 	<record id="group_rent_manager" model="res.groups">
 		<field name="name">Rent / Manager</field>
 	</record>
+    
+    <record id="rent_parking_multi-company" model="ir.rule">
+        <field name="name">Parking multi-company</field>
+        <field ref="rent.model_rent_floor_parking" name="model_id"/>
+        <field eval="True" name="global"/>
+        <field name="domain_force">['|',('parking_floor_id.floor_building_id.building_estate_id.estate_owner_id.id','=',False),('parking_floor_id.floor_building_id.building_estate_id.estate_owner_id.id','child_of',[user.company_id.id])]</field>
+    </record>
+    
+    <record id="rent_estate_multi-company" model="ir.rule">
+        <field name="name">Estate multi-company</field>
+        <field ref="rent.model_rent_estate" name="model_id"/>
+        <field eval="True" name="global"/>
+        <field name="domain_force">['|',('estate_owner_id','=',False),('estate_owner_id','child_of',[user.company_id.id])]</field>
+    </record>
+    
+    <record id="rent_building_multi-company" model="ir.rule">
+        <field name="name">Building multi-comepany</field>
+        <field ref="rent.model_rent_building" name="model_id"/>
+        <field eval="True" name="global"/>
+        <field name="domain_force">['|',('building_estate_id.estate_owner_id','=',False),('building_estate_id.estate_owner_id','child_of',[user.company_id.id])]</field>
+    </record>
+    
+    <record id="rent_floor_multi-company" model="ir.rule">
+        <field name="name">Floor multi-company</field>
+        <field ref="rent.model_rent_floor" name="model_id"/>
+        <field eval="True" name="global"/>
+        <field name="domain_force">['|',('floor_building_id.building_estate_id.estate_owner_id','=',False),('floor_building_id.building_estate_id.estate_owner_id','child_of',[user.company_id.id])]</field>
+    </record>
+    
+    
+    <!--record id="rent_rent_multi-company" model="ir.rule">
+        <field name="name">Rent multi-company</field>
+        <field ref="rent.model_rent_rent_rent" name="model_id"/>
+        <field eval="True" name="global"/>
+        <field name="domain_force">['|',('floor_building_id.building_estate_id.estate_owner_id','=',False),('floor_building_id.building_estate_id.estate_owner_id','child_of',[user.company_id.id])]</field>
+    </record-->
+    
+    
 	</data>
 </openerp>

=== modified file 'rent/wizard/rent_check_invoicing.py'
--- TODO-6.1/rent/wizard/rent_check_invoicing.py	2012-01-06 15:59:36 +0000
+++ rent/wizard/rent_check_invoicing.py	2012-03-23 20:51:18 +0000
@@ -22,7 +22,7 @@
 from osv import fields, osv
 from tools.translate import _
 import netsvc
-from tools import debug
+#from tools import debug
 from dateutil import parser
 
 class rent_check_invoicing(osv.osv_memory):
@@ -57,7 +57,7 @@
 				arch1 = """<form string="Check rent invoicing to date">\n<separator string="Check Rent Invoicing" colspan="4"/>\n"""
 				arch2 = """\n<group colspan="4" col="6">\n<button icon="gtk-cancel" special="cancel" string="Close"/>\n<button icon="terp-camera_test" string="Check Invoicing" name="check_invoicing" type="object" default_focus="1"/>\n</group>\n</form>"""
 				arch_total = arch1 + desc + arch2
-				debug(arch_total)
+				#debug(arch_total)
 				res['arch'] = arch_total
 			except:
 				return res

=== modified file 'rent/wizard/rent_make_group.py'
--- TODO-6.1/rent/wizard/rent_make_group.py	2011-12-05 17:47:04 +0000
+++ rent/wizard/rent_make_group.py	2012-03-23 20:51:18 +0000
@@ -22,7 +22,7 @@
 from osv import fields, osv
 from tools.translate import _
 import netsvc
-from tools import debug
+#from tools import debug
 
 class rent_make_group(osv.osv_memory):
 	_name = "rent.make.group"
@@ -72,7 +72,7 @@
 						'obj_rent' : o.id,
 				}
 			newgrp = obj_group.create(cr,uid,vals,context)
-			debug(newgrp)
+			#debug(newgrp)
 			o.write({'rent_group_id':newgrp})
 		return {'type': 'ir.actions.act_window_close'}
 rent_make_group()


Follow ups