always set the company from the POS Profile

This commit is contained in:
Rohit Waghchaure 2019-04-05 09:54:55 +05:30
parent e8e3fb175d
commit c2ed03f77a

View File

@ -488,16 +488,15 @@ erpnext.pos.PointOfSale = class PointOfSale {
}
setup_company() {
this.company = frappe.sys_defaults.company;
return new Promise(resolve => {
if(!this.company) {
if(!frappe.sys_defaults.company) {
frappe.prompt({fieldname:"company", options: "Company", fieldtype:"Link",
label: __("Select Company"), reqd: 1}, (data) => {
this.company = data.company;
resolve(this.company);
}, __("Select Company"));
} else {
resolve(this.company);
resolve();
}
})
}
@ -551,7 +550,9 @@ erpnext.pos.PointOfSale = class PointOfSale {
}
set_pos_profile_data() {
this.frm.doc.company = this.company;
if (this.company) {
this.frm.doc.company = this.company;
}
return new Promise(resolve => {
return this.frm.call({