def _compute_delivery_status(self):
        precision = self.env['decimal.precision'].precision_get(
            'Product Unit of Measure')
        for line in self:
            if line.state not in ('purchase', 'done'):
                line.delivery_status = 'no'
                continue
            if line.order_id.force_delivered_status:
                line.delivery_status = line.order_id.force_delivered_status
                continue
            if float_compare(
                    (line.qty_received + line.qty_returned), line.product_qty,
                    precision_digits=precision) == -1:
                line.delivery_status = 'to receive'
            elif float_compare(
                    (line.qty_received + line.qty_returned), line.product_qty,
                    precision_digits=precision) >= 0:
                line.delivery_status = 'received'
            else:
                line.delivery_status = 'no'