-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Description
Information about bug
We always write the income account to item defaults. This duplicates the company's default income account across all items and makes it hard to change the default later on.
Introduced here: #13918
Replicate:
-
Set Default Income Account in Company
-
Create a new sales Item
-
Create a Sales Invoice for this item -> Income Account is fetched from Company and copied into Item (
item_defaults> Default Income Account)erpnext/erpnext/controllers/selling_controller.py
Lines 999 to 1003 in 2c4654a
def set_default_income_account_for_item(obj): for d in obj.get("items"): if d.item_code: if getattr(d, "income_account", None): set_item_default(d.item_code, obj.company, "income_account", d.income_account) -
Change Default Income Account in Company -> Default Income Account in Item still has the old value
Problem: If we want to change the Default Income Account, we have to do this for every item. This can become quite tedious when we have many items.
Possible solution: Keep Default Income Account in Item empty by default, fall back to using Default Income Account from Company. Or copy the income account to Item only if it's different from the Company's default.
Module
accounts
Version
v14 / v15 / develop
Installation method
None