To configure and check weather the company is single or double in openerp you have to write this function in your own module in .py file,
def check&_companyuniq(self, cr, uid, ids, context=None):
sr_id = self.search(cr,uid,[],context=context)
lines = self.browse(cr, uid, sr_id, context=context)
company = []
for l in lines:
if l.company_id.id in company:
return False
if l.company_id.id not in company:
company.append(l.company_id.id)
return True
_constraints = [
(check_company_uniq, 'Only One Followup by Company.',['company_id'] )
]
0 Comment(s)