Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I would like to know if it is possible to create a custom field, for example a threshold for a product, and when the quantity of products is lower than the threshold, the system sends a mail to one of the entities of the system (like Administrator or other people...)
Anybody knows how to perform it?
I think you can achieve this by defining your own custom field and you can use your script for checking that number in write method and if its positive you can send e-mail(by using script).
By giving the script in write method it will execute and check every time when the value is changed.
Or you can use scheduled actions, but it will execute only at given intervals.
Hope this helps.
from openerp import models, fields, api
_inherit = 'product.template'
threshold = fields.Integer('Threshold')
def check_product_qty(self, cr, uid, context=None):
ids = self.search(cr, uid, , context)
products = self.browse(cr, uid, ids, context)
for product in products:
if product.qty_available < product.threshold:
// Write actions for sending mail here
<record model="ir.cron" id="check_poduct_qty_with_threshold">
<field eval="False" name="doall"/>
<field eval="'product.template'" name="model"/>
<field eval="'check_product_qty'" name="function"/>
<field eval="'()'" name="args"/>
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 2/9/16, 9:54 AM|
|Seen: 864 times|
|Last updated: 2/10/16, 4:31 AM|