How to get the xml id of a record?

  • type
      technical
  • info created for version
      14.0
  • mvc
      Python (models/controllers)
Add to Cart

Not sure if _get_external_ids() should be called because it's a protected method, but this is a way to fetch the xml id for a record. Beware ... it doesn't mean an xml id exists for the record, so first check for existence before assuming there is a first value in the returned list ([0]).

model_id.record_id._get_external_ids().get(model_id.record_id.id)[0]