mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-02 04:58:29 +00:00
fix(item): avoid inheriting item defaults from identically named items (#49571)
(cherry picked from commit 9e58a56b5c)
# Conflicts:
# erpnext/stock/doctype/item/item.py
This commit is contained in:
committed by
Mergify
parent
194ab87fef
commit
a28dfcd44c
@@ -726,9 +726,32 @@ class Item(Document):
|
|||||||
if self.item_defaults or not self.item_group:
|
if self.item_defaults or not self.item_group:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
item_group = frappe.get_cached_doc("Item Group", self.item_group)
|
item_group = frappe.get_cached_doc("Item Group", self.item_group)
|
||||||
if item_group.item_group_defaults:
|
if item_group.item_group_defaults:
|
||||||
for item in item_group.item_group_defaults:
|
for item in item_group.item_group_defaults:
|
||||||
|
=======
|
||||||
|
item_defaults = frappe.db.get_values(
|
||||||
|
"Item Default",
|
||||||
|
{
|
||||||
|
"parent": self.item_group,
|
||||||
|
"parenttype": "Item Group",
|
||||||
|
},
|
||||||
|
[
|
||||||
|
"company",
|
||||||
|
"default_warehouse",
|
||||||
|
"default_price_list",
|
||||||
|
"buying_cost_center",
|
||||||
|
"default_supplier",
|
||||||
|
"expense_account",
|
||||||
|
"selling_cost_center",
|
||||||
|
"income_account",
|
||||||
|
],
|
||||||
|
as_dict=1,
|
||||||
|
)
|
||||||
|
if item_defaults:
|
||||||
|
for item in item_defaults:
|
||||||
|
>>>>>>> 9e58a56b5c (fix(item): avoid inheriting item defaults from identically named items (#49571))
|
||||||
self.append(
|
self.append(
|
||||||
"item_defaults",
|
"item_defaults",
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user