Merge pull request #17159 from rohitwaghchaure/sales_return_not_working_for_bundle_items

fix: sales return not working for product bundle items
This commit is contained in:
Nabin Hait 2019-04-11 11:44:57 +05:30 committed by GitHub
commit 0f62b13dd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -244,6 +244,10 @@ def make_return_doc(doctype, source_name, target_doc=None):
doc.paid_amount = -1 * source.paid_amount
doc.base_paid_amount = -1 * source.base_paid_amount
if doc.get("is_return") and hasattr(doc, "packed_items"):
for d in doc.get("packed_items"):
d.qty = d.qty * -1
doc.discount_amount = -1 * source.discount_amount
doc.run_method("calculate_taxes_and_totals")