'Check if the UoM has the same category as the product standard UoM'

@api.constrains('product_id')
def _check_product_uom(self):

    if any(((orderpoint.product_id.uom_id.category_id != orderpoint.product_uom.category_id) for orderpoint in self)):
        raise ValidationError(_('You    have    to    select    a    product    unit    of    measure    in    the    same    category    than    the    default    unit    of    measure    of    the    product'))
