attachment_id = self.env['ir.attachment'].create({
'name': self.name or ' ',
'res_model': 'model name',
'res_id': self.id,
'datas': file name,
'datas_fname': self.name,
'description': 'report file',
'type': 'binary'
})
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2577
Views
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
6
May 24
|
45712 | ||
|
1
Feb 23
|
697 | ||
|
0
Feb 23
|
724 | ||
|
2
Sep 20
|
16681 | ||
|
1
Jul 19
|
2848 |