Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Set Combined Pricing Rules in ERPNext? #45172

Open
evolkavi opened this issue Jan 8, 2025 · 3 comments
Open

How to Set Combined Pricing Rules in ERPNext? #45172

evolkavi opened this issue Jan 8, 2025 · 3 comments

Comments

@evolkavi
Copy link

evolkavi commented Jan 8, 2025

In the Pricing Rule Doctype, the applied_on field has options: Item Group, Brand, Item Code and Transactions. These options appear to be mutually exclusive.

For example, I want to set a pricing rule that applies to:

Item Group ABC
Brand XYZ
This would mean the rule applies only to items that belong to Item Group ABC and are of Brand XYZ.

Currently, I am unable to set this combination because the applied_on field restricts me to select only one option at a time.

Is there a way to achieve this combination?
If not, what would be the best approach to handle such a scenario?

Looking forward to your suggestions!

@mihir-kandoi
Copy link
Contributor

@nabinhait @rohitwaghchaure please advise if this feature should be worked upon

@singhranbir
Copy link

Write a custom condition in the Dynamic Condition field, such as:
item_group == 'ABC' and brand == 'XYZ'

you can apply the rule for an Item or Item Group and then Apply the Dynamic Condition.

It is Working Fine for me.

@evolkavi
Copy link
Author

evolkavi commented Jan 9, 2025

The field item_group you mentioned seems to be from the quotation_item child table, correct? If so, this dynamic condition will not work because it evaluates the condition against the parent document, not the child table.

When using fields from a child table like item_group in quotation_item, the system doesn't have the context to evaluate those fields directly unless the condition explicitly references the child table and its structure.

However, when you use a field from the parent document (e.g., quotation), the condition works because it directly evaluates the parent field values. This limitation exists because the condition logic doesn't iterate over child table rows to match specific values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants