Remove Property fields

issue2349
This commit is contained in:
Raimon Esteve 2017-12-12 10:30:52 +01:00
parent 06a145f6e6
commit 0785234969
2 changed files with 21 additions and 9 deletions

View File

@ -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')

View File

@ -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'