parent
06a145f6e6
commit
0785234969
12
__init__.py
12
__init__.py
|
@ -1,12 +1,14 @@
|
|||
#This file is part country_zip module for Tryton.
|
||||
#The COPYRIGHT file at the top level of this repository contains
|
||||
#The COPYRIGHT file at the top level of this repository contains
|
||||
#the full copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from .configuration import *
|
||||
from .address import *
|
||||
from . import configuration
|
||||
from . import address
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Configuration,
|
||||
Address,
|
||||
configuration.Configuration,
|
||||
configuration.ConfigurationCountry,
|
||||
address.Address,
|
||||
module='country_zip', type_='model')
|
||||
|
|
|
@ -1,14 +1,24 @@
|
|||
#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 fields
|
||||
from trytond.model import ModelSQL, fields
|
||||
from trytond.model import ValueMixin
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.modules.party.configuration import _ConfigurationValue
|
||||
|
||||
__all__ = ['Configuration']
|
||||
__all__ = ['Configuration', 'ConfigurationCountry']
|
||||
|
||||
default_country = fields.Many2One('country.country', 'Default Country')
|
||||
|
||||
|
||||
class Configuration:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'party.configuration'
|
||||
default_country = fields.Property(fields.Many2One('country.country',
|
||||
'Default Country'))
|
||||
default_country = fields.MultiValue(default_country)
|
||||
|
||||
|
||||
class ConfigurationCountry(_ConfigurationValue, ModelSQL, ValueMixin):
|
||||
'Party Configuration Country'
|
||||
__name__ = 'party.configuration.default_country'
|
||||
default_country = default_country
|
||||
_configuration_value_field = 'default_country'
|
||||
|
|
Loading…
Reference in New Issue