[MERGE] YAML: Support m2o None value, courtesy of Dmitrijs Ledkovs (credativ)
authorOlivier Dony <odo@openerp.com>
Thu, 24 Nov 2011 15:32:33 +0000 (16:32 +0100)
committerOlivier Dony <odo@openerp.com>
Thu, 24 Nov 2011 15:32:33 +0000 (16:32 +0100)
bzr revid: odo@openerp.com-20111124153233-4vpb6k1c3ksllsfd

1  2 
openerp/tools/yaml_import.py

@@@ -166,11 -164,11 +166,11 @@@ class YamlInterpreter(object)
              self.logger.log(logging.ERROR, 'id: %s is to long (max: 64)', id)
  
      def get_id(self, xml_id):
-         if xml_id is False:
 -        if xml_id == None:
 -            return None
 -        if not xml_id:
 -            raise YamlImportException("The xml_id should be a non empty string.")
 -        if isinstance(xml_id, types.IntType):
++        if xml_id is False or xml_id is None:
 +            return False
 +        #if not xml_id:
 +        #    raise YamlImportException("The xml_id should be a non empty string.")
 +        elif isinstance(xml_id, types.IntType):
              id = xml_id
          elif xml_id in self.id_map:
              id = self.id_map[xml_id]