Skip to Content
Menu
This question has been flagged

Hi,

      I would like to create rules in Odoo to control things like max single order value, max cummulative order value across a time period for a user, max number of orders that can be place in a period for a user through rules. Can I use record rules for this purpose? Can you please point me to the relevant documentation. Also, is it possible to parameterize these rules and update the rules programmatically? The intent is to apply the rule with different parameters for different groups of users.


Thanks in advance,

    Best regards,

          Jaikish

Avatar
Discard
Best Answer

Hi Jaikish

I think that you don't need to create nothing new here, the Odoo record rules are model domains that could use the current user data to validate stuffs, so if you add the necessary fields on the user to compare the order value with the current user field value you will be ok. You could have calculated fields in the order model so it could calculate the sum of order values across a time period for the user and the number of orders in a period for the user to compare with the user specific field value in the record rule and that will lead you to a dynamic rule based in every user fields values without the need to alter the rule, just the user fields values

Avatar
Discard
Related Posts Replies Views Activity
0
Jun 15
2740
0
Sep 23
756
3
Sep 19
5651
0
Sep 24
3
0
Sep 24
347