Files
tradon/modules/party/tests/scenario_party_identifier_notifications.rst
2026-03-14 09:42:12 +00:00

43 lines
868 B
ReStructuredText

==============================
Party Identifier Notifications
==============================
Imports::
>>> from proteus import Model
>>> from trytond.tests.tools import activate_modules
Activate modules::
>>> config = activate_modules('party')
>>> Party = Model.get('party.party')
Create first party::
>>> party1 = Party(name="Party 1")
>>> identifier = party1.identifiers.new(type='be_vat')
>>> identifier.code = "500923836"
>>> party1.save()
Create second party::
>>> party2 = Party(name="Party 2")
>>> identifier = party2.identifiers.new(type='be_vat')
>>> identifier.code = "500923836"
Check notifications::
>>> len(identifier.notifications())
1
Change identifier::
>>> identifier.type = None
>>> identifier.code = "foo"
Check notifications::
>>> len(identifier.notifications())
0