Change owner of document

hi , i have put in permission based on the owner of document. can i change the owner of document

do you mean in internal documents such as a “Sales Invoice” or an attached file?

I guess in both cases you can pseudo change the ownership by “assigning” it to someone.

I think the creator of any document will remain the same (and I think that is so on purpose, so you can always track te origins of a document)

Hi,

I think I understand why changing / transferring ownership of document is important, while I agree that the creator of the document will remain the same. I think, both ‘creator’ and ‘owner’ are always the same in ERPNext, regardless of any ‘Assign To’ or ‘Shared With’ action that have been done to that particular document.

Take Quotation for example. In many typical sales organization, it is common to have each sales people be able to see only their own quotations, not quotations of other sales user, to avoid friction or un-healthy competition among peers. Therefore, the role permission for Quotation docs will be set to ‘If Owner’ for all Sales User. Now, let’s see a case where a User-A was acting on behalf of User-B to create a Quotation. User-B would no’t be able to see or edit the quotation, until User-A shared or assigned this particular quotation with User-B. However, User-B would never be able to ‘Submit’ that quotation, even though this quotation was intended for his Customer and User-A has shared and assigned to him. Only User-A can submit the quotation.

This is why we need to be able to transfer document ownership (not document creator).

Cheers,
-Lucky

1 Like

Any updates to this? I have the same problem.

Another solution would be to create another role in the Role permission manager. Adding another role that says “If assigned to” would be useful. That way the users who are assigned to the document will be able to see the document.

As far as I’m aware, the only way to change a document owner is direct in the database or via an equivalent frappe.db.sql call or frappe.db.set_value(doctype, name, fieldname, value):

UPDATE `tabDoc Type Here`
SET owner='user@domain.com'
WHERE name='Document Name';

frappe.db.set_value will also change the modified date of the document unless specified not to with update_modified=False.