mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 18:21:22 +00:00
fix: get address if multiple companies
(cherry picked from commit c6cf1bec76)
# Conflicts:
# erpnext/selling/doctype/sales_order/sales_order.js
This commit is contained in:
@@ -89,9 +89,36 @@ frappe.ui.form.on("Sales Order", {
|
|||||||
}, __('Get Items From'));
|
}, __('Get Items From'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
onload: function(frm) {
|
onload: function(frm) {
|
||||||
if (!frm.doc.transaction_date){
|
if (!frm.doc.transaction_date){
|
||||||
frm.set_value('transaction_date', frappe.datetime.get_today())
|
frm.set_value('transaction_date', frappe.datetime.get_today())
|
||||||
|
=======
|
||||||
|
// When multiple companies are set up. in case company name is changed set default company address
|
||||||
|
company: function (frm) {
|
||||||
|
if (frm.doc.company) {
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.setup.doctype.company.company.get_default_company_address",
|
||||||
|
args: {
|
||||||
|
name: frm.doc.company,
|
||||||
|
existing_address: frm.doc.company_address || ""
|
||||||
|
},
|
||||||
|
debounce: 2000,
|
||||||
|
callback: function (r) {
|
||||||
|
if (r.message) {
|
||||||
|
frm.set_value("company_address", r.message);
|
||||||
|
} else {
|
||||||
|
frm.set_value("company_address", "");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onload: function (frm) {
|
||||||
|
if (!frm.doc.transaction_date) {
|
||||||
|
frm.set_value("transaction_date", frappe.datetime.get_today());
|
||||||
|
>>>>>>> c6cf1bec76 (fix: get address if multiple companies)
|
||||||
}
|
}
|
||||||
erpnext.queries.setup_queries(frm, "Warehouse", function() {
|
erpnext.queries.setup_queries(frm, "Warehouse", function() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user