Files
tryton/modules/web_user/party.py
T

29 lines
812 B
Python
Raw Normal View History

2016-10-11 18:18:28 +02:00
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
2021-12-11 17:58:45 +01:00
from trytond.pool import Pool, PoolMeta
2016-10-11 18:18:28 +02:00
2020-03-01 12:33:54 +01:00
class Replace(metaclass=PoolMeta):
2016-10-11 18:18:28 +02:00
__name__ = 'party.replace'
@classmethod
def fields_to_replace(cls):
2020-03-01 12:33:54 +01:00
return super().fields_to_replace() + [
2016-10-11 18:18:28 +02:00
('web.user', 'party'),
2020-10-12 18:11:20 +02:00
('web.user-party.party.secondary', 'party'),
2016-10-11 18:18:28 +02:00
]
2018-03-24 00:11:28 +01:00
2020-03-01 12:33:54 +01:00
class Erase(metaclass=PoolMeta):
2018-03-24 00:11:28 +01:00
__name__ = 'party.erase'
def to_erase(self, party_id):
pool = Pool()
User = pool.get('web.user')
2020-03-01 12:33:54 +01:00
to_erase = super().to_erase(party_id)
2018-03-24 00:11:28 +01:00
to_erase.append(
(User, [('party', '=', party_id)], True,
['email'],
[None]))
return to_erase