I have created a new doctype “bid” in buying module and i want to fetch lits of bid doc type from the purchase order doctype using the “get items from” button same as get items from material request and supplier quotation. please can any one help me how to proceed.
Hi @letayt! you just have to make sure that field for “bid” is present in this doctypes with exactly the same name. When you use the button “get items from”, it will automatically get all the info from the doctype you are getting and setting it to the current doctype as long as the field exists.
Hi @creamdory , sorry for referencing a question of other post but could you please tell me how can you get the doctypes list in python script.
Like i want to check on a custom doctype on validate if a item of that name is present.
How could i get and compare all item names with the field? -
i did item_doctype = frappe.db.sql("select name from tabItem") but that doens’t give me the right answer on if not package_item in item_doctype: as the query returns in tuple format.
then i saw you post Fetch value of fieldname from another doctype - #7 by creamdory
and thought if i can get it in a object i can maybe do something like if not package_item in item_doctype.item_code:
but how would i write the query or achieve this?