after change child table value using frappe.model.set_value, when i print child table in console it shows updated values. But selecting particular field it shows old value.
try this:
frm.refresh_field('child_table_name');
Thanks for replay
I try frm.refresh_field(“items”).
after printing the first row like console.log(item_rownew) retrives
- actual_batch_qty: 0
- actual_qty: 0
- against_blanket_order: null
- allow_zero_valuation_rate: 0
- amount: 1750
- barcodes: []
- base_amount: 1750
- base_net_amount: 1666.67
- base_net_rate: 333.33
- base_price_list_rate: 350
- base_rate: 350
- base_rate_with_margin: 0
- batch_no: null
- bom_no: “BOM-test-001”
- brand: null
- child_docname: “new-pos-invoice-item-2”
- company_total_stock: 0
- conversion_factor: 4
- cost_center: “Main - VE”
- customer_item_code: null
- delivered_by_supplier: 0
- delivered_qty: 0
- description: “test”
- discount_amount: 0
- discount_percentage: 0
- docstatus: 0
- doctype: “POS Invoice Item”
- enable_deferred_revenue: 0
- expense_account: “Cost of Goods Sold - VE”
- free_item_data: “”
- has_batch_no: 0
- has_margin: false
- has_serial_no: 0
- idx: 1
- image: “”
- income_account: “Sales - VE”
- is_fixed_asset: 0
- is_free_item: 0
- item_code: “test”
- item_group: “Party”
- item_name: “test”
- item_tax_rate: “{}”
- last_purchase_rate: 0
- manufacturer: null
- manufacturer_part_no: null
- margin_rate_or_amount: 0
- margin_type: “”
- min_order_qty: “”
- name: “new-pos-invoice-item-2”
- net_amount: 1666.6666666666665
- net_rate: 333.33
- owner: “Administrator”
- page_break: 0
- parent: “new-pos-invoice-1”
- parentfield: “items”
- parenttype: “POS Invoice”
- price_list_rate: 350
- projected_qty: 21
- qty: 5
- rate: 350
- rate_with_margin: 0
- reserved_qty: 0
- serial_no: null
- stock_qty: 20
- stock_uom: “4h”
- stock_uom_rate: 87.5
- supplier: null
- tax_amount: 0
- tax_rate: 0
- total_amount: 0
- total_weight: 0
- transaction_date: “2021-11-02”
- uom: “4h”
- update_stock: 0
- valuation_rate: 0
- warehouse: “Stores - VE”
- weight_per_unit: 0
- weight_uom: null
- __islocal: 1
- __unsaved: 1
and when print paricular field from this shows old value like
console.log(item_rownew.rate) retrives 200 that is old value
If I do any changes from page,not through code, after that it will shows updated value.
I think some refresh is missing