Migrate version 3.4

This commit is contained in:
resteve 2014-11-19 09:35:45 +01:00
parent 5bbcac01b0
commit 82873a716e
5 changed files with 0 additions and 48 deletions

View File

@ -3,13 +3,10 @@
#the full copyright notices and license terms.
from trytond.pool import Pool
from .configuration import *
from .country import *
from .address import *
def register():
Pool.register(
Configuration,
Address,
CountryZip,
module='country_zip', type_='model')

View File

@ -1,26 +0,0 @@
#This file is part country_zip module for Tryton.
#The COPYRIGHT file at the top level of this repository contains
#the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields
__all__ = ['CountryZip']
class CountryZip(ModelSQL, ModelView):
'Country Zip'
__name__ = 'country.zip'
_rec_name = 'zip'
zip = fields.Char('Zip', required=True, select=1)
city = fields.Char('City', select=1)
subdivision = fields.Many2One('country.subdivision', 'Subdivision',
ondelete='CASCADE', select=1)
country = fields.Function(fields.Many2One('country.country', 'Country'),
'get_country', searcher='search_country'
)
def get_country(self, name):
return self.subdivision.country.id
@classmethod
def search_country(cls, name, clause):
return [('subdivision.%s' % name,) + tuple(clause[1:])]

View File

@ -5,4 +5,3 @@ depends:
country
xml:
configuration.xml
country.xml

View File

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<form string="Country Zip">
<label name="zip"/>
<field name="zip"/>
<label name="city"/>
<field name="city"/>
<label name="subdivision"/>
<field name="subdivision"/>
<label name="country"/>
<field name="country"/>
</form>

View File

@ -1,7 +0,0 @@
<?xml version="1.0"?>
<tree string="Countries">
<field name="zip"/>
<field name="city"/>
<field name="subdivision"/>
<field name="country"/>
</tree>