Some defult service items are creted by usning fixtures. in that case while installing the sudtom app in server and start migrating the site it shows the following error
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 1241, in runner
add_to_return_value(self, fn(self, *args, kwargs))
self =
method = 'after_insert'
args = ()
kwargs = {}
add_to_return_value = <function Document.hook..add_to_return_value at 0x7f67d695d240>
fn = <function Document.run_method..fn at 0x7f67d72a00d0>
hooks = (<function notify_consumers at 0x7f67d88cc820>,)
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 906, in fn
return method_object(*args, *kwargs)
self =
args = ()
kwargs = {}
method_object = <bound method Item.after_insert of >
method = 'after_insert'
File "/home/d-code/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 77, in after_insert
self.add_price(default.default_price_list)
self =
default =
File "/home/d-code/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 160, in add_price
item_price.insert()
self =
price_list = 'Standard Selling'
item_price = <ItemPrice: 01e448e261>
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 259, in insert
self.run_before_save_methods()
self = <ItemPrice: 01e448e261>
ignore_permissions = None
ignore_links = None
ignore_if_duplicate = False
ignore_mandatory = None
set_name = None
set_child_names = True
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 1040, in run_before_save_methods
self.run_method("validate")
self = <ItemPrice: 01e448e261>
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 909, in run_method
out = Document.hook(fn)(self, args, kwargs)
self = <ItemPrice: 01e448e261>
args = ()
kwargs = {}
fn = <function Document.run_method..fn at 0x7f67d64cdea0>
method = 'validate'
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 1259, in composer
return composed(self, method, *args, kwargs)
self = <ItemPrice: 01e448e261>
args = ()
kwargs = {}
hooks = [<function apply at 0x7f67d7d38670>]
method = 'validate'
doc_events = {'': {'after_insert': ['frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers'], 'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.core.doctype.activity_log.feed.update_feed', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_co...
handler = 'erpnext.support.doctype.service_level_agreement.service_level_agreement.apply'
composed = <function Document.hook..compose..runner at 0x7f67d64e9870>
compose = <function Document.hook..compose at 0x7f67d64e9900>
f = <function Document.run_method..fn at 0x7f67d64cdea0>
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 1241, in runner
add_to_return_value(self, fn(self, args, kwargs))
self = <ItemPrice: 01e448e261>
method = 'validate'
args = ()
kwargs = {}
add_to_return_value = <function Document.hook..add_to_return_value at 0x7f67d64e96c0>
fn = <function Document.run_method..fn at 0x7f67d64cdea0>
hooks = (<function apply at 0x7f67d7d38670>,)
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 906, in fn
return method_object(*args, **kwargs)
self = <ItemPrice: 01e448e261>
args = ()
kwargs = {}
method_object = <bound method ItemPrice.validate of <ItemPrice: 01e448e261>>
method = 'validate'
File "/home/d-code/frappe-bench/apps/erpnext/erpnext/stock/doctype/item_price/item_price.py", line 23, in validate
self.check_duplicates()
self = <ItemPrice: 01e448e261>
File "/home/d-code/frappe-bench/apps/erpnext/erpnext/stock/doctype/item_price/item_price.py", line 112, in check_duplicates
frappe.throw(
self = <ItemPrice: 01e448e261>
item_price = Table('tabItem Price')
query = SELECT price_list_rate FROM tabItem Price WHERE item_code='Page' AND price_list='Standard Selling' AND name<>'01e448e261' AND uom='Nos' AND (valid_from IS NULL OR CONCAT(valid_from,'')='') AND (valid_upto IS NULL OR CONCAT(valid_upto,'')='') AND (customer IS NULL OR CONCAT(customer,'')='') AND (supplier IS NULL OR CONCAT(supplier,'')='') AND (batch_no IS NULL OR CONCAT(batch_no,'')='') AND (packing_unit IS NULL OR packing_unit=0)
data_fields = ('uom', 'valid_from', 'valid_upto', 'customer', 'supplier', 'batch_no')
number_fields = ['packing_unit']
field = 'packing_unit'
price_list_rate = [{'price_list_rate': 500.0}]
File "/home/d-code/frappe-bench/apps/frappe/frappe/init.py", line 525, in throw
msgprint(
msg = 'Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.'
exc = <class 'erpnext.stock.doctype.item_price.item_price.ItemPriceDuplicateItem'>
title = None
is_minimizable = False
wide = False
as_list = False
File "/home/d-code/frappe-bench/apps/frappe/frappe/init.py", line 493, in msgprint
_raise_exception()
title = None
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
sys = <module 'sys' (built-in)>
out = {'message': 'Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1}
_raise_exception = <function msgprint.._raise_exception at 0x7f67d64e9b40>
_strip_html_tags = <functools._lru_cache_wrapper object at 0x7f67d64d1d20>
msg = 'Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.'
raise_exception = <class 'erpnext.stock.doctype.item_price.item_price.ItemPriceDuplicateItem'>
strip_html_tags = <function strip_html_tags at 0x7f67dc6051b0>
...skipped... 1 vars
File "/home/d-code/frappe-bench/apps/frappe/frappe/init.py", line 442, in _raise_exception
raise raise_exception(msg)
msg = 'Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.'
raise_exception = <class 'erpnext.stock.doctype.item_price.item_price.ItemPriceDuplicateItem'>
...skipped... 1 vars
erpnext.stock.doctype.item_price.item_price.ItemPriceDuplicateItem: Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.
Module
stock
Version
frappe 14.27.0
ERPNext14.18.1
Installation method
None
Relevant log output / Stack trace / Full Error Message.
I tested with multiple times, we exported the whole item price with export-fixtures and then migrate the site but we haven't faced any type of issue on the latest version 14 and 15.
Information about bug
Some defult service items are creted by usning fixtures. in that case while installing the sudtom app in server and start migrating the site it shows the following error
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 1241, in runner add_to_return_value(self, fn(self, *args, kwargs)) self =
method = 'after_insert'
args = ()
kwargs = {}
add_to_return_value = <function Document.hook..add_to_return_value at 0x7f67d695d240>
fn = <function Document.run_method..fn at 0x7f67d72a00d0>
hooks = (<function notify_consumers at 0x7f67d88cc820>,)
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 906, in fn
return method_object(*args, *kwargs)
self =
args = ()
kwargs = {}
method_object = <bound method Item.after_insert of >
method = 'after_insert'
File "/home/d-code/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 77, in after_insert
self.add_price(default.default_price_list)
self =
default =
File "/home/d-code/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 160, in add_price
item_price.insert()
self =
price_list = 'Standard Selling'
item_price = <ItemPrice: 01e448e261>
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 259, in insert
self.run_before_save_methods()
self = <ItemPrice: 01e448e261>
ignore_permissions = None
ignore_links = None
ignore_if_duplicate = False
ignore_mandatory = None
set_name = None
set_child_names = True
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 1040, in run_before_save_methods
self.run_method("validate")
self = <ItemPrice: 01e448e261>
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 909, in run_method
out = Document.hook(fn)(self, args, kwargs)
self = <ItemPrice: 01e448e261>
args = ()
kwargs = {}
fn = <function Document.run_method..fn at 0x7f67d64cdea0>
method = 'validate'
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 1259, in composer
return composed(self, method, *args, kwargs)
self = <ItemPrice: 01e448e261>
args = ()
kwargs = {}
hooks = [<function apply at 0x7f67d7d38670>]
method = 'validate'
doc_events = {'': {'after_insert': ['frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers'], 'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.core.doctype.activity_log.feed.update_feed', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_co...
handler = 'erpnext.support.doctype.service_level_agreement.service_level_agreement.apply'
composed = <function Document.hook..compose..runner at 0x7f67d64e9870>
compose = <function Document.hook..compose at 0x7f67d64e9900>
f = <function Document.run_method..fn at 0x7f67d64cdea0>
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 1241, in runner
add_to_return_value(self, fn(self, args, kwargs))
self = <ItemPrice: 01e448e261>
method = 'validate'
args = ()
kwargs = {}
add_to_return_value = <function Document.hook..add_to_return_value at 0x7f67d64e96c0>
fn = <function Document.run_method..fn at 0x7f67d64cdea0>
hooks = (<function apply at 0x7f67d7d38670>,)
File "/home/d-code/frappe-bench/apps/frappe/frappe/model/document.py", line 906, in fn
return method_object(*args, **kwargs)
self = <ItemPrice: 01e448e261>
args = ()
kwargs = {}
method_object = <bound method ItemPrice.validate of <ItemPrice: 01e448e261>>
method = 'validate'
File "/home/d-code/frappe-bench/apps/erpnext/erpnext/stock/doctype/item_price/item_price.py", line 23, in validate
self.check_duplicates()
self = <ItemPrice: 01e448e261>
File "/home/d-code/frappe-bench/apps/erpnext/erpnext/stock/doctype/item_price/item_price.py", line 112, in check_duplicates
frappe.throw(
self = <ItemPrice: 01e448e261>
item_price = Table('tabItem Price')
query = SELECT ._raise_exception at 0x7f67d64e9b40>
_strip_html_tags = <functools._lru_cache_wrapper object at 0x7f67d64d1d20>
msg = 'Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.'
raise_exception = <class 'erpnext.stock.doctype.item_price.item_price.ItemPriceDuplicateItem'>
strip_html_tags = <function strip_html_tags at 0x7f67dc6051b0>
...skipped... 1 vars
File "/home/d-code/frappe-bench/apps/frappe/frappe/init.py", line 442, in _raise_exception
raise raise_exception(msg)
msg = 'Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.'
raise_exception = <class 'erpnext.stock.doctype.item_price.item_price.ItemPriceDuplicateItem'>
...skipped... 1 vars
erpnext.stock.doctype.item_price.item_price.ItemPriceDuplicateItem: Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.
price_list_rate
FROMtabItem Price
WHEREitem_code
='Page' ANDprice_list
='Standard Selling' ANDname
<>'01e448e261' ANDuom
='Nos' AND (valid_from
IS NULL OR CONCAT(valid_from
,'')='') AND (valid_upto
IS NULL OR CONCAT(valid_upto
,'')='') AND (customer
IS NULL OR CONCAT(customer
,'')='') AND (supplier
IS NULL OR CONCAT(supplier
,'')='') AND (batch_no
IS NULL OR CONCAT(batch_no
,'')='') AND (packing_unit
IS NULL ORpacking_unit
=0) data_fields = ('uom', 'valid_from', 'valid_upto', 'customer', 'supplier', 'batch_no') number_fields = ['packing_unit'] field = 'packing_unit' price_list_rate = [{'price_list_rate': 500.0}] File "/home/d-code/frappe-bench/apps/frappe/frappe/init.py", line 525, in throw msgprint( msg = 'Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.' exc = <class 'erpnext.stock.doctype.item_price.item_price.ItemPriceDuplicateItem'> title = None is_minimizable = False wide = False as_list = False File "/home/d-code/frappe-bench/apps/frappe/frappe/init.py", line 493, in msgprint _raise_exception() title = None as_table = False as_list = False indicator = 'red' alert = False primary_action = None is_minimizable = False wide = False sys = <module 'sys' (built-in)> out = {'message': 'Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, Batch, UOM, Qty, and Dates.', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1} _raise_exception = <function msgprint.Module
stock
Version
frappe 14.27.0 ERPNext14.18.1
Installation method
None
Relevant log output / Stack trace / Full Error Message.
No response