Trying to add a party.relation to a newly created party in a proteus script like this:
party = Party()
Relation = Model.get('party.relation')
RelationType = Model.get('party.relation.type')
[...]
(party is filled here)
[...]
party.save()
relation = Relation()
relation.from_ = party
relation.to = Party(x) # x gives the party to relate to
relation.type = RelationType(y) # y gives the relation type
relation.save()
the following Error is thrown:
Traceback (most recent call last):
[...]
File "/[...]/tryton-server-6.6/env/lib/python3.11/site-packages/proteus/__init__.py", line 102, in newfunc
return self.func(owner, [instance], *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/[...]/tryton-server-6.6/env/lib/python3.11/site-packages/proteus/__init__.py", line 855, in save
ids = proxy.create(values, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/[...]/tryton-server-6.6/env/lib/python3.11/site-packages/proteus/config.py", line 194, in __call__
raise TypeError('%s is not callable' % self._name)
TypeError: create is not callable
Could someone please tell me how to add a party.relation using Proteus, or just tell me what is the problem here?