From c442b4aef1a298c7e19eef2084534e32378a54ee Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 21 Jul 2022 11:58:33 +0530 Subject: [PATCH] fix: use current pos profile on sales return (cherry picked from commit 5b85af5f1a33f8ec01282d6081e922a89e668efb) --- erpnext/selling/page/point_of_sale/pos_controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/page/point_of_sale/pos_controller.js b/erpnext/selling/page/point_of_sale/pos_controller.js index cb4bd51415b..da7576e08de 100644 --- a/erpnext/selling/page/point_of_sale/pos_controller.js +++ b/erpnext/selling/page/point_of_sale/pos_controller.js @@ -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");