Skip to content

Commit 6687f46

Browse files
author
Callum Dickinson
committed
Add support for managing attachments
Add a new manager for attachment records (`ir.attachment`) in Odoo. These are intended to be used for uploading/downloading attachments to/from invoices. Invoice attachments will then be attached to invoice emails sent out to customers. The contents of the attachments won't be fetched when querying them from Odoo by default; instead it is intended that the separate `download` method be used to download the attachment contents separately. An `upload` method is also available, to provide an easier to use interface for uploading attachments.
1 parent 495a6b3 commit 6687f46

File tree

14 files changed

+1332
-3
lines changed

14 files changed

+1332
-3
lines changed

_typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default.extend-words]
2+
datas = "datas"

changelog.d/11.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for managing attachments

docs/managers/account-move.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,40 @@ is_move_sent: bool
177177

178178
Whether or not the account move (invoice) has been sent.
179179

180+
### `message_main_attachment_id`
181+
182+
```python
183+
message_main_attachment_id: int | None
184+
```
185+
186+
The ID of the main [attachment](attachment.md) on the account move (invoice),
187+
if there is one.
188+
189+
*Added in version 0.2.0.*
190+
191+
### `message_main_attachment_name`
192+
193+
```python
194+
message_main_attachment_name: str | None
195+
```
196+
197+
The name of the main [attachment](attachment.md) on the account move (invoice),
198+
if there is one.
199+
200+
*Added in version 0.2.0.*
201+
202+
### `message_main_attachment`
203+
204+
```python
205+
message_main_attachment: Attachment | None
206+
```
207+
The main [attachment](attachment.md) on the account move (invoice), if there is one.
208+
209+
This fetches the full record from Odoo once,
210+
and caches it for subsequent accesses.
211+
212+
*Added in version 0.2.0.*
213+
180214
### `move_type`
181215

182216
```python

0 commit comments

Comments
 (0)