How to script custom Doctype

HI, I have created a new doctype in app, now i want to calculate the area from two fields, but I have not found any of the file to script please suggest how to calculate or where i can put a script in custom doctype. ERPNEXT version is 8

Have you tried creating a Custom Script ?

I am very new to frappe, please guide me it will be a great help

http://frappe.github.io/frappe/user/en/

do i need to create the queries.py in some folder

No need. What are you trying to achieve?

I am creating the form in which i can get the measurement of the windows for the installation, i need to calculate the area from height and width. but after creating the doctype i unable to find the files in which i can write the query to calculate the area. sangram it would be great help if you can suggest me for this

you can find doctype folder in frappe-bench/apps/app_name/app_name/app_name/doctype

Here you can find .js file and you can create .py for server side script.

Hi Sangram i had
app_name = “product_install”
app_title = “Product Process”

path i found is /home/administrator/frappe-bench/apps/product_install/product_install/product_process

files i found are, init.py, init.pyc no other file

i have given the doctype name as (measurement sheet)

check here,

/home/administrator/frappe-bench/apps/product_install/product_install/product_install/doctype/product_process

Hi Sangram i had only this path
/home/administrator/frappe-bench/apps/product_install/product_install/product_process

and now i have the path as you described above

@Parag_Kapoor
Check Custom? is unchecked in your doctype as it not allows you to create files of it.

If it’s checked, uncheck and save. And find it’s file path using following cmd

find /home/administrator/frappe-bench/apps/product_install -name "form_name.js"

Replace form_name with your doctype name (in small case and replace space with _ )

done but no luck

attached the snapshot for the list of files

Please share your doctypes snapshot

Please uncheck Custom? checkbox and save the form then find the file path as I told you earlier.

you have to enable developer mode for your site for creating form and customization.

Refer the following link to enable it.

Enable developer mode

done

now i have write the measurement_sheet.py to write a custom query

did you find the measurment_sheet folder? If yes check whether measurment_sheet.py present or not if not then you can create it. And do your customization using .js, .py file