Error when make button inside doctype on new apps

i got this error

Traceback (innermost last):
  File "/home/myme/frappe-bench/apps/frappe/frappe/", line 57, in application
    response = frappe.handler.handle()
  File "/home/myme/frappe-bench/apps/frappe/frappe/", line 19, in handle
  File "/home/myme/frappe-bench/apps/frappe/frappe/", line 36, in execute_cmd
    ret =, **frappe.form_dict)
  File "/home/myme/frappe-bench/apps/frappe/frappe/", line 806, in call
    return fn(*args, **newargs)
  File "/home/myme/frappe-bench/apps/frappe/frappe/", line 67, in runserverobj
    frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
  File "/home/myme/frappe-bench/apps/frappe/frappe/desk/form/", line 33, in runserverobj
    fnargs, varargs, varkw, defaults = inspect.getargspec(getattr(doc, method))
 AttributeError: 'Document' object has no attribute 'add_item'

anyone know how to solve this error?

i made new app named Inventory then i install that to ERPNEXT. After that i made new doctype names Inventoty Receipt and use Inventory as module on my new doctype… and i check the “Custom?”…
after that i make button on my doctype to show something using msgprint…
this 1 my code on py

>     from __future__ import unicode_literals
>     import frappe
>     from frappe.model.document import Document
>     from frappe import msgprint

>     class InventoryReceipt(Document):
>     	def add_item(self):
>     		msgprint("helo")

when i click the button on my new doctype Inventory Receipt i got that error

my ERP and Frappe version
Installed Apps
ERPNext: v6.27.25
Frappe Framework: v6.27.24
Inventory: v0.0.1