Allow all level subdivisions on party_addresses
This commit is contained in:
parent
b4a9857fea
commit
50df14e3f0
|
@ -5,10 +5,12 @@
|
|||
|
||||
from trytond.pool import Pool
|
||||
from .country_zip import *
|
||||
from .address import *
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Address,
|
||||
LoadCountryZipsStart,
|
||||
module='country_zip_es', type_='model')
|
||||
Pool.register(
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['Address']
|
||||
|
||||
|
||||
class Address:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'party.address'
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Address, cls).__setup__()
|
||||
# Remove domain as we want to be able to select all levels.
|
||||
# See: https://bugs.tryton.org/issue5563
|
||||
parent_domain = ('parent', '=', None)
|
||||
new_domain = []
|
||||
for clause in cls.subdivision.domain:
|
||||
if clause != parent_domain:
|
||||
new_domain.append(clause)
|
||||
cls.subdivision.domain = new_domain
|
Loading…
Reference in New Issue