Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to check company unique or not in openerp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 204
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: