diff --git a/__init__.py b/__init__.py
index 6e02e439be..2a597bdc0d 100644
--- a/__init__.py
+++ b/__init__.py
@@ -28,5 +28,4 @@
from category import *
from partner import *
from country import *
-from state import *
from address import *
diff --git a/__tryton__.py b/__tryton__.py
index 5dc8d278aa..7091f89846 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -10,6 +10,7 @@
"xml" : [
"category.xml",
"partner.xml",
+ "country.xml",
"address.xml",
],
}
diff --git a/address.py b/address.py
index 1244d0d794..e03b78600b 100644
--- a/address.py
+++ b/address.py
@@ -19,10 +19,10 @@ class Address(OSV):
zip = fields.Char('Zip', change_default=True, size=24,
states=STATES)
city = fields.Char('City', size=128, states=STATES)
- state = fields.Many2One("partner.state", 'State',
- domain="[('country_id','=',country_id)]", states=STATES)
country = fields.Many2One('partner.country', 'Country',
states=STATES)
+ state = fields.Many2One("partner.country.state", 'State',
+ domain="[('country', '=', country)]", states=STATES)
email = fields.Char('E-Mail', size=64, states=STATES)
phone = fields.Char('Phone', size=64, states=STATES)
fax = fields.Char('Fax', size=64, states=STATES)
diff --git a/address.xml b/address.xml
index ff0aeda1a5..22b68f2876 100644
--- a/address.xml
+++ b/address.xml
@@ -30,25 +30,30 @@
-
+
+
+
+
-
-
+
+
+
diff --git a/category.xml b/category.xml
index f5eace1a70..49fdd8d921 100644
--- a/category.xml
+++ b/category.xml
@@ -7,7 +7,7 @@
form
+
+ ]]>
+
+
+
+ partner.country
+ tree
+
+
+
+
+
+ ]]>
+
+
+
+ Countries
+ partner.country
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Andorra, Principality of
+ ad
+
+
+ United Arab Emirates
+ ae
+
+
+ Afghanistan, Islamic State of
+ af
+
+
+ Antigua and Barbuda
+ ag
+
+
+ Anguilla
+ ai
+
+
+ Albania
+ al
+
+
+ Armenia
+ am
+
+
+ Netherlands Antilles
+ an
+
+
+ Angola
+ ao
+
+
+ Antarctica
+ aq
+
+
+ Argentina
+ ar
+
+
+ American Samoa
+ as
+
+
+ Austria
+ at
+
+
+ Australia
+ au
+
+
+ Aruba
+ aw
+
+
+ Azerbaidjan
+ az
+
+
+ Bosnia-Herzegovina
+ ba
+
+
+ Barbados
+ bb
+
+
+ Bangladesh
+ bd
+
+
+ Belgium
+ be
+
+
+ Burkina Faso
+ bf
+
+
+ Bulgaria
+ bg
+
+
+ Bahrain
+ bh
+
+
+ Burundi
+ bi
+
+
+ Benin
+ bj
+
+
+ Bermuda
+ bm
+
+
+ Brunei Darussalam
+ bn
+
+
+ Bolivia
+ bo
+
+
+ Brazil
+ br
+
+
+ Bahamas
+ bs
+
+
+ Bhutan
+ bt
+
+
+ Bouvet Island
+ bv
+
+
+ Botswana
+ bw
+
+
+ Belarus
+ by
+
+
+ Belize
+ bz
+
+
+ Canada
+ ca
+
+
+ Cocos (Keeling) Islands
+ cc
+
+
+ Central African Republic
+ cf
+
+
+ Congo, The Democratic Republic of the
+ cd
+
+
+ Congo
+ cg
+
+
+ Suisse
+ ch
+
+
+ Ivory Coast (Cote D'Ivoire)
+ ci
+
+
+ Cook Islands
+ ck
+
+
+ Chile
+ cl
+
+
+ Cameroon
+ cm
+
+
+ China
+ cn
+
+
+ Colombia
+ co
+
+
+ Costa Rica
+ cr
+
+
+ Serbia and Montenegro
+ cs
+
+
+ Cuba
+ cu
+
+
+ Cape Verde
+ cv
+
+
+ Christmas Island
+ cx
+
+
+ Cyprus
+ cy
+
+
+ Czech Republic
+ cz
+
+
+ Germany
+ de
+
+
+ Djibouti
+ dj
+
+
+ Denmark
+ dk
+
+
+ Dominica
+ dm
+
+
+ Dominican Republic
+ do
+
+
+ Algeria
+ dz
+
+
+ Ecuador
+ ec
+
+
+ Estonia
+ ee
+
+
+ Egypt
+ eg
+
+
+ Western Sahara
+ eh
+
+
+ Eritrea
+ er
+
+
+ Spain
+ es
+
+
+ Ethiopia
+ et
+
+
+ Finland
+ fi
+
+
+ Fiji
+ fj
+
+
+ Falkland Islands
+ fk
+
+
+ Micronesia
+ fm
+
+
+ Faroe Islands
+ fo
+
+
+ France
+ fr
+
+
+ Gabon
+ ga
+
+
+ Grenada
+ gd
+
+
+ Georgia
+ ge
+
+
+ French Guyana
+ gf
+
+
+ Ghana
+ gh
+
+
+ Gibraltar
+ gi
+
+
+ Greenland
+ gl
+
+
+ Gambia
+ gm
+
+
+ Guinea
+ gn
+
+
+ Guadeloupe (French)
+ gp
+
+
+ Equatorial Guinea
+ gq
+
+
+ Greece
+ gr
+
+
+ S. Georgia & S. Sandwich Isls.
+ gs
+
+
+ Guatemala
+ gt
+
+
+ Guam (USA)
+ gu
+
+
+ Guinea Bissau
+ gw
+
+
+ Guyana
+ gy
+
+
+ Hong Kong
+ hk
+
+
+ Heard and McDonald Islands
+ hm
+
+
+ Honduras
+ hn
+
+
+ Croatia
+ hr
+
+
+ Haiti
+ ht
+
+
+ Hungary
+ hu
+
+
+ Indonesia
+ id
+
+
+ Ireland
+ ie
+
+
+ Israel
+ il
+
+
+ India
+ in
+
+
+ British Indian Ocean Territory
+ io
+
+
+ Iraq
+ iq
+
+
+ Iran
+ ir
+
+
+ Iceland
+ is
+
+
+ Italy
+ it
+
+
+ Jamaica
+ jm
+
+
+ Jordan
+ jo
+
+
+ Japan
+ jp
+
+
+ Kenya
+ ke
+
+
+ Kyrgyz Republic (Kyrgyzstan)
+ kg
+
+
+ Cambodia, Kingdom of
+ kh
+
+
+ Kiribati
+ ki
+
+
+ Comoros
+ km
+
+
+ Saint Kitts & Nevis Anguilla
+ kn
+
+
+ North Korea
+ kp
+
+
+ South Korea
+ kr
+
+
+ Kuwait
+ kw
+
+
+ Cayman Islands
+ ky
+
+
+ Kazakhstan
+ kz
+
+
+ Laos
+ la
+
+
+ Lebanon
+ lb
+
+
+ Saint Lucia
+ lc
+
+
+ Liechtenstein
+ li
+
+
+ Sri Lanka
+ lk
+
+
+ Liberia
+ lr
+
+
+ Lesotho
+ ls
+
+
+ Lithuania
+ lt
+
+
+ Luxembourg
+ lu
+
+
+ Latvia
+ lv
+
+
+ Libya
+ ly
+
+
+ Morocco
+ ma
+
+
+ Monaco
+ mc
+
+
+ Moldavia
+ md
+
+
+ Madagascar
+ mg
+
+
+ Marshall Islands
+ mh
+
+
+ Macedonia
+ mk
+
+
+ Mali
+ ml
+
+
+ Myanmar
+ mm
+
+
+ Mongolia
+ mn
+
+
+ Macau
+ mo
+
+
+ Northern Mariana Islands
+ mp
+
+
+ Martinique (French)
+ mq
+
+
+ Mauritania
+ mr
+
+
+ Montserrat
+ ms
+
+
+ Malta
+ mt
+
+
+ Mauritius
+ mu
+
+
+ Maldives
+ mv
+
+
+ Malawi
+ mw
+
+
+ Mexico
+ mx
+
+
+ Malaysia
+ my
+
+
+ Mozambique
+ mz
+
+
+ Namibia
+ na
+
+
+ New Caledonia (French)
+ nc
+
+
+ Niger
+ ne
+
+
+ Norfolk Island
+ nf
+
+
+ Nigeria
+ ng
+
+
+ Nicaragua
+ ni
+
+
+ Netherlands
+ nl
+
+
+ Norway
+ no
+
+
+ Nepal
+ np
+
+
+ Nauru
+ nr
+
+
+ Neutral Zone
+ nt
+
+
+ Niue
+ nu
+
+
+ New Zealand
+ nz
+
+
+ Oman
+ om
+
+
+ Panama
+ pa
+
+
+ Peru
+ pe
+
+
+ Polynesia (French)
+ pf
+
+
+ Papua New Guinea
+ pg
+
+
+ Philippines
+ ph
+
+
+ Pakistan
+ pk
+
+
+ Poland
+ pl
+
+
+ Saint Pierre and Miquelon
+ pm
+
+
+ Pitcairn Island
+ pn
+
+
+ Puerto Rico
+ pr
+
+
+ Portugal
+ pt
+
+
+ Palau
+ pw
+
+
+ Paraguay
+ py
+
+
+ Qatar
+ qa
+
+
+ Reunion (French)
+ re
+
+
+ Romania
+ ro
+
+
+ Russian Federation
+ ru
+
+
+ Rwanda
+ rw
+
+
+ Saudi Arabia
+ sa
+
+
+ Solomon Islands
+ sb
+
+
+ Seychelles
+ sc
+
+
+ Sudan
+ sd
+
+
+ Sweden
+ se
+
+
+ Singapore
+ sg
+
+
+ Saint Helena
+ sh
+
+
+ Slovenia
+ si
+
+
+ Svalbard and Jan Mayen Islands
+ sj
+
+
+ Slovak Republic
+ sk
+
+
+ Sierra Leone
+ sl
+
+
+ San Marino
+ sm
+
+
+ Senegal
+ sn
+
+
+ Somalia
+ so
+
+
+ Suriname
+ sr
+
+
+ Saint Tome (Sao Tome) and Principe
+ st
+
+
+ El Salvador
+ sv
+
+
+ Syria
+ sy
+
+
+ Swaziland
+ sz
+
+
+ Turks and Caicos Islands
+ tc
+
+
+ Chad
+ td
+
+
+ French Southern Territories
+ tf
+
+
+ Togo
+ tg
+
+
+ Thailand
+ th
+
+
+ Tadjikistan
+ tj
+
+
+ Tokelau
+ tk
+
+
+ Turkmenistan
+ tm
+
+
+ Tunisia
+ tn
+
+
+ Tonga
+ to
+
+
+ East Timor
+ tp
+
+
+ Turkey
+ tr
+
+
+ Trinidad and Tobago
+ tt
+
+
+ Tuvalu
+ tv
+
+
+ Taiwan
+ tw
+
+
+ Tanzania
+ tz
+
+
+ Ukraine
+ ua
+
+
+ Uganda
+ ug
+
+
+ United Kingdom
+ uk
+
+
+ USA Minor Outlying Islands
+ um
+
+
+ United States
+ us
+
+
+ Uruguay
+ uy
+
+
+ Uzbekistan
+ uz
+
+
+ Holy See (Vatican City State)
+ va
+
+
+ Saint Vincent & Grenadines
+ vc
+
+
+ Venezuela
+ ve
+
+
+ Virgin Islands (British)
+ vg
+
+
+ Virgin Islands (USA)
+ vi
+
+
+ Vietnam
+ vn
+
+
+ Vanuatu
+ vu
+
+
+ Wallis and Futuna Islands
+ wf
+
+
+ Samoa
+ ws
+
+
+ Yemen
+ ye
+
+
+ Mayotte
+ yt
+
+
+ Yugoslavia
+ yu
+
+
+ South Africa
+ za
+
+
+ Zambia
+ zm
+
+
+ Zimbabwe
+ zw
+
+
+
+ Alabama
+ al
+
+
+
+ Alaska
+ ak
+
+
+
+ Arizona
+ az
+
+
+
+ Arkansas
+ ar
+
+
+
+ California
+ ca
+
+
+
+ Colorado
+ co
+
+
+
+ Connecticut
+ ct
+
+
+
+ District of Columbia
+ dc
+
+
+
+ Delaware
+ de
+
+
+
+ Florida
+ fl
+
+
+
+ Georgia
+ ga
+
+
+
+ Hawaii
+ hi
+
+
+
+ Idaho
+ id
+
+
+
+ Illinois
+ il
+
+
+
+ Indiana
+ in
+
+
+
+ Iowa
+ ia
+
+
+
+ Kansas
+ ks
+
+
+
+ Kentucky
+ ky
+
+
+
+ Louisiana
+ la
+
+
+
+ Maine
+ me
+
+
+
+ Maryland
+ md
+
+
+
+ Massachusetts
+ ma
+
+
+
+ Michigan
+ mi
+
+
+
+ Minnesota
+ mn
+
+
+
+ Mississippi
+ ms
+
+
+
+ Missouri
+ mo
+
+
+
+ Montana
+ mt
+
+
+
+ Nebraska
+ ne
+
+
+
+ Nevada
+ nv
+
+
+
+ New Hampshire
+ nh
+
+
+
+ New Jersey
+ nj
+
+
+
+ New Mexico
+ nm
+
+
+
+ New York
+ ny
+
+
+
+ North Carolina
+ nc
+
+
+
+ North Dakota
+ nd
+
+
+
+ Ohio
+ oh
+
+
+
+ Oklahoma
+ ok
+
+
+
+ Oregon
+ or
+
+
+
+ Pennsylvania
+ pa
+
+
+
+ Rhode Island
+ ri
+
+
+
+ South Carolina
+ sc
+
+
+
+ South Dakota
+ sd
+
+
+
+ Tennessee
+ tn
+
+
+
+ Texas
+ tx
+
+
+
+ Utah
+ ut
+
+
+
+ Vermont
+ vt
+
+
+
+ Virginia
+ va
+
+
+
+ Washington
+ wa
+
+
+
+ West Virginia
+ wv
+
+
+
+ Wisconsin
+ wi
+
+
+
+ Wyoming
+ wy
+
+
+
+
diff --git a/partner.xml b/partner.xml
index 5516cf46ef..dd8c9205af 100644
--- a/partner.xml
+++ b/partner.xml
@@ -24,7 +24,9 @@
-
+
+
+
@@ -34,25 +36,30 @@
-
+
+
+
+
-
-
+
+
+
@@ -66,8 +73,6 @@
-
-
diff --git a/state.py b/state.py
deleted file mode 100644
index 20829a0be2..0000000000
--- a/state.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from trytond.osv import fields, OSV
-STATES = {
- 'readonly': "active == False"
-}
-
-
-class State(OSV):
- "Country state"
- _name = 'partner.state'
- _description = __doc__
- _order = 'code'
- country = fields.Many2One('partner.country', 'Country',
- required=True)
- name = fields.Char('State Name', size=64, required=True)
- code = fields.Char('State Code', size=3, required=True)
-
- def create(self, cursor, user, vals, context=None):
- if 'code' in vals:
- vals['code'] = vals['code'].upper()
- return super(CountryState, self).create(cursor, user, vals,
- context=context)
-
- def write(self, cursor, user, ids, vals, context=None):
- if 'code' in vals:
- vals['code'] = vals['code'].upper()
- return super(CountryState, self).write(cursor, user, ids, vals,
- context=context)
-
-State()
-