Best Practice: Dynamic Income Account determination for Items (v15.95.0)

Hi everyone,

I’m looking for a best-practice solution regarding dynamic account determination in ERPNext.

My Environment:

  • ERPNext: v15.95.0

  • Frappe Framework: v15.97.0

The Situation: We have specific items (e.g., fines or administrative fees) that must be posted to different Income Accounts depending on the customer’s origin (Domestic, EU, or Export).

The Challenge: The “Item Accounting Defaults” section in the Item master only allows for one fixed Income Account per company. This creates a major issue during manual data entry:

Even if I select an international customer (e.g., from the EU or a non-EU country) and then add the item, the system still pulls the domestic Income Account defined in the Item master. It does not realize that a different account is required based on the customer’s location.

I want to avoid manual selection by the user to ensure the Chart of Accounts stays clean and accurate. How did you handle this requirement in your setup?

Hi @kezi

There is no any standard functionality to get an account automatically in ERPNext. You can only define a single account in the item default. You have to write a custom logic to achieve this.

Thanks

Hi @kezi
IN the accounting module, have you tried exploring cost centers, projects and accounting dimensions?
They could be useful in your case if I have understood your problem properly