File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
frappe . ui . form . on ( "Purchase Receipt" , {
2
+ refresh : function ( frm ) {
3
+ frm . fields_dict [ "custom_item_duplicate" ] . grid . wrapper . on (
4
+ "change" ,
5
+ 'input[data-fieldname="qty"]' ,
6
+ function ( ) {
7
+ roles = frappe . user_roles ;
8
+ if ( roles . includes ( "Store Dept" ) && ! roles . includes ( "Administrator" ) ) {
9
+ frm . doc . custom_item_duplicate . map ( ( item ) => {
10
+ frm . doc . items . map ( ( new_item ) => {
11
+ if ( new_item . item_code == item . item_code ) {
12
+ new_item . qty = item . qty ;
13
+ new_item . received_qty = item . qty ;
14
+ new_item . received_stock_qty = item . qty ;
15
+ new_item . stock_qty = item . qty ;
16
+ }
17
+ } ) ;
18
+ } ) ;
19
+ frm . refresh_field ( "items" ) ;
20
+ }
21
+ }
22
+ ) ;
23
+ } ,
2
24
onload : function ( frm ) {
3
25
if (
4
26
frappe . user_roles . includes ( "Store Dept" ) &&
You can’t perform that action at this time.
0 commit comments