Metadata-Version: 2.1
Name: odoo-addon-shopinvader_anonymous_partner
Version: 16.0.2.0.0
Summary: Manage anonymous partners with a cookie.
Home-page: https://github.com/shopinvader/odoo-shopinvader
Author: ACSONE SA/NV
License: LGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Requires-Python: >=3.10
Requires-Dist: odoo-addon-queue-job<16.1dev,>=16.0dev
Requires-Dist: odoo<16.1dev,>=16.0a

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

=============================
Shopinvader Anonymous Partner
=============================

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

.. |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-LGPL--3-blue.png
    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
    :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github
    :target: https://github.com/shopinvader/odoo-shopinvader/tree/16.0/shopinvader_anonymous_partner
    :alt: shopinvader/odoo-shopinvader

|badge1| |badge2| |badge3|

This module allows the creation of temporary partners for anonymous visitors, and set
a cookie to establish a session for these partners.

**Table of contents**

.. contents::
   :local:

Usage
=====

The following model methods are added in a helper model:

``_create_anonymous_partner__cookie(response)``

  Create a new anonymous partner and set the ``shopinvader-anonymous-partner`` cookie.
  Return the newly created partner record.

  ``response`` is typically the http response, it must have a ``set_cookie()`` method.
  It is known to work with ``odoo.http.request.future_response`` and FastAPI
  ``Response`` objects.

``_get_anonymous_partner__cookie(cookies)``

  Return the partner record corresponding to the ``shopinvader-anonymous-partner``
  cookie in the current request, if any. Returns an empty record set if the cookie is
  not set or if the corresponding partner was not found.

  ``cookies`` is the cookies dictionary from the http request.

Note the record sets returned by these methods are in a sudo'ed environment, so handle
with care.

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

- some cron to remove old anonymous partners

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

Bugs are tracked on `GitHub Issues <https://github.com/shopinvader/odoo-shopinvader/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/shopinvader/odoo-shopinvader/issues/new?body=module:%20shopinvader_anonymous_partner%0Aversion:%2016.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
~~~~~~~

* ACSONE SA/NV

Maintainers
~~~~~~~~~~~

This module is part of the `shopinvader/odoo-shopinvader <https://github.com/shopinvader/odoo-shopinvader/tree/16.0/shopinvader_anonymous_partner>`_ project on GitHub.

You are welcome to contribute.
