title: domain filter for many2one fields in odoo?
body: <p>Below code is asset inherited class . Here i will add <strong>'place'</strong> field with <strong>'Karn/Bang/Kengeri'</strong>  and <strong>'karn/bang/malleshwaram'</strong>  for  'Karn/Bang/Kengeri' will add 'asset_catg_id' with A and B. then for 'karn/bang/malleshwaram' with Y and Z. </p>
  
  <p>Now at calander inherited class . if i select <strong>'place'</strong> with <strong>'Karn/Bang/Kengeri'</strong> then next field <strong>'asset_catg_id'</strong> i have to get only <strong>A and B</strong> drop down list. if again <strong>'karn/bang/malleshwaram'</strong> then i have to get only <strong>Y,Z</strong> options . and previous selected <strong>'asset_catg_id'</strong> values should get deleted . i have tried with domain filter option got <strong>keyvalue error</strong></p>
  
  <pre><code>class asset_asset(osv.osv):
      _inherit = "asset.asset"
      #_name = "asset_asset"
      _rec_name= "folio_num"
      _columns = {
          'name': fields.char('Asset Name', size=64),
          'place': fields.many2one('asset.parentlocation', 'Location'),
          'asset_catg_id' : fields.many2one('asset.catg', 'Asset Catg Selection', select=True, required=True),}
  
  class asset_catg(osv.Model): 
      _name="asset.catg" 
      _rec_name='name1'
      _description="Define Asset Catgs" 
      _columns={ 'name1':fields.char('Asset Catg Names',size=64,required=True),}
  asset_catg()
  class asset_parentlocation(osv.osv):
      _name="asset.parentlocation"
      _rec_name="location_name"
      _columns = {
          'location_name' : fields.char('Asset Location', required=True),
          'parent_location' : fields.many2one('asset.parentlocation','Parent Location'),
          'nameee':fields.many2one('ir.attachment','Attachments'),}
  
      def name_get(self, cr, uid, ids, context=None):
          if context is None:
              context = {}
          if not ids:
              return []
          reads = self.read(cr, uid, ids, ['location_name','parent_location'], context=context)
          res = []
          for record in reads:
              name = record['location_name']
              if record['parent_location']:
                  name = record['parent_location'][1]+' / '+name
              res.append((record['id'], name))
          return res
  
  
  
  **Following code is calendar inherited class** 
  
  
  class calendar_event(osv.osv):
  
      _inherit = "calendar.event"
      _rec_name = 'number'
  
      _columns = {
              'number' : fields.char('Meeting ID',readonly=1),
              #'place' : fields.many2one('stock.location','Substation Location',),
  
              'place' : fields.many2one('asset.parentlocation','Substation Location',),
              #'location' : fields.selection(STATUS_SELECTION,'Location',  default='Board A'),
              'asset_catg_id' : fields.many2one('asset.catg','Asset Catg Selection', domain="[('asset_catg_id', '=',place)]"),}
  </code></pre>