Merge branch 'develop' into version-16

This commit is contained in:
Rohit Waghchaure
2026-01-12 16:20:48 +05:30
5 changed files with 68 additions and 22 deletions

View File

@@ -7,6 +7,7 @@ on:
paths-ignore:
- '**.js'
- '**.css'
- '**.svg'
- '**.md'
- '**.html'
- 'crowdin.yml'

View File

@@ -231,28 +231,64 @@ frappe.ui.form.on("Asset", {
},
toggle_reference_doc: function (frm) {
if (frm.doc.purchase_receipt && frm.doc.purchase_invoice && frm.doc.docstatus === 1) {
frm.set_df_property("purchase_invoice", "read_only", 1);
frm.set_df_property("purchase_receipt", "read_only", 1);
} else if (frm.doc.is_existing_asset || frm.doc.is_composite_asset) {
frm.toggle_reqd("purchase_receipt", 0);
frm.toggle_reqd("purchase_invoice", 0);
frm.set_value("purchase_receipt", "");
frm.set_value("purchase_invoice", "");
} else if (frm.doc.purchase_receipt) {
// if purchase receipt link is set then set PI disabled
frm.toggle_reqd("purchase_invoice", 0);
frm.set_df_property("purchase_invoice", "read_only", 1);
} else if (frm.doc.purchase_invoice) {
// if purchase invoice link is set then set PR disabled
frm.toggle_reqd("purchase_receipt", 0);
frm.set_df_property("purchase_receipt", "read_only", 1);
} else {
frm.toggle_reqd("purchase_receipt", 1);
frm.set_df_property("purchase_receipt", "read_only", 0);
frm.toggle_reqd("purchase_invoice", 1);
frm.set_df_property("purchase_invoice", "read_only", 0);
const is_submitted = frm.doc.docstatus === 1;
const is_special_asset = frm.doc.is_existing_asset || frm.doc.is_composite_asset;
const clear_field = (field) => {
if (frm.doc[field]) {
frm.set_value(field, "");
}
};
["purchase_receipt", "purchase_receipt_item", "purchase_invoice", "purchase_invoice_item"].forEach(
(field) => {
frm.toggle_reqd(field, 0);
frm.set_df_property(field, "read_only", 0);
}
);
if (is_submitted) {
[
"purchase_receipt",
"purchase_receipt_item",
"purchase_invoice",
"purchase_invoice_item",
].forEach((field) => {
frm.set_df_property(field, "read_only", 1);
});
return;
}
if (is_special_asset) {
clear_field("purchase_receipt");
clear_field("purchase_receipt_item");
clear_field("purchase_invoice");
clear_field("purchase_invoice_item");
return;
}
if (frm.doc.purchase_receipt) {
frm.toggle_reqd("purchase_receipt_item", 1);
["purchase_invoice", "purchase_invoice_item"].forEach((field) => {
clear_field(field);
frm.set_df_property(field, "read_only", 1);
});
return;
}
if (frm.doc.purchase_invoice) {
frm.toggle_reqd("purchase_invoice_item", 1);
["purchase_receipt", "purchase_receipt_item"].forEach((field) => {
clear_field(field);
frm.set_df_property(field, "read_only", 1);
});
return;
}
frm.toggle_reqd("purchase_receipt", 1);
frm.toggle_reqd("purchase_invoice", 1);
},
make_journal_entry: function (frm) {

View File

@@ -456,4 +456,5 @@ erpnext.patches.v16_0.update_tax_withholding_field_in_payment_entry
erpnext.patches.v16_0.migrate_tax_withholding_data
erpnext.patches.v16_0.update_corrected_cancelled_status
erpnext.patches.v16_0.fix_barcode_typo
erpnext.patches.v16_0.set_post_change_gl_entries_on_pos_settings
erpnext.patches.v16_0.set_post_change_gl_entries_on_pos_settings
execute:frappe.delete_doc_if_exists("Workspace Sidebar", "Opening & Closing")

View File

@@ -0,0 +1,4 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20 0H8C3.58172 0 0 3.58172 0 8V20C0 24.4183 3.58172 28 8 28H20C24.4183 28 28 24.4183 28 20V8C28 3.58172 24.4183 0 20 0Z" fill="#0289F7"/>
<path d="M19.25 15.25H16.5302C15.2052 16.863 12.695 16.8722 11.3622 15.25H8.75V18.75C8.75 18.75 8.94588 18.75 9.1875 18.75H19.25C19.25 18.75 19.25 18.5541 19.25 18.3125V15.25ZM8.75 13.5H12.2979L12.5841 13.9589C13.2216 14.9788 14.7126 14.962 15.327 13.9281L15.5817 13.5H19.25V11.75H8.75V13.5ZM19.25 8.6875C19.25 8.44588 19.25 8.25 19.25 8.25H8.75C8.75 8.25 8.75 8.44588 8.75 8.6875V10H19.25V8.6875ZM21 18.3125C21 19.5206 20.0206 20.5 18.8125 20.5H9.1875C7.97938 20.5 7 19.5206 7 18.3125V8.6875C7 7.47938 7.97938 6.5 9.1875 6.5H18.8125C20.0206 6.5 21 7.47938 21 8.6875V18.3125Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 843 B

View File

@@ -0,0 +1,4 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20 0H8C3.58172 0 0 3.58172 0 8V20C0 24.4183 3.58172 28 8 28H20C24.4183 28 28 24.4183 28 20V8C28 3.58172 24.4183 0 20 0Z" fill="#0289F7" fill-opacity="0.1"/>
<path d="M19.25 15.25H16.5302C15.2052 16.863 12.695 16.8722 11.3622 15.25H8.75V18.75C8.75 18.75 8.94588 18.75 9.1875 18.75H19.25C19.25 18.75 19.25 18.5541 19.25 18.3125V15.25ZM8.75 13.5H12.2979L12.5841 13.9589C13.2216 14.9788 14.7126 14.962 15.327 13.9281L15.5817 13.5H19.25V11.75H8.75V13.5ZM19.25 8.6875C19.25 8.44588 19.25 8.25 19.25 8.25H8.75C8.75 8.25 8.75 8.44588 8.75 8.6875V10H19.25V8.6875ZM21 18.3125C21 19.5206 20.0206 20.5 18.8125 20.5H9.1875C7.97938 20.5 7 19.5206 7 18.3125V8.6875C7 7.47938 7.97938 6.5 9.1875 6.5H18.8125C20.0206 6.5 21 7.47938 21 8.6875V18.3125Z" fill="#0981E3"/>
</svg>

After

Width:  |  Height:  |  Size: 864 B