Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
4 Replies
10908 Tampilan

From what I can see, attachments are designed to just have a small number per document.

They show like this:


After uploading, users need to hover over each attachment to see the Title and with the number we plan to use this will be too cumbersome.

Are there other users managing larger number of attachments for documents?

Avatar
Buang

Nice question, great Inputs and good answers, but why Odoo is limited to provide "Files Centralization" only for some apps? CRM among other important apps should have the possibility to have their files centralized by default!

Jawaban Terbai

You can create a Smart Button on the Opportunity if you need to manage more Attachments than would reasonably work in the Chatter.


Activate Developer Mode:

1. Create a Custom View to show attachments in a list and allow them to be created from the list:


<tree string="Attachments" editable="top" >
<field name="datas" widget="download_link" filename="name" string="File"/>
<field name="name" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="create_uid"/>
<field name="create_date"/>
</tree>



2. Create a Window Action to open attachments:


Note the Domain Value and Context Value field are both specific to the Document Model you want to find attachments for, in this case crm.lead.

[('res_id','=',active_id) ,  ('res_model','=','crm.lead')]
{'default_res_id': active_id, 'default_res_model': 'crm.lead'}


At the bottom of this Window Action, link it to the View you created in the first step:



Take note of the ID of this Window Action (found in the URL) as you will need it in the next step:




3. Create the Smart Button in your own Custom View on top of Opportunity.


Note that the Name of the button will the the ID of the Window Action you created.

<xpath expr="//button[@name='action_schedule_meeting']" position="after">
<button class="oe_stat_button" icon="fa-file-o" type="action" name="475" string="Attached"/>
</xpath>



Your Opportunity Form View will now look like this:



When users click, they will see:



When they click CREATE they will be able to upload a new Attachment inline:



Avatar
Buang

Hi Ray, I would like to do something similar, a button to download all edi files from selected invoice in view list, any suugestion ?

Thanks

I would suggest posting a new question - this technique only allows you to see all attachments in a list - you still have to download each one individually - I think what your ask is customization that needs code (ie: a module).

Jawaban Terbai

you can buy my module https://apps.odoo.com/apps/modules/13.0/attachments_manager
:)

Avatar
Buang

Awesome module 👍

Jawaban Terbai

Hello, do you know how to display attachment size on website next to a name?

Avatar
Buang
Jawaban Terbai

Hi

In case you want to edit the attachments names quickly and efficiently from the chatter attachment widget. 

Here's an app for V14+ :

https://apps.odoo.com/apps/modules/15.0/edit_attachment_chatter_name/

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Des 24
1523
5
Des 23
18860
1
Mar 23
6737
2
Apr 22
4195
0
Okt 21
2693