# trytond.exceptions.UserError in rst file

**URL:** https://discuss.tryton.org/t/trytond-exceptions-usererror-in-rst-file/3528
**Category:** Developer
**Created:** [December 7, 2020, 11:37am UTC](https://discuss.tryton.org/t/trytond-exceptions-usererror-in-rst-file/3528 "2020-12-07T11:37:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sangeetatarkar](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@sangeetatarkar](https://discuss.tryton.org/u/sangeetatarkar)
#### Post date: [December 7, 2020, 11:37am UTC](https://discuss.tryton.org/t/trytond-exceptions-usererror-in-rst-file/3528/1 "2020-12-07T11:37:48Z")

</div>

Create Party::

```
>>> Party = Model.get('party.party')
>>> party = Party(name='john')
>>> party.save()

```

```auto
File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/trytond_pay_automation-5.0.0-py3.8.egg/trytond/modules/pay_automation/tests/pay.rst", line 32, in pay.rst
Failed example:
    party.save()
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.8/doctest.py", line 1336, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest pay.rst[13]>", line 1, in <module>
        party.save()
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/proteus/ __init__.py", line 102, in newfunc
        return self.func(owner, [instance], *args, **kwargs)
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/proteus/ __init__.py", line 847, in save
        ids = proxy.create(values, context)
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/proteus/config.py", line 188, in __call__
        result = rpc.result(meth(*args, **kwargs))
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/gnuhealth-3.6.5-py3.8.egg/trytond/modules/health/health.py", line 770, in create
        return super(Party, cls).create(vlist)
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/trytond/modules/party/party.py", line 186, in create
        return super(Party, cls).create(vlist)
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/trytond/model/modelsql.py", line 147, in wrapper
        return func(cls, *args, **kwargs)
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/trytond/model/modelsql.py", line 549, in create
        super(ModelSQL, cls).create(vlist)
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 104, in create
        ModelAccess.check(cls. __name__ , 'create')
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/trytond/ir/model.py", line 522, in check
        cls.raise_user_error(mode, model_name)
      File "/home/vam/workspace/tryton/tryton50/lib/python3.8/site-packages/trytond/error.py", line 74, in raise_user_error
        raise UserError(error)
    trytond.exceptions.UserError: You can not create this kind of document! (party.party) -

```

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [December 7, 2020, 11:50am UTC](https://discuss.tryton.org/t/trytond-exceptions-usererror-in-rst-file/3528/2 "2020-12-07T11:50:24Z")

</div>

The error is raised beucase the user executing the rst file is not allowed to create party.

On tryton by default all users are allowed to create a party so it seems you have an access rule on your database which adds this restriction.

Adding the user to the proper group should fix the issue.
