I want to default cost center based on logged-in user. I tried User Permission but unfortunately it didn’t set default value…even-though it listed-out assigned cost center…means user would still need to select cost center.
I tried using custom script, but don’t have idea what is the best way to get cost center value in user permission record.
I tried frappe.defaults.get_user_default(“cost_center”) or frappe.defaults.get_user_default(“Cost Center”) but it’snot working…
@rmehta User Permission doesn’t set default value. It’s just filter the records (assigned-values) for each user. The users still have to select proper cost center on transaction form.
@nabinhait In Sales Invoice. In my opinion user defaults should get highest priority for default value…because it’s related to security permission.
It’s really not ideal if on every transaction form the user has to select cost center manually.
I think for now I have to use custom script.to define cost center for each user. Do you know what client side function to get user defined cost center?
@nabinhait it seems a good work around eventhough I prefer user defaults on top priority to override everything as most ideal solution. It not just for cost center but also for all fields.
Ok, regarding your idea…If we don’t define cost center on item/item group then will user-defaults still get override?