How to generate Taxes in new doctype?

I have a created a new doctype . In that i have added Taxes table (Sales Taxes and Charges) and taxes and charges fileds . If taxes and charges filed is selected the taxes are not generated from taxes field … But in other doctypes taxes are generated …

screenshot is attached for reference

you’ll have to check how it happens in Sales/Purchase documents and try to reuse that code

Thanks for reply @root13F I have reused the code . But in other doctype if i added as custom field it works fine… but it is not generating taxes in New Doctype.

Still it is not working ??? Is it possible to generate the tax and charge (table) in new doctype …?

If you make a new Doctype you will have to (re)write all the code to do all the clever things that happen for other Doctypes. There is no reason why the taxes stuff would work for a new doctype (which is just a collection of fields with no extra magic). By looking at both the JS and python code for stuff like Sales Invoice you could replicate the behaviour but it would be very complicated as the JS at least is several layers of abstraction deep spread across several files.

Thank you @Andrew_McLeod for the reply .