I'm making an automated action to check if reordering rules are created when the user creates/updates the product, and if not, a warning message should appear. But so far, without success. What is wrong with my automated action?
I can't post a picture here, so... the automated action is as follows:
Model: Product
Trigger Condition: On Creation and Update
Watched Fields: nbr_reordering_rules
Before Domain Update: All Records
Apply in: (All) Products -> (Any) Can be Purchased or Route Contains Purchase
Action to Perform: Execute Python Code
Python code:
for record in records:
raise Warning("No Reordering Rules are set for this product. Create Reordering Rules before saving.")