I have a custom field in product.template form. 'Cotton Qty'
I wish to create a new unit of measure as per below criteria.
If user put 24 in this field, and press update button, odoo should check if any existing uom present for factor_inv = 24 and uom category = producut_id.uom_id (eg: unit(s) or g or m etc). If any uom available with this critaria, it should set it for the purchase unit of measure for this product.
If no any unit available, odoo should create a new uom with following values.
Unit name = Cotton 24
category = product_id.uom (eg unit(s))
factor_inv -= 24
rounding = 1/24
and then set this newly created unit of measure for purchase unit of measure.
Any help?