fix: enable allow negative stock by default in reposts (#29331)

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.
This commit is contained in:
Ankush Menat 2022-01-18 11:48:44 +05:30 committed by GitHub
parent 48f3d53556
commit fabe0bce15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -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",
@ -129,7 +129,7 @@
"reqd": 1
},
{
"default": "0",
"default": "1",
"fieldname": "allow_negative_stock",
"fieldtype": "Check",
"label": "Allow Negative Stock"
@ -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",
@ -227,5 +227,6 @@
}
],
"sort_field": "modified",
"sort_order": "DESC"
}
"sort_order": "DESC",
"states": []
}

View File

@ -27,8 +27,7 @@ class RepostItemValuation(Document):
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":