Merge pull request #31656 from ruthra-kumar/use_current_profile_in_pos_return

fix: use current pos profile on sales return
This commit is contained in:
Deepesh Garg 2022-07-22 13:10:53 +05:30 committed by GitHub
commit 80b354f1c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -497,7 +497,10 @@ erpnext.PointOfSale.Controller = class {
set_pos_profile_data() { set_pos_profile_data() {
if (this.company && !this.frm.doc.company) this.frm.doc.company = this.company; if (this.company && !this.frm.doc.company) this.frm.doc.company = this.company;
if (this.pos_profile && !this.frm.doc.pos_profile) this.frm.doc.pos_profile = this.pos_profile; if ((this.pos_profile && !this.frm.doc.pos_profile) | (this.frm.doc.is_return && this.pos_profile != this.frm.doc.pos_profile)) {
this.frm.doc.pos_profile = this.pos_profile;
}
if (!this.frm.doc.company) return; if (!this.frm.doc.company) return;
return this.frm.trigger("set_pos_data"); return this.frm.trigger("set_pos_data");