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
mergify[bot] committed May 9, 2022
1 parent 80f7d66 commit a0e39db
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
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 a0e39db

Please sign in to comment.