Skip to content

Commit

Permalink
Merge PR #184 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 27, 2024
2 parents ac6ae72 + c2145f8 commit 7285fd7
Show file tree
Hide file tree
Showing 25 changed files with 1,543 additions and 0 deletions.
147 changes: 147 additions & 0 deletions loyalty_criteria_multi_product/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
==============================
Loyalty multi product criteria
==============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:46860ed2f141a7667574754bec19e5634ac9b6be9a2f058c45bd359dad0a10b2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-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--promotion-lightgray.png?logo=github
:target: https://github.com/OCA/sale-promotion/tree/16.0/loyalty_criteria_multi_product
:alt: OCA/sale-promotion
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-promotion-16-0/sale-promotion-16-0-loyalty_criteria_multi_product
: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-promotion&target_branch=16.0
:alt: Try me on Runboat

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

Base module that allows to define complex rules on products to fulfill the conditions
of a loyalty program, so for a given set of products we could define a minimum quantity
and another for others, being all those criterias mandatory for the program to be
applied.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

The functionality of the "Repeat" option that was included in this module is now included
in the rules of an odoo promotion. In this functionality a criterion was established in
which any of the products defined in the list of the criterion itself had to be in the
sales order lines in the minimum quantity established for the promotion to be applied.
This functionality can now be applied in the following way:
- Defining or editing a promotion.
- Modifying the rules to indicate a minimum quantity and selecting the products,
either by domain, specific products, product category or tag.
This way the promotion will be applicable when any of those products are in the order l
ines and the total of all or one of them meets the minimum quantity, as it was done when
the "Repeat" option was checked.

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

To configure multiple product criterias:

#. Go to *Sales > Catalog > Loyalty Programs* and select or create a new one.
#. Go to rules. On the *Loyalty Criteria* field choose *Multi Product*.
#. The standard domain will be hidden and a criteria list will be shown.
#. Add as many criterias as needed for the desired promotion behavior.

In the list of criterias we can configure:

- Qty: The minimum quantity of products in the sale order to fulfill the condition.
- Products: The products that should be present to fulfill the condition.

Some examples:

===== ================ ========
Qty Products Repeat
===== ================ ========
1 Prod A
===== ================ ========

A unit of Product A must be in the sale order.

===== ================ ========
Qty Products Repeat
===== ================ ========
2 Prod B, Prod C
===== ================ ========

A unit of Product B and Product C must be in the sale order.

Also note that all the defined criterias must be fulfilled or the program won't be
applied.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-promotion/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-promotion/issues/new?body=module:%20loyalty_criteria_multi_product%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
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_:

* Pedro M. Baeza
* David Vidal
* Stefan Ungureanu
* Pilar Vargas

* `Domatix <https://www.domatix.com>`_:

* Álvaro López Oró

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.

.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px
:target: https://github.com/chienandalu
:alt: chienandalu

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-chienandalu|

This module is part of the `OCA/sale-promotion <https://github.com/OCA/sale-promotion/tree/16.0/loyalty_criteria_multi_product>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions loyalty_criteria_multi_product/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions loyalty_criteria_multi_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Loyalty multi product criteria",
"summary": "Allows to set as promotion criteria multi-product conditions",
"version": "16.0.1.0.0",
"development_status": "Production/Stable",
"category": "Sale",
"website": "https://github.com/OCA/sale-promotion",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["chienandalu"],
"license": "AGPL-3",
"depends": ["loyalty"],
"data": ["security/ir.model.access.csv", "views/loyalty_rule_views.xml"],
}
129 changes: 129 additions & 0 deletions loyalty_criteria_multi_product/i18n/coupon_criteria_multi_product.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * coupon_criteria_multi_product
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,help:coupon_criteria_multi_product.field_coupon_program__coupon_criteria
msgid ""
"- Domain: Standard behavior. The products are evaluated by domain.\n"
"- Multi product: different rules can be applied to different products and all of the have to be fulfilled"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,help:coupon_criteria_multi_product.field_coupon_criteria__repeat_product
msgid "Can product quantities count multiple times or not"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model,name:coupon_criteria_multi_product.model_coupon_criteria
msgid "Coupon Multi Product Criteria"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_program__coupon_criteria
msgid "Coupon criteria"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model,name:coupon_criteria_multi_product.model_coupon_program
msgid "Coupon display on a website"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__create_uid
msgid "Created by"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__create_date
msgid "Created on"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__display_name
msgid "Display Name"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields.selection,name:coupon_criteria_multi_product.selection__coupon_program__coupon_criteria__domain
msgid "Domain"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__id
msgid "ID"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria____last_update
msgid "Last Modified on"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__write_uid
msgid "Last Updated by"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__write_date
msgid "Last Updated on"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__rule_min_quantity
msgid "Min. Quantity"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,help:coupon_criteria_multi_product.field_coupon_criteria__rule_min_quantity
msgid "Minimum required product quantity to get the reward"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields.selection,name:coupon_criteria_multi_product.selection__coupon_program__coupon_criteria__multi_product
msgid "Multi Product"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_program__coupon_criteria_ids
msgid "Multi Product Criterias"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__product_ids
msgid "Product"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__program_id
msgid "Program"
msgstr ""

#. module: coupon_criteria_multi_product
#: model_terms:ir.ui.view,arch_db:coupon_criteria_multi_product.coupon_program_view_form_common
msgid "Qty"
msgstr ""

#. module: coupon_criteria_multi_product
#: model:ir.model.fields,field_description:coupon_criteria_multi_product.field_coupon_criteria__repeat_product
msgid "Repeat"
msgstr ""

#. module: coupon_criteria_multi_product
#: code:addons/coupon_criteria_multi_product/models/coupon_criteria.py:0
#, python-format
msgid ""
"The minimum quantity can't be different from the number of products. Set the"
" rule as repeatable to avoid this constraint."
msgstr ""
Loading

0 comments on commit 7285fd7

Please sign in to comment.