What does the 'Delete company transactions' do in detail?

Hi

I’m testing ERPNext and am aware of the ‘Delete Company Transactions’ capability in the main company setup which can be used to test and then clear transactions before proper use. https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions

But exactly what does it do, ie what does it clear and what does it leave ?

ie I would expect it clears Accounts transaction, and stock transactions, but does it leave Contacts, Companies, Items Calendar entries, Projects, Tasks as is?

Do Quotations get removed ?

I think this would be very useful for many other companies evbaulating ERPNext to know so they understand what they can test and what will be left after deleting the company transactions.

Yes I know I could test this myself, but its actually quite abit of work, and would be better to know fully from someone who has used this or from Frappe …

1 Like

@Julian_Robbins,

Please go through the ERPNext manual

https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions

Hope this helps

Thanks @makarand_b , but it isnt really detailed enough …

eg what about Contacts, Projects, Customers … these aren’t mentioned. This would be a really good selling documentation if done properly

@Julian_Robbins,

delete company transaction will delete all the transaction related to company and communication while your customer, addresses (except lead addresses), items will be kept in the system.

following is the list of doctype that will be deleted from the system.

[
	'Appraisal',
	'Timesheet',
	'Employee Attendance Tool',
	'Serial No',
	'Employee Loan',
	'Attendance',
	'Salary Slip',
	'C-Form',
	'Process Payroll',
	'Payment Entry',
	'Fiscal Year Company',
	'Shopping Cart Settings',
	'GL Entry',
	'Sales Order',
	'Daily Work Summary Settings Company',
	'Sales Invoice',
	'Material Request',
	'Company',
	'Purchase Invoice',
	'Employee Loan Application',
	'Installation Note',
	'Delivery Note',
	'Task',
	'Asset Movement',
	'Homepage',
	'Opportunity',
	'Authorization Rule',
	'Leave Application',
	'Period Closing Voucher',
	'Email Digest',
	'Shipping Rule',
	'Salary Structure',
	'Purchase Receipt',
	'Project',
	'Mode of Payment Account',
	'Issue',
	'Stock Reconciliation',
	'Salary Component Account',
	'Expense Claim',
	'Journal Entry',
	'Asset',
	'Supplier Quotation',
	'Landed Cost Voucher',
	'Stock Entry',
	'Production Planning Tool',
	'Global Defaults',
	'Maintenance Schedule',
	'Stock Ledger Entry',
	'Production Order',
	'Offer Letter',
	'Leave Block List',
	'Warranty Claim',
	'Maintenance Visit',
	'Request for Quotation',
	'Tax Rule',
	'Expense Claim Account',
	'Payment Reconciliation',
	'Leave Control Panel',
	'Lead',
	'Quotation',
	'Asset Category Account',
	'Purchase Order',
	'Daily Work Summary',
	'Pricing Rule'
]
1 Like

ok, that is useful to know. probably bes a good idea to add to the docs.

I would need to keep my Issues, but these can be exported and reimported ok. Its just doctypes that require lots of linked other doctypes that are far more difficult to reimport …

The updated docs are here. It would be helpful to have Makarand’s excellent answer in the docs.

https://erpnext.org/docs/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions

Hi Juilan here’s the code so you can confirm details…

https://github.com/frappe/erpnext/blob/develop/erpnext/setup/doctype/company/delete_company_transactions.py

I used these search expressions:

frappe@ubuntu:~/frappe-bench$ find . -name '*.py' | xargs grep 'delete_company_transactions'
./apps/erpnext/erpnext/setup/doctype/company/delete_company_transactions.py:def delete_company_transactions(company_name):
frappe@ubuntu:~/frappe-bench$ find . -name '*.js' | xargs grep delete_company_transactions
./apps/erpnext/erpnext/setup/doctype/company/company.js:		if(frm.get_field("delete_company_transactions").$input)
./apps/erpnext/erpnext/setup/doctype/company/company.js:			frm.get_field("delete_company_transactions").$input.addClass("btn-danger");
./apps/erpnext/erpnext/setup/doctype/company/company.js:	delete_company_transactions: function(frm) {
./apps/erpnext/erpnext/setup/doctype/company/company.js:					method: "erpnext.setup.doctype.company.delete_company_transactions.delete_company_transactions",

How makarand_b generated the list, perhaps from this code, possibly print statements? With each version as the code evolves and is refactored, DocTypes are added and the odd one may change name.

Leave Allocation will also be deleted.

1 Like

Thanks Julian, I was going to ask the same question.