fix: purchase invoice qty change not recalculate the consumed qty and added test cases for purchase invoice

This commit is contained in:
Rohit Waghchaure
2021-06-15 17:29:52 +05:30
parent 6bbc8ec3e8
commit 110e152fa3
8 changed files with 463 additions and 498 deletions

View File

@@ -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();