fix: use current pos profile on sales return

(cherry picked from commit 5b85af5f1a)
This commit is contained in:
ruthra kumar
2022-07-21 11:58:33 +05:30
committed by Mergify
parent 13639682ce
commit c442b4aef1

View File

@@ -497,7 +497,10 @@ erpnext.PointOfSale.Controller = class {
set_pos_profile_data() {
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;
return this.frm.trigger("set_pos_data");