# Allow adding attachments and notes on new records

**URL:** <https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481>\
**Category:** Ideas\
**Created:** [November 23, 2020, 1:09pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481 "2020-11-23T13:09:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)\
**Post date:** [November 23, 2020, 1:09pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/1 "2020-11-23T13:09:08Z")

</div>

Tryton is a bit inconsistent when it comes to the buttons in the toolbars for new records that have not been saved yet:

- The user can click on actions and the record will be saved before the action is executed. That applies to printing a report too.
- The user cannot click on attachments nor notes until the record is saved. The icon is gray and a forbidden icon is shown but nothing explains to the user why she cannot save the record.

I think we should always have the same behaviour for all those buttons and I suggest that we save automatically when the user clicks on attachments and notes.

Thoughts?

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [November 23, 2020, 1:27pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/2 "2020-11-23T13:27:48Z")

</div>

There is also some strange behaviour on the new send by email button which does nothing when the record is not save but the button is not dissabled. Not sure if this is a bug, but something that should be improveed also.

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [November 23, 2020, 1:34pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/3 "2020-11-23T13:34:13Z")

</div>

> [@albert](#):
>
> we should always have the same behaviour for all those buttons

Why? They do not have the same requirements.

> [@albert](#):
>
> I suggest that we save automatically when the user clicks on attachments and notes.

I do not see the point. There is no attachments nor notes to consult when the record is not created. But you could consult them without having to save the record once created.

> [@pokoli](#):
>
> There is also some strange behaviour on the new send by email button which does nothing when the record is not save but the button is not dissabled.

Indeed the button is doing nothing if the record has not a positive id. So as long as the current record is not created, it will be better to have the button disabled.

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [November 23, 2020, 1:54pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/4 "2020-11-23T13:54:24Z")

</div>

> [@ced](#):
>
> > [@pokoli](#):
> >
> > There is also some strange behaviour on the new send by email button which does nothing when the record is not save but the button is not dissabled.
> 
> Indeed the button is doing nothing if the record has not a positive id. So as long as the current record is not created, it will be better to have the button disabled.

I will prefer to have the same behaviour on reports and email templates (because both are the same). So we should disable also the report button until the record is not saved.

The same applies for Actions and Relates:

- It is not possible to perform an action on a record until is saved (otherwise the record does not now it’s details)
- If the record is not saved it should not have anything related.

---

<div class="post-metadata">

**Author:** ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)\
**Post date:** [November 23, 2020, 3:10pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/5 "2020-11-23T15:10:51Z")

</div>

> [@ced](#):
>
> I do not see the point. There is no attachments nor notes to consult when the record is not created. But you could consult them without having to save the record once created.

The user does not want to see the attachments but add them, when the record is not saved.

The problem is that currently there’s no message telling the user to save before attachments can be added.

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [November 23, 2020, 3:14pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/6 "2020-11-23T15:14:48Z")

</div>

> [@pokoli](#):
>
> I will prefer to have the same behaviour on reports and email templates (because both are the same).

Technically they are not the same. The reports are based on `ir.action` and the email templates are very custom.

> [@pokoli](#):
>
> So we should disable also the report button until the record is not saved.

Indeed I think it is better that the email button does like the actions, it saves the record if modified automatically.

> [@pokoli](#):
>
> The same applies for Actions and Relates:

All button based on `ir.action` do the same because they are managed by the exact same function. They try to save the record before being execute because they rely on the server having the correct data.

> [@albert](#):
>
> The user does not want to see the attachments but add them, when the record is not saved.

But the first action of the attachment is to show the attachments.

> [@albert](#):
>
> The problem is that currently there’s no message telling the user to save before attachments can be added.

No the button is disabled until the record is saved.  
For me it is a better behavior than having a popup telling “you must save before clicking on this button”.  
And it will be wrong to force to save the modification like the `ir.action` buttons because these actions (attachments and notes) do not rely on the server data (except just the ID).

---

<div class="post-metadata">

**Author:** ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)\
**Post date:** [November 23, 2020, 3:26pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/7 "2020-11-23T15:26:41Z")

</div>

> [@ced](#):
>
> No the button is disabled until the record is saved.

It is disable but the user does not know why. That is the problem. At least adding a tooltip would be an improvement.

> [@ced](#):
>
> And it will be wrong to force to save the modification like the `ir.action` buttons because these actions (attachments and notes) do not rely on the server data (except just the ID).

We both understand that but the user doesn’t. They just see an inconsistent behaviour.

But as said, probably a tooltip would be enough.

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [November 23, 2020, 5:06pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/8 "2020-11-23T17:06:26Z")

</div>

> [@albert](#):
>
> It is disable but the user does not know why. That is the problem. At least adding a tooltip would be an improvement.

We have such thing in many places like fields that are readonly depending on other values, button not displayed depending on the state etc.  
I do not see the point nor why a user would put the mouse over a disabled button.  
At best the behavior could be documented.

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [November 24, 2020, 11:13pm UTC](https://discuss.tryton.org/t/allow-adding-attachments-and-notes-on-new-records/3481/9 "2020-11-24T23:13:31Z")

</div>

> [@ced](#):
>
> Indeed I think it is better that the email button does like the actions, it saves the record if modified automatically.

Here is [Save record when sending email (#9879) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue9879)
