V13 User Permissions Bug

on version 12 i have been using user permissions for my sales team to restrict them to their respective warehouse.

everything was working fine until i have been updated v13.
Now when i create Sales Invoice with update stock checked or Delivery note i get this error.

Is there any workaround as this our production server

kindly if some body can point in right direction … thanks