Skip to content

Commit

Permalink
fix(pos): creating pos returns resets pricing rules & discounts (frap…
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib authored and hrwX committed May 10, 2022
1 parent 77b9273 commit 249bb76
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions erpnext/selling/page/point_of_sale/pos_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,16 +479,20 @@ erpnext.PointOfSale.Controller = class {
frappe.dom.freeze();
this.frm = this.get_new_frm(this.frm);
this.frm.doc.items = [];
const res = await frappe.call({
return frappe.call({
method: "erpnext.accounts.doctype.pos_invoice.pos_invoice.make_sales_return",
args: {
'source_name': doc.name,
'target_doc': this.frm.doc
},
callback: (r) => {
frappe.model.sync(r.message);
frappe.get_doc(r.message.doctype, r.message.name).__run_link_triggers = false;
this.set_pos_profile_data().then(() => {
frappe.dom.unfreeze();
});
}
});
frappe.model.sync(res.message);
await this.set_pos_profile_data();
frappe.dom.unfreeze();
}

set_pos_profile_data() {
Expand Down

0 comments on commit 249bb76

Please sign in to comment.