Website Search Products
=======================

This module allows portal users to search and browse products in a structured table
with filtering and sorting capabilities using DataTables.

Features
========

* Display products available in the store in a searchable, sortable table
* Filter by product name, category, and price
* Show real-time stock availability per location
* Restrict access to portal and internal users only
* Automatic redirection for portal users after login
* Integration with Odoo's standard product and stock management

Installation
============

Install the module through the Odoo Apps interface or via:

.. code-block:: bash

    odoo-bin -d <database> -c <config_file> -i website_search_products

Configuration
=============

The module requires no additional configuration. It automatically:

1. Creates a menu item "Products in Shop" under the main website menu
2. Sets up routes for inventory search and login redirection
3. Filters products to show only those marked as "Available in POS"

Usage
=====

**For Portal Users:**

1. Navigate to the website
2. Click on "Products in Shop" in the menu
3. Browse the product table with real-time stock information
4. Use the search box to filter products by name
5. Click table headers to sort by different columns

**For Internal Users:**

1. After login, you will be redirected to the standard Odoo web interface
2. You can still access the product search page manually at ``/inventory/search``

**API Usage:**

The module extends ``stock.move`` with a method to retrieve movements by product:

.. code-block:: python

    stock_move_env = self.env['stock.move']
    result = stock_move_env.get_stock_moves_by_product(
        date_begin='2024-01-01',
        date_end='2024-01-31',
        location=5  # Location ID
    )
    # Returns list of dicts with product data and movements

Known issues / Roadmap
======================

* Consider adding product image thumbnails in the future
* Could benefit from advanced filtering by product attributes
* May need performance optimization for stores with very large product catalogs

Credits
=======

Authors:

* Criptomart
* Odoo Community Association (OCA)

Contributors:

* Your Company Name

The module uses DataTables.net library for enhanced table functionality.
