Hi Guys,
This is my code only last record is printing in child table, May I know what mistake i have done in this code.
kindly reply!
Thanks in advance!
@frappe.whitelist()
def onchange_autofill(self):
if self.autofill:
product_categories = frappe.get_all(
'Item Group', fields=['parent_item_group', 'name'])
print(product_categories)
annual_point_scheme_lines = []
for i in product_categories:
# print(i.parent_item_group)
if i.parent_item_group:
annual_point_scheme_lines.append(i.name)
print(annual_point_scheme_lines, 'kkkkkkkkkkk')
var = self.annual_point_scheme_line
for line in var:
for i in annual_point_scheme_lines:
print(i,'iiiiiiiiiiiiiiiiiii')
line.categ_id = i
line.point_assigned = 1