fix: while making the item, default warehouse not set even if the stock settings has the warehouse
This commit is contained in:
parent
c356fef9c4
commit
5e7b4ca6a4
@ -723,7 +723,18 @@ class Item(WebsiteGenerator):
|
|||||||
'income_account': item.income_account
|
'income_account': item.income_account
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.append("item_defaults", {"company": frappe.defaults.get_defaults().company})
|
warehouse = ''
|
||||||
|
defaults = frappe.defaults.get_defaults() or {}
|
||||||
|
|
||||||
|
# To check default warehouse is belong to the default company
|
||||||
|
if defaults.get("default_warehouse") and frappe.db.exists("Warehouse",
|
||||||
|
{'name': defaults.default_warehouse, 'company': defaults.company}):
|
||||||
|
warehouse = defaults.default_warehouse
|
||||||
|
|
||||||
|
self.append("item_defaults", {
|
||||||
|
"company": defaults.get("company"),
|
||||||
|
"default_warehouse": warehouse
|
||||||
|
})
|
||||||
|
|
||||||
def update_variants(self):
|
def update_variants(self):
|
||||||
if self.flags.dont_update_variants or \
|
if self.flags.dont_update_variants or \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user