I upload the image in this i need to allow only the png image others will not be allowed?How to do that
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
if attachment_line.file_name and attachment_line.file_name.lower (). endswith (('. png' )):
self.env ['ir.attachment']. create ({
'name': attachment_line.file_name,
'attachment_type': attachment_line.type,
'datas': attachment_line.attachment,
'status': 'to_approve',
'datas_fname': attachment_line.file_name,
'res_id': active_rec.sale_line_id.id,
'res_model': 'sale.order.line'
})
else:
raise UserError (_ ("Sorry! Only .png is the Supported Format.") )
accept and upvote if useful
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
0
Jun 25
|
2616 | ||
|
0
Agu 19
|
2519 | ||
|
2
Jul 25
|
286 | ||
|
0
Jan 25
|
682 | ||
|
2
Agu 24
|
5358 |
Hope this idea will solve your problem: http://learnopenerp.blogspot.com/2020/07/how-to-resize-image-on-saving-records-in-odoo.html