Skip to content

Commit

Permalink
fix: enable allow negative stock by default in reposts (frappe#29331)
Browse files Browse the repository at this point in the history
Negative stock validation is done BEFORE reposting as such it's not
required to be performed again and most likely this fails on old
intermediate data where user has no clue why it failed.
  • Loading branch information
ankush authored Jan 18, 2022
1 parent 48f3d53 commit fabe0bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"actions": [],
"autoname": "REPOST-ITEM-VAL-.######",
"creation": "2020-10-22 22:27:07.742161",
"creation": "2022-01-11 15:03:38.273179",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
Expand Down Expand Up @@ -129,7 +129,7 @@
"reqd": 1
},
{
"default": "0",
"default": "1",
"fieldname": "allow_negative_stock",
"fieldtype": "Check",
"label": "Allow Negative Stock"
Expand Down Expand Up @@ -177,7 +177,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-11-24 02:18:10.524560",
"modified": "2022-01-18 10:57:33.450907",
"modified_by": "Administrator",
"module": "Stock",
"name": "Repost Item Valuation",
Expand Down Expand Up @@ -227,5 +227,6 @@
}
],
"sort_field": "modified",
"sort_order": "DESC"
}
"sort_order": "DESC",
"states": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def reset_field_values(self):
self.item_code = None
self.warehouse = None

self.allow_negative_stock = self.allow_negative_stock or \
cint(frappe.db.get_single_value("Stock Settings", "allow_negative_stock"))
self.allow_negative_stock = 1

def set_company(self):
if self.based_on == "Transaction":
Expand Down

0 comments on commit fabe0bc

Please sign in to comment.