Clear PO/PR/PI effect

37 views
Skip to first unread message

Nguyen Do Le Bao

unread,
Aug 20, 2014, 10:43:48 PM8/20/14
to erpnext-dev...@googlegroups.com
Hi guys, 

For the purpose of testing, i will write scripts to delete: 
1. All PO/PR/PI 
2. All SO/DN/SI

I will just use sql to delete those tables. 
AFAIK, this shouldn't affect any thing else since all the reports are generated dynamically. 
Is this correct ? Anything to take note of ?

Thanks

Nabin Hait

unread,
Aug 21, 2014, 12:10:56 AM8/21/14
to erpnext-dev...@googlegroups.com

You also have to delete data from related child tables and internal tables like gl entry, stock ledger entry, bin etc. You should reset naming series for those forms as well. We always recommend to start fresh when you go to real data entry mode.

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/722e556e-5573-48b2-a887-4ddb42802b75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rushabh Mehta

unread,
Aug 21, 2014, 3:00:23 AM8/21/14
to erpnext-dev...@googlegroups.com
Bad idea - you have to make sure there are no data integrity issues

Better to test and discard databases.

Nguyen Do Le Bao

unread,
Aug 21, 2014, 5:18:47 AM8/21/14
to erpnext-dev...@googlegroups.com
Rather than delete the whole database is there another way ? Like if we know the only tables that are affected ?

Cos, that means re setup the db with Company/Item Master and everything again for every test :(. 
Even if I can automate that, the data must pass validation. :| 

On Thursday, August 21, 2014 3:00:23 PM UTC+8, rushabh wrote:
On 21-Aug-2014, at 8:13 am, Nguyen Do Le Bao <natha...@gmail.com> wrote:

Hi guys, 

For the purpose of testing, i will write scripts to delete: 
1. All PO/PR/PI 
2. All SO/DN/SI

I will just use sql to delete those tables. 
AFAIK, this shouldn't affect any thing else since all the reports are generated dynamically. 
Is this correct ? Anything to take note of ?

Bad idea - you have to make sure there are no data integrity issues

Better to test and discard databases.


Thanks

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Rushabh Mehta

unread,
Aug 21, 2014, 5:23:35 AM8/21/14
to erpnext-dev...@googlegroups.com
Why not write relative tests, that do not depend on initial data.

We were doing this before, but its not a good way to write tests!

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/a750d889-56d2-4ae4-b34d-f210481acc7c%40googlegroups.com.

Nguyen Do Le Bao

unread,
Aug 21, 2014, 5:32:01 AM8/21/14
to erpnext-dev...@googlegroups.com
Good points, thought about that. 
So if I can make the whole test do sth like: 
- Create a PO (use server code or API call to create)
- Use this PO to do what ever tests on it
- In the end, discard this PO and its PR/PI 
This should work better right ?  

Btw, another question: Previous ERPNext has the button to backup, then it sends to my email both DB & Files. 
Not sure if it's still available for current version ?

Rushabh Mehta

unread,
Aug 21, 2014, 7:10:18 AM8/21/14
to erpnext-dev...@googlegroups.com
On 21-Aug-2014, at 3:02 pm, Nguyen Do Le Bao <natha...@gmail.com> wrote:

Good points, thought about that. 
So if I can make the whole test do sth like: 
- Create a PO (use server code or API call to create)
- Use this PO to do what ever tests on it
- In the end, discard this PO and its PR/PI 
This should work better right ?  

Yeah


Btw, another question: Previous ERPNext has the button to backup, then it sends to my email both DB & Files. 
Not sure if it's still available for current version ?

Yeah! just noticed - I am not sure - let me ask someone :)

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/30e4455f-6360-46a8-8034-7edafc126345%40googlegroups.com.

Anand Doshi

unread,
Aug 22, 2014, 3:24:37 AM8/22/14
to erpnext-dev...@googlegroups.com
It is there in Setup / System / Download Backup. 

-Anand

Nguyen Do Le Bao

unread,
Aug 31, 2014, 10:41:49 PM8/31/14
to erpnext-dev...@googlegroups.com
Thank you, guys! 

Successfully writing test for Customized RPC calls using frappe client. Once I reorganised this, I think it can provide some examples for frappe test documentation.

Just a quick check if I use the frappe client to delete PO/PR docs via  frappe.client.delete, all those related table are also handled properly right ?

-Nathan
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr...@googlegroups.com.

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr...@googlegroups.com.

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Anand Doshi

unread,
Sep 1, 2014, 12:36:04 AM9/1/14
to ERPNext Developer's Forum
Hi Nathan,

Yes. frappe.client.delete will delete child table records too and will also perform related validations + calls on_trash method of controller.

-Anand.


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f22dbafb-7b5e-410c-8e62-0dc5a73a7b79%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages