Metadata-Version: 2.1
Name: odoo-addon-sale_product_catalog_extended
Version: 18.0.1.0.0.17
Requires-Python: >=3.10
Requires-Dist: odoo-addon-onchange_helper==18.0.*
Requires-Dist: odoo==18.0.*
Summary: Sale Product Catalog Extended
Home-page: https://github.com/OCA/sale-workflow
License: AGPL-3
Author: Tecnativa, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

=============================
Sale Product Catalog Extended
=============================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:9721282d7e17672f5588ccfac93c3361107253bf996ebe096210f2f6fd06689e
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
    :target: https://github.com/OCA/sale-workflow/tree/18.0/sale_product_catalog_extended
    :alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_product_catalog_extended
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the standard Odoo product catalog available from
sale orders with the following additions:

Multi-line product cards
------------------------

When a product has more than one order line in the current sale order,
the catalog renders one card per line instead of a single aggregated
card. Each card shows the individual quantity and unit price for that
specific line, allowing independent editing without opening the order
form.

Per-line actions
----------------

Each in-order card exposes three inline actions:

- **New line** – adds a new order line for the same product.
- **Edit** – opens the specific order line form directly from the
  catalog.
- **Remove** – removes that individual line from the order.

Last sale price
---------------

A *Price* filter panel is added to the catalog search panel with a
**Last sale** option. When active, products not yet in the order show
the unit price from the most recent confirmed delivery to the same
shipping address (last 6 months) instead of the pricelist price. When a
new line is added with this mode enabled, that last-sale price is
automatically applied as the unit price.

Origin filter
-------------

An *Origin* filter panel is added to the catalog search panel with a
**Last sales** option. When active, the catalog displays only products
that were previously sold to the same shipping address (last 6 months),
ordered by frequency and delivered quantity. This origin can be
preselected automatically through a system parameter (see
*Configuration*).

Exclude from last sales
-----------------------

The card dropdown menu adds an **Exclude from last sales** entry. It
stores the product and the catalog history partner in a dedicated model,
so that product is no longer offered by the *Last sales* origin for any
order of that partner. The *Last sale* price is not affected.

The exclusion is dropped as soon as an order containing that product is
confirmed for the same partner, so the product goes back to the *Last
sales* origin without any manual clean up. Adding the product to an
already confirmed order has the same effect.

Image zoom
----------

Clicking on a product image in the catalog opens a full-size zoom
dialog.

**Table of contents**

.. contents::
   :local:

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

Default catalog origin
----------------------

By default the catalog opens with no origin preselected. You can make it
open directly on a specific origin by setting a system parameter:

1. Go to *Settings > Technical > Parameters > System Parameters*.
2. Create a new parameter with:

   - **Key:** ``sale_product_catalog_extended.catalog_default_origin``
   - **Value:** the technical value of the origin to preselect. This
     module provides ``sale_order`` (the **Last sales** option). Other
     modules may add further origins; use the corresponding selection
     value here.

When this parameter is set, opening the catalog from a sale order will
preselect the matching option in the *Origin* search panel
automatically. For example, set the value to ``sale_order`` to always
open the catalog on the **Last sales** origin. Leaving the parameter
empty or removing it restores the default behaviour (no origin
preselected).

Default catalog price mode
--------------------------

By default the catalog opens with no price mode preselected. You can
make it open directly on a specific price mode by setting a system
parameter:

1. Go to *Settings > Technical > Parameters > System Parameters*.
2. Create a new parameter with:

   - **Key:**
     ``sale_product_catalog_extended.catalog_default_price_mode``
   - **Value:** the technical value of the price mode to preselect. This
     module provides ``last_price`` (the **Last sale** option). Other
     modules may add further price modes; use the corresponding
     selection value here.

When this parameter is set, opening the catalog from a sale order will
preselect the matching option in the *Price* search panel automatically.
For example, set the value to ``last_price`` to always open the catalog
on the **Last sale** price mode. Leaving the parameter empty or removing
it restores the default behaviour (no price mode preselected).

Last sales origin limit
-----------------------

By default the **Last sales** origin shows every product sold to the
matched partner in the last 6 months. You can cap how many products it
shows by setting a system parameter:

1. Go to *Settings > Technical > Parameters > System Parameters*.
2. Create a new parameter with:

   - **Key:** ``sale_product_catalog_extended.catalog_last_order_limit``
   - **Value:** the maximum number of products to show, ordered by how
     often and how much they were sold. Leaving the parameter unset (or
     ``0``) restores the default behaviour (no limit).

Catalog history partner
-----------------------

The **Last sales** origin and the **Last sale** price look at the
customer sale history. By default that history is matched against the
order **commercial partner** (including its child contacts), so all the
orders of the same customer are taken into account regardless of the
delivery address.

You can match the history against the order **delivery address** instead
through *Default Values*, scoped per user and company (same mechanism as
the sale order product picker):

1. Go to *Settings > Technical > Default Values*.
2. Create a new default value for:

   - **Field:** ``sale.order`` → ``use_delivery_address``
   - **Value:** ``True`` to match by delivery address. Leaving no
     default (or ``False``) keeps the default behaviour (commercial
     partner).

This affects both the order of the cards under the **Last sales** origin
(products are sorted by how often and how much they were sold to the
matched partner) and the price shown by the **Last sale** price mode.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_product_catalog_extended%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

  - Carlos Dauden
  - Carlos Roca

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_product_catalog_extended>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
