Toggle navigation

Data Files

Odoo is greatly data-driven, and a big part of modules definition is thus the definition of the various records it manages: UI (menus and views), security (access rights and access rules), reports and plain data are all defined via records.

Structure

The main way to define data in Odoo is via XML data files: The broad structure of an XML data file is the following:

  • Any number of operation elements within the root element odoo
<!-- the root elements of the data file -->
<odoo>
  <operation/>
  ...
</odoo>

Data files are executed sequentially, operations can only refer to the result of operations defined previously

Core operations

record

record appropriately defines or updates a database record, it has the following attributes:

model (required)
name of the model to create (or update)
id

the external identifier for this record. It is strongly recommended to provide one

  • for record creation, allows subsequent definitions to either modify or refer to this record
  • for record modification, the record to modify
context
context to use when creating the record
forcecreate

in update mode whether the record should be created if it doesn’t exist

Requires an external id, defaults to True.

field

Each record can be composed of field tags, defining values to set when creating the record. A record with no field will use all default values (creation) or do nothing (update).

A field has a mandatory name attribute, the name of the field to set, and various methods to define the value itself:

Nothing
if no value is provided for the field, an implicit False will be set on the field. Can be used to clear a field, or avoid using a default value for the field.
search

for relational fields, should be a domain on the field’s model.

Will evaluate the domain, search the field’s model using it and set the search’s result as the field’s value. Will only use the first result if the field is a Many2one

ref

if a ref attribute is provided, its value must be a valid external id, which will be looked up and set as the field’s value.

Mostly for Many2one and Reference fields

type

if a type attribute is provided, it is used to interpret and convert the field’s content. The field’s content can be provided through an external file using the file attribute, or through the node’s body.

Available types are:

xml, html
extracts the field’s children as a single document, evaluates any external id specified with the form %(external_id)s. %% can be used to output actual % signs.
file
ensures that the field content is a valid file path in the current model, saves the pair module,path as the field value
char
sets the field content directly as the field’s value without alterations
base64
base64-encodes the field’s content, useful combined with the file attribute to load e.g. image data into attachments
int
converts the field’s content to an integer and sets it as the field’s value
float
converts the field’s content to a float and sets it as the field’s value
list, tuple
should contain any number of value elements with the same properties as field, each element resolves to an item of a generated tuple or list, and the generated collection is set as the field’s value
eval

for cases where the previous methods are unsuitable, the eval attributes simply evaluates whatever Python expression it is provided and sets the result as the field’s value.

The evaluation context contains various modules (time, datetime, timedelta, relativedelta), a function to resolve external identifiers (ref) and the model object for the current field if applicable (obj)

delete

The delete tag can remove any number of records previously defined. It has the following attributes:

model (required)
the model in which a specified record should be deleted
id
the external id of a record to remove
search
a domain to find records of the model to remove

id and search are exclusive

function

The function tag calls a method on a model, with provided parameters. It has two mandatory parameters model and name specifying respectively the model and the name of the method to call.

Parameters can be provided using eval (should evaluate to a sequence of parameters to call the method with) or value elements (see list values).

Shortcuts

Because some important structural models of Odoo are complex and involved, data files provide shorter alternatives to defining them using record tags:

template

Creates a QWeb view requiring only the arch section of the view, and allowing a few optional attributes:

id
the view’s external identifier
name, inherit_id, priority
same as the corresponding field on ir.ui.view (nb: inherit_id should be an external identifier)
primary
if set to True and combined with a inherit_id, defines the view as a primary
groups
comma-separated list of group external identifiers
page
if set to "True", the template is a website page (linkable to, deletable)
optional
enabled or disabled, whether the view can be disabled (in the website interface) and its default status. If unset, the view is always enabled.

report

Creates a ir.actions.report record with a few default values.

Mostly just proxies attributes to the corresponding fields on ir.actions.report, but also automatically creates the item in the More menu of the report’s model.

CSV data files

XML data files are flexible and self-descriptive, but very verbose when creating a number of simple records of the same model in bulk.

For this case, data files can also use csv, this is often the case for access rights:

  • the file name is model_name.csv
  • the first row lists the fields to write, with the special field id for external identifiers (used for creation or update)
  • each row thereafter creates a new record

Here’s the first lines of the data file defining US states res.country.state.csv

"id","country_id:id","name","code"
state_au_1,au,"Australian Capital Territory","ACT"
state_au_2,au,"New South Wales","NSW"
state_au_3,au,"Northern Territory","NT"
state_au_4,au,"Queensland","QLD"
state_au_5,au,"South Australia","SA"
state_au_6,au,"Tasmania","TAS"
state_au_7,au,"Victoria","VIC"
state_au_8,au,"Western Australia","WA"
state_us_1,us,"Alabama","AL"
state_us_2,us,"Alaska","AK"
state_us_3,us,"Arizona","AZ"
state_us_4,us,"Arkansas","AR"
state_us_5,us,"California","CA"
state_us_6,us,"Colorado","CO"

rendered in a more readable format:

idcountry_id:idnamecode
state_au_1auAustralian Capital TerritoryACT
state_au_2auNew South WalesNSW
state_au_3auNorthern TerritoryNT
state_au_4auQueenslandQLD
state_au_5auSouth AustraliaSA
state_au_6auTasmaniaTAS
state_au_7auVictoriaVIC
state_au_8auWestern AustraliaWA
state_us_1usAlabamaAL
state_us_2usAlaskaAK
state_us_3usArizonaAZ
state_us_4usArkansasAR
state_us_5usCaliforniaCA
state_us_6usColoradoCO
state_us_7usConnecticutCT
state_us_8usDelawareDE
state_us_9usDistrict of ColumbiaDC
state_us_10usFloridaFL
state_us_11usGeorgiaGA
state_us_12usHawaiiHI
state_us_13usIdahoID
state_us_14usIllinoisIL
state_us_15usIndianaIN
state_us_16usIowaIA
state_us_17usKansasKS
state_us_18usKentuckyKY
state_us_19usLouisianaLA
state_us_20usMaineME
state_us_21usMontanaMT
state_us_22usNebraskaNE
state_us_23usNevadaNV
state_us_24usNew HampshireNH
state_us_25usNew JerseyNJ
state_us_26usNew MexicoNM
state_us_27usNew YorkNY
state_us_28usNorth CarolinaNC
state_us_29usNorth DakotaND
state_us_30usOhioOH
state_us_31usOklahomaOK
state_us_32usOregonOR
state_us_33usMarylandMD
state_us_34usMassachusettsMA
state_us_35usMichiganMI
state_us_36usMinnesotaMN
state_us_37usMississippiMS
state_us_38usMissouriMO
state_us_39usPennsylvaniaPA
state_us_40usRhode IslandRI
state_us_41usSouth CarolinaSC
state_us_42usSouth DakotaSD
state_us_43usTennesseeTN
state_us_44usTexasTX
state_us_45usUtahUT
state_us_46usVermontVT
state_us_47usVirginiaVA
state_us_48usWashingtonWA
state_us_49usWest VirginiaWV
state_us_50usWisconsinWI
state_us_51usWyomingWY
state_us_asusAmerican SamoaAS
state_us_fmusFederated States of MicronesiaFM
state_us_guusGuamGU
state_us_mhusMarshall IslandsMH
state_us_mpusNorthern Mariana IslandsMP
state_us_pwusPalauPW
state_us_prusPuerto RicoPR
state_us_viusVirgin IslandsVI
state_us_aausArmed Forces AmericasAA
state_us_aeusArmed Forces EuropeAE
state_us_apusArmed Forces PacificAP
state_br_acbrAcreAC
state_br_albrAlagoasAL
state_br_apbrAmapáAP
state_br_ambrAmazonasAM
state_br_babrBahiaBA
state_br_cebrCearáCE
state_br_dfbrDistrito FederalDF
state_br_esbrEspírito SantoES
state_br_gobrGoiásGO
state_br_mabrMaranhãoMA
state_br_mtbrMato GrossoMT
state_br_msbrMato Grosso do SulMS
state_br_mgbrMinas GeraisMG
state_br_pabrParáPA
state_br_pbbrParaíbaPB
state_br_prbrParanáPR
state_br_pebrPernambucoPE
state_br_pibrPiauíPI
state_br_rjbrRio de JaneiroRJ
state_br_rnbrRio Grande do NorteRN
state_br_rsbrRio Grande do SulRS
state_br_robrRondôniaRO
state_br_rrbrRoraimaRR
state_br_scbrSanta CatarinaSC
state_br_spbrSão PauloSP
state_br_sebrSergipeSE
state_br_tobrTocantinsTO
state_ru_adruRepublic of AdygeyaAD
state_ru_alruAltai RepublicAL
state_ru_altruAltai KraiALT
state_ru_amuruAmur OblastAMU
state_ru_arkruArkhangelsk OblastARK
state_ru_astruAstrakhan OblastAST
state_ru_baruRepublic of BashkortostanBA
state_ru_belruBelgorod OblastBEL
state_ru_bryruBryansk OblastBRY
state_ru_buruRepublic of BuryatiaBU
state_ru_ceruChechen RepublicCE
state_ru_cheruChelyabinsk OblastCHE
state_ru_churuChukotka Autonomous OkrugCHU
state_ru_curuChuvash RepublicCU
state_ru_daruRepublic of DagestanDA
state_ru_inruRepublic of IngushetiaIN
state_ru_irkruIrkutsk OblastIRK
state_ru_ivaruIvanovo OblastIVA
state_ru_kamruKamchatka KraiKAM
state_ru_kbruKabardino-Balkarian RepublicKB
state_ru_kgdruKaliningrad OblastKGD
state_ru_klruRepublic of KalmykiaKL
state_ru_kluruKaluga OblastKLU
state_ru_kcruKarachay–Cherkess RepublicKC
state_ru_krruRepublic of KareliaKR
state_ru_kemruKemerovo OblastKEM
state_ru_kharuKhabarovsk KraiKHA
state_ru_kkruRepublic of KhakassiaKK
state_ru_khmruKhanty-Mansi Autonomous OkrugKHM
state_ru_kirruKirov OblastKIR
state_ru_koruKomi RepublicKO
state_ru_kosruKostroma OblastKOS
state_ru_kdaruKrasnodar KraiKDA
state_ru_kyaruKrasnoyarsk KraiKYA
state_ru_kgnruKurgan OblastKGN
state_ru_krsruKursk OblastKRS
state_ru_lenruLeningrad OblastLEN
state_ru_lipruLipetsk OblastLIP
state_ru_magruMagadan OblastMAG
state_ru_meruMari El RepublicME
state_ru_moruRepublic of MordoviaMO
state_ru_mosruMoscow OblastMOS
state_ru_mowruMoscowMOW
state_ru_murruMurmansk OblastMUR
state_ru_nizruNizhny Novgorod OblastNIZ
state_ru_ngrruNovgorod OblastNGR
state_ru_nvsruNovosibirsk OblastNVS
state_ru_omsruOmsk OblastOMS
state_ru_oreruOrenburg OblastORE
state_ru_orlruOryol OblastORL
state_ru_pnzruPenza OblastPNZ
state_ru_perruPerm KraiPER
state_ru_priruPrimorsky KraiPRI
state_ru_pskruPskov OblastPSK
state_ru_rosruRostov OblastROS
state_ru_ryaruRyazan OblastRYA
state_ru_saruSakha Republic (Yakutia)SA
state_ru_sakruSakhalin OblastSAK
state_ru_samruSamara OblastSAM
state_ru_speruSaint PetersburgSPE
state_ru_sarruSaratov OblastSAR
state_ru_seruRepublic of North Ossetia–AlaniaSE
state_ru_smoruSmolensk OblastSMO
state_ru_staruStavropol KraiSTA
state_ru_sveruSverdlovsk OblastSVE
state_ru_tamruTambov OblastTAM
state_ru_taruRepublic of TatarstanTA
state_ru_tomruTomsk OblastTOM
state_ru_tulruTula OblastTUL
state_ru_tveruTver OblastTVE
state_ru_tyuruTyumen OblastTYU
state_ru_tyruTyva RepublicTY
state_ru_udruUdmurtiaUD
state_ru_ulyruUlyanovsk OblastULY
state_ru_vlaruVladimir OblastVLA
state_ru_vggruVolgograd OblastVGG
state_ru_vlgruVologda OblastVLG
state_ru_vorruVoronezh OblastVOR
state_ru_yanruYamalo-Nenets Autonomous OkrugYAN
state_ru_yarruYaroslavl OblastYAR
state_ru_yevruJewish Autonomous OblastYEV
state_gt_avegtAlta VerapazAVE
state_gt_bvegtBaja VerapazBVE
state_gt_cmtgtChimaltenangoCMT
state_gt_cqmgtChiquimulaCQM
state_gt_eprgtEl ProgresoEPR
state_gt_escgtEscuintlaESC
state_gt_guagtGuatemalaGUA
state_gt_huegtHuehuetenangoHUE
state_gt_izagtIzabalIZA
state_gt_jalgtJalapaJAL
state_gt_jutgtJutiapaJUT
state_gt_petgtPeténPET
state_gt_quegtQuetzaltenangoQUE
state_gt_quigtQuichéQUI
state_gt_retgtRetalhuleuRET
state_gt_sacgtSacatepéquezSAC
state_gt_smagtSan MarcosSMA
state_gt_srogtSanta RosaSRO
state_gt_solgtSololáSOL
state_gt_sucgtSuchitepéquezSUC
state_gt_totgtTotonicapánTOT
state_gt_zacgtZacapaZAC
state_jp_jp-23jpAichi23
state_jp_jp-05jpAkita05
state_jp_jp-02jpAomori02
state_jp_jp-12jpChiba12
state_jp_jp-38jpEhime38
state_jp_jp-18jpFukui18
state_jp_jp-40jpFukuoka40
state_jp_jp-07jpFukushima07
state_jp_jp-21jpGifu21
state_jp_jp-10jpGunma10
state_jp_jp-34jpHiroshima34
state_jp_jp-01jpHokkaidō01
state_jp_jp-28jpHyōgo28
state_jp_jp-08jpIbaraki08
state_jp_jp-17jpIshikawa17
state_jp_jp-03jpIwate03
state_jp_jp-37jpKagawa37
state_jp_jp-46jpKagoshima46
state_jp_jp-14jpKanagawa14
state_jp_jp-39jpKōchi39
state_jp_jp-43jpKumamoto43
state_jp_jp-26jpKyōto26
state_jp_jp-24jpMie24
state_jp_jp-04jpMiyagi04
state_jp_jp-45jpMiyazaki45
state_jp_jp-20jpNagano20
state_jp_jp-42jpNagasaki42
state_jp_jp-29jpNara29
state_jp_jp-15jpNiigata15
state_jp_jp-44jpŌita44
state_jp_jp-33jpOkayama33
state_jp_jp-47jpOkinawa47
state_jp_jp-27jpŌsaka27
state_jp_jp-41jpSaga41
state_jp_jp-11jpSaitama11
state_jp_jp-25jpShiga25
state_jp_jp-32jpShimane32
state_jp_jp-22jpShizuoka22
state_jp_jp-09jpTochigi09
state_jp_jp-36jpTokushima36
state_jp_jp-31jpTottori31
state_jp_jp-16jpToyama16
state_jp_jp-13jpTōkyō13
state_jp_jp-30jpWakayama30
state_jp_jp-06jpYamagata06
state_jp_jp-35jpYamaguchi35
state_jp_jp-19jpYamanashi19
state_pt_pt-01ptAveiro01
state_pt_pt-02ptBeja02
state_pt_pt-03ptBraga03
state_pt_pt-04ptBragança04
state_pt_pt-05ptCastelo Branco05
state_pt_pt-06ptCoimbra06
state_pt_pt-07ptÉvora07
state_pt_pt-08ptFaro08
state_pt_pt-09ptGuarda09
state_pt_pt-10ptLeiria10
state_pt_pt-11ptLisboa11
state_pt_pt-12ptPortalegre12
state_pt_pt-13ptPorto13
state_pt_pt-14ptSantarém14
state_pt_pt-15ptSetúbal15
state_pt_pt-16ptViana do Castelo16
state_pt_pt-17ptVila Real17
state_pt_pt-18ptViseu18
state_pt_pt-20ptAçores20
state_pt_pt-30ptMadeira30
state_eg_dkegDakahliaDK
state_eg_baegRed SeaBA
state_eg_bhegBeheiraBH
state_eg_fymegFaiyumFYM
state_eg_ghegGharbiaGH
state_eg_alxegAlexandriaALX
state_eg_isegIsmailiaIS
state_eg_gzegGizaGZ
state_eg_mnfegMonufiaMNF
state_eg_mnegMinyaMN
state_eg_cegCairoC
state_eg_kbegQalyubiaKB
state_eg_lxegLuxorLX
state_eg_wadegNew ValleyWAD
state_eg_shregAl SharqiaSHR
state_eg_sueg6th of OctoberSU
state_eg_suzegSuezSUZ
state_eg_asnegAswanASN
state_eg_astegAsyutAST
state_eg_bnsegBeni SuefBNS
state_eg_ptsegPort SaidPTS
state_eg_dtegDamiettaDT
state_eg_huegHelwanHU
state_eg_jsegSouth SinaiJS
state_eg_kfsegKafr el-SheikhKFS
state_eg_mtegMatrouhMT
state_eg_knegQenaKN
state_eg_sinegNorth SinaiSIN
state_eg_shgegSohagSHG
state_za_eczaEastern CapeEC
state_za_fszaFree StateFS
state_za_gtzaGautengGT
state_za_nlzaKwaZulu-NatalNL
state_za_lpzaLimpopoLP
state_za_mpzaMpumalangaMP
state_za_nczaNorthern CapeNC
state_za_nwzaNorth WestNW
state_za_wczaWestern CapeWC
state_it_agitAgrigentoAG
state_it_alitAlessandriaAL
state_it_anitAnconaAN
state_it_aoitAostaAO
state_it_aritArezzoAR
state_it_apitAscoli PicenoAP
state_it_atitAstiAT
state_it_avitAvellinoAV
state_it_baitBariBA
state_it_btitBarletta-Andria-TraniBT
state_it_blitBellunoBL
state_it_bnitBeneventoBN
state_it_bgitBergamoBG
state_it_biitBiellaBI
state_it_boitBolognaBO
state_it_bzitBolzanoBZ
state_it_bsitBresciaBS
state_it_britBrindisiBR
state_it_caitCagliariCA
state_it_clitCaltanissettaCL
state_it_cbitCampobassoCB
state_it_ciitCarbonia-IglesiasCI
state_it_ceitCasertaCE
state_it_ctitCataniaCT
state_it_czitCatanzaroCZ
state_it_chitChietiCH
state_it_coitComoCO
state_it_csitCosenzaCS
state_it_critCremonaCR
state_it_kritCrotoneKR
state_it_cnitCuneoCN
state_it_enitEnnaEN
state_it_fmitFermoFM
state_it_feitFerraraFE
state_it_fiitFirenzeFI
state_it_fgitFoggiaFG
state_it_fcitForlì-CesenaFC
state_it_fritFrosinoneFR
state_it_geitGenovaGE
state_it_goitGoriziaGO
state_it_gritGrossetoGR
state_it_imitImperiaIM
state_it_isitIserniaIS
state_it_spitLa SpeziaSP
state_it_aqitL’AquilaAQ
state_it_ltitLatinaLT
state_it_leitLecceLE
state_it_lcitLeccoLC
state_it_liitLivornoLI
state_it_loitLodiLO
state_it_luitLuccaLU
state_it_mcitMacerataMC
state_it_mnitMantovaMN
state_it_msitMassa-CarraraMS
state_it_mtitMateraMT
state_it_vsitMedio CampidanoVS
state_it_meitMessinaME
state_it_miitMilanoMI
state_it_moitModenaMO
state_it_mbitMonza e BrianzaMB
state_it_naitNapoliNA
state_it_noitNovaraNO
state_it_nuitNuoroNU
state_it_ogitOgliastraOG
state_it_otitOlbia-TempioOT
state_it_oritOristanoOR
state_it_pditPadovaPD
state_it_paitPalermoPA
state_it_pritParmaPR
state_it_pvitPaviaPV
state_it_pgitPerugiaPG
state_it_puitPesaro e UrbinoPU
state_it_peitPescaraPE
state_it_pcitPiacenzaPC
state_it_piitPisaPI
state_it_ptitPistoiaPT
state_it_pnitPordenonePN
state_it_pzitPotenzaPZ
state_it_poitPratoPO
state_it_rgitRagusaRG
state_it_raitRavennaRA
state_it_rcitReggio CalabriaRC
state_it_reitReggio EmiliaRE
state_it_riitRietiRI
state_it_rnitRiminiRN
state_it_rmitRomaRM
state_it_roitRovigoRO
state_it_saitSalernoSA
state_it_ssitSassariSS
state_it_svitSavonaSV
state_it_siitSienaSI
state_it_sritSiracusaSR
state_it_soitSondrioSO
state_it_suitSud SardegnaSU
state_it_taitTarantoTA
state_it_teitTeramoTE
state_it_tritTerniTR
state_it_toitTorinoTO
state_it_tpitTrapaniTP
state_it_tnitTrentoTN
state_it_tvitTrevisoTV
state_it_tsitTriesteTS
state_it_uditUdineUD
state_it_vaitVareseVA
state_it_veitVeneziaVE
state_it_vbitVerbano-Cusio-OssolaVB
state_it_vcitVercelliVC
state_it_vritVeronaVR
state_it_vvitVibo ValentiaVV
state_it_viitVicenzaVI
state_it_vtitViterboVT
state_es_cesA Coruña (La Coruña)C
state_es_viesAraba/ÁlavaVI
state_es_abesAlbaceteAB
state_es_aesAlacant (Alicante)A
state_es_alesAlmeríaAL
state_es_oesAsturiasO
state_es_avesÁvilaAV
state_es_baesBadajozBA
state_es_pmesIlles Balears (Islas Baleares)PM
state_es_besBarcelonaB
state_es_buesBurgosBU
state_es_ccesCáceresCC
state_es_caesCádizCA
state_es_sesCantabriaS
state_es_csesCastelló (Castellón)CS
state_es_ceesCeutaCE
state_es_cresCiudad RealCR
state_es_coesCórdobaCO
state_es_cuesCuencaCU
state_es_giesGirona (Gerona)GI
state_es_gresGranadaGR
state_es_guesGuadalajaraGU
state_es_ssesGipuzkoa (Guipúzcoa)SS
state_es_hesHuelvaH
state_es_huesHuescaHU
state_es_jesJaénJ
state_es_loesLa RiojaLO
state_es_gcesLas PalmasGC
state_es_leesLeónLE
state_es_lesLleida (Lérida)L
state_es_luesLugoLU
state_es_mesMadridM
state_es_maesMálagaMA
state_es_mlesMelillaME
state_es_muesMurciaMU
state_es_naesNavarra (Nafarroa)NA
state_es_oresOurense (Orense)OR
state_es_pesPalenciaP
state_es_poesPontevedraPO
state_es_saesSalamancaSA
state_es_tfesSanta Cruz de TenerifeTF
state_es_sgesSegoviaSG
state_es_seesSevillaSE
state_es_soesSoriaSO
state_es_tesTarragonaT
state_es_teesTeruelTE
state_es_toesToledoTO
state_es_vesValència (Valencia)V
state_es_vaesValladolidVA
state_es_biesBizkaia (Vizcaya)BI
state_es_zaesZamoraZA
state_es_zesZaragozaZ
state_my_jhrmyJohorJHR
state_my_kdhmyKedahKDH
state_my_ktnmyKelantanKTN
state_my_kulmyKuala LumpurKUL
state_my_lbnmyLabuanLBN
state_my_mlkmyMelakaMLK
state_my_nsnmyNegeri SembilanNSN
state_my_phgmyPahangPHG
state_my_prkmyPerakPRK
state_my_plsmyPerlisPLS
state_my_pngmyPulau PinangPNG
state_my_pjymyPutrajayaPJY
state_my_sbhmySabahSBH
state_my_swkmySarawakSWK
state_my_sgrmySelangorSGR
state_my_trgmyTerengganuTRG
state_mx_agsmxAguascalientesAGU
state_mx_bcmxBaja CaliforniaBCN
state_mx_bcsmxBaja California SurBCS
state_mx_chihmxChihuahuaCHH
state_mx_colmxColimaCOL
state_mx_campmxCampecheCAM
state_mx_coahmxCoahuilaCOA
state_mx_chismxChiapasCHP
state_mx_dfmxCiudad de MéxicoDIF
state_mx_dgomxDurangoDUR
state_mx_gromxGuerreroGRO
state_mx_gtomxGuanajuatoGUA
state_mx_hgomxHidalgoHID
state_mx_jalmxJaliscoJAL
state_mx_michmxMichoacánMIC
state_mx_mormxMorelosMOR
state_mx_mexmxMéxicoMEX
state_mx_naymxNayaritNAY
state_mx_nlmxNuevo LeónNLE
state_mx_oaxmxOaxacaOAX
state_mx_puemxPueblaPUE
state_mx_q roomxQuintana RooROO
state_mx_qromxQuerétaroQUE
state_mx_sinmxSinaloaSIN
state_mx_slpmxSan Luis PotosíSLP
state_mx_sonmxSonoraSON
state_mx_tabmxTabascoTAB
state_mx_tlaxmxTlaxcalaTLA
state_mx_tampsmxTamaulipasTAM
state_mx_vermxVeracruzVER
state_mx_yucmxYucatánYUC
state_mx_zacmxZacatecasZAC
state_nz_auknzAucklandAUK
state_nz_bopnzBay of PlentyBOP
state_nz_cannzCanterburyCAN
state_nz_gisnzGisborneGIS
state_nz_hkbnzHawke’s BayHKB
state_nz_mwtnzManawatu-WanganuiMWT
state_nz_mbhnzMarlboroughMBH
state_nz_nsnnzNelsonNSN
state_nz_ntlnzNorthlandNTL
state_nz_otanzOtagoOTA
state_nz_stlnzSouthlandSTL
state_nz_tkinzTaranakiTKI
state_nz_tasnzTasmanTAS
state_nz_wkonzWaikatoWKO
state_nz_wgnnzWellingtonWGN
state_nz_wtcnzWest CoastWTC
state_ca_abcaAlbertaAB
state_ca_bccaBritish ColumbiaBC
state_ca_mbcaManitobaMB
state_ca_nbcaNew BrunswickNB
state_ca_nlcaNewfoundland and LabradorNL
state_ca_ntcaNorthwest TerritoriesNT
state_ca_nscaNova ScotiaNS
state_ca_nucaNunavutNU
state_ca_oncaOntarioON
state_ca_pecaPrince Edward IslandPE
state_ca_qccaQuebecQC
state_ca_skcaSaskatchewanSK
state_ca_ytcaYukonYT
state_ae_azaeAbu DhabiAZ
state_ae_ajaeAjmanAJ
state_ae_duaeDubaiDU
state_ae_fuaeFujairahFU
state_ae_rkaeRas al-KhaimahRK
state_ae_shaeSharjahSH
state_ae_uqaeUmm al-QuwainUQ
state_ar_carBuenos Aires CityC
state_ar_barBuenos AiresB
state_ar_karCatamarcaK
state_ar_harChacoH
state_ar_uarChobutU
state_ar_xarCórdobaX
state_ar_warCorrientesW
state_ar_earEnte RíosE
state_ar_parFormosaP
state_ar_yarJujuyY
state_ar_larLa PampaL
state_ar_farLa RiojaF
state_ar_marMendozaM
state_ar_narMisionesN
state_ar_qarNeuquénQ
state_ar_rarRío NegroR
state_ar_aarSaltaA
state_ar_jarSan JuanJ
state_ar_darSan LuisD
state_ar_zarSanta CruzZ
state_ar_sarSanta FeS
state_ar_garSantiago Del EsteroG
state_ar_varTierra del FuegoV
state_ar_tarTucumánT
state_in_aninAndaman and NicobarAN
state_in_apinAndhra PradeshAP
state_in_arinArunachal PradeshAR
state_in_asinAssamAS
state_in_brinBiharBR
state_in_chinChandigarhCH
state_in_cginChattisgarhCG
state_in_dninDadra and Nagar HaveliDN
state_in_ddinDaman and DiuDD
state_in_dlinDelhiDL
state_in_gainGoaGA
state_in_gjinGujaratGJ
state_in_hrinHaryanaHR
state_in_hpinHimachal PradeshHP
state_in_jkinJammu and KashmirJK
state_in_jhinJharkhandJH
state_in_kainKarnatakaKA
state_in_klinKeralaKL
state_in_ldinLakshadweepLD
state_in_mpinMadhya PradeshMP
state_in_mhinMaharashtraMH
state_in_mninManipurMN
state_in_mlinMeghalayaML
state_in_mzinMizoramMZ
state_in_nlinNagalandNL
state_in_orinOrissaOR
state_in_pyinPuducherryPY
state_in_pbinPunjabPB
state_in_rjinRajasthanRJ
state_in_skinSikkimSK
state_in_tninTamil NaduTN
state_in_tsinTelanganaTS
state_in_trinTripuraTR
state_in_upinUttar PradeshUP
state_in_ukinUttarakhandUK
state_in_wbinWest BengalWB
state_id_acidAcehAC
state_id_baidBaliBA
state_id_bbidBangka BelitungBB
state_id_btidBantenBT
state_id_beidBengkuluBE
state_id_goidGorontaloGO
state_id_jkidJakartaJK
state_id_jaidJambiJA
state_id_jbidJawa BaratJB
state_id_jtidJawa TengahJT
state_id_jiidJawa TimurJI
state_id_kbidKalimantan BaratKB
state_id_ksidKalimantan SelatanKS
state_id_ktidKalimantan TengahKT
state_id_kiidKalimantan TimurKI
state_id_kuidKalimantan UtaraKU
state_id_kridKepulauan RiauKR
state_id_laidLampungLA
state_id_maidMalukuMA
state_id_muidMaluku UtaraMU
state_id_nbidNusa Tenggara BaratNB
state_id_ntidNusa Tenggara TimurNT
state_id_paidPapuaPA
state_id_pbidPapua BaratPB
state_id_riidRiauRI
state_id_sridSulawesi BaratSR
state_id_snidSulawesi SelatanSN
state_id_stidSulawesi TengahST
state_id_sgidSulawesi TenggaraSG
state_id_saidSulawesi UtaraSA
state_id_sbidSumatra BaratSB
state_id_ssidSumatra SelatanSS
state_id_suidSumatra UtaraSU
state_id_yoidYogyakartaYO
state_co_01coAntioquiaANT
state_co_02coAtlánticoATL
state_co_03coD.C.DC
state_co_04coBolívarBOL
state_co_05coBoyacáBOY
state_co_06coCaldasCAL
state_co_07coCaquetáCAQ
state_co_08coCaucaCAU
state_co_09coCesarCES
state_co_10coCórdobaCOR
state_co_11coCundinamarcaCUN
state_co_12coChocóCHO
state_co_13coHuilaHUI
state_co_14coLa GuajiraLAG
state_co_15coMagdalenaMAG
state_co_16coMetaMET
state_co_17coNariñoNAR
state_co_18coNorte de SantanderNSA
state_co_19coQuindioQUI
state_co_20coRisaraldaRIS
state_co_21coSantanderSAN
state_co_22coSucreSUC
state_co_23coTolimaTOL
state_co_24coValle del CaucaVAC
state_co_25coAraucaARA
state_co_26coCasanareCAS
state_co_27coPutumayoPUT
state_co_28coArchipiélago de San Andrés, Providencia y Santa CatalinaSAP
state_co_29coAmazonasAMA
state_co_30coGuainíaGUA
state_co_31coGuaviareGUV
state_co_32coVaupésVAU
state_co_33coVichadaVID

For each row (record):

  • the first column is the external id of the record to create or update
  • the second column is the external id of the country object to link to (country objects must have been defined beforehand)
  • the third column is the name field for res.country.state
  • the fourth column is the code field for res.country.state