Check box by script

How can i check box by custom script?

Please explain your use case in detail.

JS:

 frappe.ui.form.on("Purchase Invoice", "validate", function(frm) {
    $.each(frm.doc.parcelas || [], function(i, d) {
        // Create titulo
        frappe.call({
		method: "financeiro.financeiro.doctype.titulos.titulos.make_titulo",
		args:{    
			vencimento_parcela: d.vencimento_parcela,
			valor_parcela: d.valor_parcela,
			bill_no: frm.doc.bill_no,
			posting_date: frm.doc.posting_date,
			supplier_name: frm.doc.supplier_name,
			company: frm.doc.company,
		},
		callback: function(r){}
        });
    });
});

PY:

@frappe.whitelist()
def make_payment_entry(data_vencimento, valor_titulo, numero_nota, data_postagem, parte, empresa):
    payment_entry = frappe.new_doc("Payment Entry")
    payment_entry.naming_series = "PAG-TIT-"
    payment_entry.party_type = "Supplier"
    payment_entry.payment_type = "Pay"
    payment_entry.due_date = data_vencimento
    payment_entry.paid_amount = valor_titulo
    payment_entry.bill_no = numero_nota
    payment_entry.posting_date = data_postagem
    payment_entry.party = parte
    payment_entry.company = empresa
	payment_entry.append("references", {"reference_doctype": "Purchase Invoice" })
	payment_entry.flags.ignore_validate = True
    payment_entry.flags.ignore_mandatory = True
    payment_entry.save()
    return payment_entry.name

In Payment Entry has a checkbox field:

I wanna select this while creating the payment entry

In python:

payment_entry.allocate_payment_amount = 1

Thank you, but the table it’s not showing i don’t know why… maybe cause im setting the value in a wrong way, what do you think?

Doctype of table:

Is the payment entry made? In whitelist methods I sometimes needed to do frappe.db.commit() to submit the database queries.

Not worked yet :confused: