fix: purchase invoice qty change not recalculate the consumed qty and added test cases for purchase invoice
This commit is contained in:
@@ -122,10 +122,21 @@ erpnext.buying.BuyingController = class BuyingController extends erpnext.Transac
|
||||
this.set_from_product_bundle();
|
||||
}
|
||||
|
||||
this.toggle_subcontracting_fields();
|
||||
super.refresh();
|
||||
}
|
||||
},
|
||||
|
||||
supplier() {
|
||||
toggle_subcontracting_fields: function() {
|
||||
if (in_list(['Purchase Receipt', 'Purchase Invoice'], this.frm.doc.doctype)) {
|
||||
this.frm.fields_dict.supplied_items.grid.update_docfield_property('consumed_qty',
|
||||
'read_only', this.frm.doc.__onload && this.frm.doc.__onload.backflush_based_on === 'BOM');
|
||||
|
||||
this.frm.set_df_property('supplied_items', 'cannot_add_rows', 1);
|
||||
this.frm.set_df_property('supplied_items', 'cannot_delete_rows', 1);
|
||||
}
|
||||
},
|
||||
|
||||
supplier: function() {
|
||||
var me = this;
|
||||
erpnext.utils.get_party_details(this.frm, null, null, function(){
|
||||
me.apply_price_list();
|
||||
|
||||
Reference in New Issue
Block a user