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,
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
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 11/20/16, 10:17 PM|
|Seen: 66 times|
|Last updated: 11/21/16, 3:06 AM|