From 54bb86fbe343137ea8ae9e810e9fee74a2c87f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 29 Feb 2008 17:31:45 +0100 Subject: [PATCH] Some custom layout and add country and US states --- __init__.py | 1 - __tryton__.py | 1 + address.py | 4 +- address.xml | 11 +- category.xml | 4 +- country.py | 30 +- country.xml | 1279 +++++++++++++++++++++++++++++++++++++++++++++++++ partner.xml | 17 +- state.py | 30 -- 9 files changed, 1331 insertions(+), 46 deletions(-) create mode 100644 country.xml delete mode 100644 state.py 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 @@