# Attachement with proteus

**URL:** <https://discuss.tryton.org/t/attachement-with-proteus/9012>\
**Category:** Developer\
**Created:** [December 12, 2025, 10:00am UTC](https://discuss.tryton.org/t/attachement-with-proteus/9012 "2025-12-12T10:00:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![herve\_02](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@herve\_02](https://discuss.tryton.org/u/herve_02)\
**Post date:** [December 12, 2025, 10:00am UTC](https://discuss.tryton.org/t/attachement-with-proteus/9012/1 "2025-12-12T10:00:44Z")

</div>

I have a strange behavior that i do not understand, i probably miss something

i create an attachment like that :

```auto
att=Model.get(‘ir.attachment’)
the_att=att()
the_att.type=‘data’
with open(‘/home/user/image428.png’, ‘rb’) as f:
    the_att.data = f.read()
the_att.name=“icone.png”
Party=Model.get('party.party');
party,=Party.find([('code','=','party_code')])
the_att.resource=party
the_att.save()

```

it works, the file created in /var/lib/tryton/tryton/…. is plainly functional, if i send it as attachement in mail the user get the real file but in my tryton sao i only have a 4 octet broken file in my party view and the same in the email archives.

do i missed something ?

---

<div class="post-metadata">

**Author:** ![herve\_02](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@herve\_02](https://discuss.tryton.org/u/herve_02)\
**Post date:** [December 15, 2025, 10:40am UTC](https://discuss.tryton.org/t/attachement-with-proteus/9012/2 "2025-12-15T10:40:17Z")

</div>

> [@herve\_02](#):
>
> ```auto
> att=Model.get(‘ir.attachment’)
> the_att=att()
> the_att.type=‘data’
> with open(‘/home/user/image428.png’, ‘rb’) as f:
> the_att.data = f.read()
> the_att.name=“icone.png”
> Party=Model.get('party.party');
> party,=Party.find([('code','=','party_code')])
> the_att.resource=party
> the_att.save()
> 
> ```

i debug the thing and i do not know hao to solve the problem (if there is a manner to solve it). I create an attachment with sao and one with protheus.

the 2 have the same shape in ir\_attachment

`21 | | 2025-12-15 …| 1 | | | a3e2458dc….a8 | | 331.png | party.party,25561 | data | |`  
`22 | | 2025-12-15… | 1 | | | 9f881…3deb18 | | icone23.png | party.party,25561 | data | |`

they both exists in _/var/lib/tryton/tryton/…_

the only difference is the owner one is tryton, the second the user.. rights of file _-rw-r–r– sould_ let tryton at least read it but no.

and when i change the owner to tryton, the file becomes available for tryton.

---

<div class="post-metadata">

**Author:** ![herve\_02](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@herve\_02](https://discuss.tryton.org/u/herve_02)\
**Post date:** [December 15, 2025, 10:58am UTC](https://discuss.tryton.org/t/attachement-with-proteus/9012/3 "2025-12-15T10:58:56Z")

</div>

> [@Problems of rights between tryton-sao and tryton-protheus](https://discuss.tryton.org/t/problems-of-rights-between-tryton-sao-and-tryton-protheus/9017):
>
> as shown here : [Attachement with proteus](https://discuss.tryton.org/t/attachement-with-proteus/9012) when you deal with protheus and sao for attachments (in the file systems) the system rights management cannot permit tryton-sao to manage tryton-proteus files. we could use a cron task to change recursively owners but it is so bad practice. Is there a way somewhere to tell tryton-sao to be able to manage tryton-protheus files ?

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [December 16, 2025, 10:59am UTC](https://discuss.tryton.org/t/attachement-with-proteus/9012/4 "2025-12-16T10:59:42Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
