Check box by script

How can i check box by custom script?

Please explain your use case in detail.


 frappe.ui.form.on("Purchase Invoice", "validate", function(frm) {
    $.each(frm.doc.parcelas || [], function(i, d) {
        // Create titulo{
		method: "financeiro.financeiro.doctype.titulos.titulos.make_titulo",
			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,
		callback: function(r){}


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 = parte = empresa
	payment_entry.append("references", {"reference_doctype": "Purchase Invoice" })
	payment_entry.flags.ignore_validate = True
    payment_entry.flags.ignore_mandatory = True

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: