erpnext icon indicating copy to clipboard operation
erpnext copied to clipboard

Hooks for Updates are not called when the status of a sales order is changed

Open WebsiteDeveloper opened this issue 2 years ago • 1 comments

Information about bug

When you open a sales Order and change its Status via the menu Bar the on_update or on_update_after_submit hooks are not called. This is due to the status updater code using db_set and not invoking hooks. It seams like this is by design although this prevents our usecase which needs a notification of status changes.

Module

selling

Version

v14.0.2 v.14.0.0

Installation method

docker

Relevant log output / Stack trace / Full Error Message.

No response

WebsiteDeveloper avatar Aug 09 '22 12:08 WebsiteDeveloper

One current Workaround for this is adding a self.save call in the status updater which makes the events work but may have unintended sideeffects

WebsiteDeveloper avatar Aug 09 '22 12:08 WebsiteDeveloper

Another alternative is to use on_chage which is fired on db_set too, but you'll have to modify code to check docstatus too.

ankush avatar Aug 10 '22 15:08 ankush