Merge pull request #20994 from rohitwaghchaure/fixed_bom_comparision_issue_develop
fix: bom comparison issue
This commit is contained in:
commit
9476170b09
@ -835,6 +835,10 @@ def add_operations_cost(stock_entry, work_order=None, expense_account=None):
|
|||||||
def get_bom_diff(bom1, bom2):
|
def get_bom_diff(bom1, bom2):
|
||||||
from frappe.model import table_fields
|
from frappe.model import table_fields
|
||||||
|
|
||||||
|
if bom1 == bom2:
|
||||||
|
frappe.throw(_("BOM 1 {0} and BOM 2 {1} should not be same")
|
||||||
|
.format(frappe.bold(bom1), frappe.bold(bom2)))
|
||||||
|
|
||||||
doc1 = frappe.get_doc('BOM', bom1)
|
doc1 = frappe.get_doc('BOM', bom1)
|
||||||
doc2 = frappe.get_doc('BOM', bom2)
|
doc2 = frappe.get_doc('BOM', bom2)
|
||||||
|
|
||||||
|
@ -22,7 +22,14 @@ erpnext.BOMComparisonTool = class BOMComparisonTool {
|
|||||||
fieldname: 'name1',
|
fieldname: 'name1',
|
||||||
fieldtype: 'Link',
|
fieldtype: 'Link',
|
||||||
options: 'BOM',
|
options: 'BOM',
|
||||||
change: () => this.fetch_and_render()
|
change: () => this.fetch_and_render(),
|
||||||
|
get_query: () => {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
"name": ["not in", [this.form.get_value("name2") || ""]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: 'Column Break'
|
fieldtype: 'Column Break'
|
||||||
@ -32,7 +39,14 @@ erpnext.BOMComparisonTool = class BOMComparisonTool {
|
|||||||
fieldname: 'name2',
|
fieldname: 'name2',
|
||||||
fieldtype: 'Link',
|
fieldtype: 'Link',
|
||||||
options: 'BOM',
|
options: 'BOM',
|
||||||
change: () => this.fetch_and_render()
|
change: () => this.fetch_and_render(),
|
||||||
|
get_query: () => {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
"name": ["not in", [this.form.get_value("name1") || ""]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: 'Section Break'
|
fieldtype: 'Section Break'
|
||||||
|
Loading…
Reference in New Issue
Block a user