# On\_change\_notify issue

**URL:** https://discuss.tryton.org/t/on-change-notify-issue/9311
**Category:** Developer
**Tags:** sales
**Created:** [August 7, 2026, 8:47pm UTC](https://discuss.tryton.org/t/on-change-notify-issue/9311 "2026-08-07T20:47:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gruenfischer](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/g/3be4f8/32.png) [@Gruenfischer](https://discuss.tryton.org/u/Gruenfischer)
#### Post date: [August 7, 2026, 8:47pm UTC](https://discuss.tryton.org/t/on-change-notify-issue/9311/1 "2026-08-07T20:47:32Z")

</div>

Hi ,

I try to add a simple on\_change\_notify() to the sale\_subscription module. I extend class Subscription with:

```auto
 @fields.depends('party')
    def on_change_notify(self):
        notifications = super().on_change_notify()
........
..
            count = Subscription.search_count(domain)
            if count:
                notifications.append((
                    'warning',
                    'Here a wonderful warning'
                ))
        return notifications

```

The code is working, but the message in Version 8.0 with corresponding Sao client, appears for about 100 milliseconds and disappears again. It just a blink..

Am I missing something?

Thanks for Hints Jakob

---

<div class="post-metadata">

### Author: ![eva\_luadora](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/eva_luadora/32/3903_2.png) [@eva\_luadora](https://discuss.tryton.org/u/eva_luadora)
#### Post date: [August 10, 2026, 8:52am UTC](https://discuss.tryton.org/t/on-change-notify-issue/9311/2 "2026-08-10T08:52:17Z")

</div>

Hi Jakob,

I think the `warning` type is fine.

In Sao, each `on_change_notify` result refreshes the notification area before displaying the returned messages. If another `on_change_notify` call occurs immediately afterwards and returns an empty list, the previous warning will briefly appear and then disappear.

I would check the browser Network tab to see whether `on_change_notify` is called more than once when changing `party`, and what each response contains.

Also ensure that `fields.depends` includes every field used to compute the warning, especially fields modified by `on_change_party()`. Otherwise a subsequent onchange may evaluate the condition with different values and return no notification.

If you can share the complete method and domain, it should be easier to identify which dependency or onchange causes the second result.

---

<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: [August 14, 2026, 10:58am UTC](https://discuss.tryton.org/t/on-change-notify-issue/9311/3 "2026-08-14T10:58:10Z")

</div>

Indeed it is a bug in the clients, see [Notifications are cleared on each display call (#15012) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/15012).

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [August 17, 2026, 5:23pm UTC](https://discuss.tryton.org/t/on-change-notify-issue/9311/4 "2026-08-17T17:23:35Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
