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


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
1347
1
مارس 23
6537
0
أكتوبر 21
2563
2
مايو 20
12128
2
ديسمبر 17
4224