Skip to content

Commit

Permalink
fix: button fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anhilmy committed Aug 13, 2024
1 parent c405a55 commit 5eed4d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inn/public/js/purchase-order/purchase-order.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
frappe.ui.form.on("Purchase Order", {
refresh: function (frm) {
if (doc.status === 0) {
if (frm.doc.docstatus === 0) {
frm.add_custom_button(
__("Check Last Purchase"),
async function () {
Expand All @@ -11,6 +11,11 @@ frappe.ui.form.on("Purchase Order", {
}
)
}
},
before_save: async function (frm) {
for (const row of frm.doc.items) {
await get_last_purchase(frm, row)
}
}
})

Expand Down

0 comments on commit 5eed4d6

Please sign in to comment.