تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3915 أدوات العرض


I have binary field with attachment=true. All those files have been saved with name of binary field. I want that those files will be automatically save with the same name as res_name. How to do that?

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

I did it in write method

الصورة الرمزية
إهمال
أفضل إجابة
You can achieve it by doing the following:

attachment_id = fields.Many2one('ir.attachment', string='Attachment')

attachment_fname = fields.Char('Attachment Filename', related='attachment_id.name')
الصورة الرمزية
إهمال


<field name="attachment_fname" invisible="1"/>

<field name="attachment_id" filename="attachment_fname"/>

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
ديسمبر 24
1296
1
مارس 23
6478
0
أكتوبر 21
2533
2
مايو 20
12083
2
ديسمبر 17
4170