'For single product inventory, total quantity of the counted'

@api.one
@api.depends('product_id', 'line_ids.product_qty')
def _compute_total_qty(self):

    if self.product_id:
        self.total_qty = sum(self.mapped('line_ids').mapped('product_qty'))
    else:
        self.total_qty = 0
