'Shear' object has no attribute 'doc' Error Message When want to add "naming_series"

I have a DocType Name ‘Shear’ i want make a autoname for this DocType.

I am using The code from this tutorial link :

def autoname(self):
        self.doc.name = make_autoname(self.doc.naming_series+'.#####')

And i also import from frappe.model.naming import make_autoname

Is there any missing library ? How can i solve this problem.

Hi Ashraful,

The help document you are using is very old. Read these documents: https://frappe.io/developers

For naming series based on autoname, you can just set naming_series: in autoname of DocType.


Hello Anand,

It’s ok now. Thanks :slight_smile: