cur_frm.add_fetch('taxes_and_charges','c_form_applicable','c_form_applicable');
--
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/04968c3e-bde1-4e7e-9610-d11774e957de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-from __future__ import unicode_literalsimport frappefrom frappe import msgprint
def validate(doc,method): c_form_tax =frappe.db.get_value("Sales Taxes and Charges Master", doc.taxes_and_charges ,"c_form_applicable") if (doc.c_form_applicable!=c_form_tax): frappe.msgprint("C-Form applicable selection does not match with Sales Tax", raise_exception=1)
-Anand.Aditya,Can you describe what are you trying to do, in a general sense and not how you plan to apply it? Maybe there would be a simpler solution.
add_fetch will fetch the value from Taxes and Charges Master and set its value in c_form_applicable. You have already lost the old value.
On Wed, Sep 3, 2014 at 6:20 PM, Aditya Duggal <aditya...@gmail.com> wrote:
Hi,--I want to get a field value from sales_taxes_and_charges_master table and compare with a field in sales invoice for validation, how can I do that.I am currently able to pull the field properly from the master as below:
cur_frm.add_fetch('taxes_and_charges','c_form_applicable','c_form_applicable');Now I also want to check if the two fields one in Sales Invoice and the other in the sales_taxes_and_charges_master table are they equal for the selected value in taxes_and_charges, how can I do that?I can't seem to find the answer but I think this query must have been answered before.
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.
Yiu have to call this validate function through hook.
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/c23484f2-1fe6-41c4-8ab2-f29e513be1db%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/04968c3e-bde1-4e7e-9610-d11774e957de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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.