Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][MIG] sale promotion rule #1583

Merged
merged 47 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
115979d
sale_promotion_rule: module to manage promotion rules
bguillot Jul 31, 2018
d90ecc3
sale_promotion_rule: add button to clean promotion rule
bguillot Aug 20, 2018
466f46f
sale_promotion_rule: Improve implementation
lmignon Sep 3, 2018
1164b3a
[IMP] sale_promotion_rule: Improve README
lmignon Nov 5, 2018
850452e
[IMP] sale_promotion_rule: Remove demo data Avoid demo data with intr…
lmignon Oct 27, 2018
f0494cb
[IMP] sale_promotion_rule: s/restriction_amount/restriction_amount_field
lmignon Dec 4, 2018
bd19c1a
[IMP] sale_promotion_rule: Overrides name_get in place of defining a …
lmignon Dec 4, 2018
f4cec6d
[IMP] sale_promotion_rule: Improve performance
lmignon Dec 4, 2018
843d7bc
[FIX] sale_promotion_rule: We must also include Coupon into the multi…
lmignon Dec 12, 2018
18315f9
[ADD] icon.png
OCA-git-bot Apr 3, 2019
056f420
[IMP] sale_promotion_rule: Add hook to exclude lines from the sale or…
lmignon Jan 4, 2019
80b33bc
[IMP] sale_promotion_rule: Improve promotion rule form
lmignon Jan 8, 2019
f626012
[FIX] minimum amount must be evaluate without any discount applied
Jun 17, 2019
6c54801
[IMP] sale_promotion_rule: Supports discount amount
lmignon Dec 3, 2018
9395962
[IMP] sale_promotion_rule: Use discount product for discount defined …
lmignon Dec 14, 2018
2538c2e
[IMP] sale_promotion_rule: Improve tests coverage
lmignon Feb 4, 2019
d9f21cb
[FIX] sale_promotion_rule: Fix search for rules already used for one …
lmignon Feb 5, 2019
ffed7d7
[FIX] prevent to aply an automatic rule on a sale promotion line
Mar 20, 2019
28d1df6
!fixup
rousseldenis Nov 7, 2019
1dc6dfc
sale_promotion_rule 10.0.2.0.1
OCA-git-bot Nov 8, 2019
ea86dcc
Update translation files
oca-transbot Nov 8, 2019
e0b4fae
Update translation files
oca-transbot Nov 8, 2019
43d85f5
[10.0][FIX] Fix sale_promotion_rule in case of multi rules
acsonefho Jun 14, 2019
f8ba941
sale_promotion_rule 10.0.2.0.2
OCA-git-bot Nov 22, 2019
6f9f57b
Update translation files
oca-transbot Nov 22, 2019
4b93b0d
Update translation files
oca-transbot Nov 22, 2019
a22396c
Added translation using Weblate (Catalan)
georginaf Dec 3, 2019
e0a8614
[10.0][FIX] sale_promotion_rule: Apply coupon to lines if percentage
rousseldenis Dec 6, 2019
3e8a838
sale_promotion_rule 10.0.2.1.0
OCA-git-bot May 19, 2020
89c1413
[10.0][FIX] sale_promotion_rule: Enable sequence order
rousseldenis May 19, 2020
9ec62be
sale_promotion_rule 10.0.2.1.1
OCA-git-bot Jun 18, 2020
bc89856
[IMP] sale_promotion_rule: black, isort, prettier
qgroulard Feb 24, 2021
08d56f2
[MIG] 12.0 sale_promotion_rule
Apr 14, 2020
7899132
[IMP] sale_promotion_rule: black, isort, prettier
qgroulard Feb 24, 2021
d4f9692
[MIG] sale_promotion_rule: Migration to 13.0
qgroulard Feb 24, 2021
a777717
[FIX] Clear promotion keep manual discount
qgroulard Feb 24, 2021
83b2e85
[IMP] sale_promotion_rule : black, isort, prettier
xavier-bouquiaux May 10, 2021
32df8f9
[WIP][14.0][MIG] sale_promotion_rule
xavier-bouquiaux May 11, 2021
3437208
[IMP] Add sale demo data
qgroulard May 11, 2021
e810bbf
[WIP][14.0][MIG] sale_promotion_rule
xavier-bouquiaux May 12, 2021
c02b40e
[14.0][IMP] sale_promotion_rule: Add test for multi currency case
rousseldenis May 17, 2021
980ca72
[14.0][IMP] sale_promotion_rule: Improve coverage testing wizard
rousseldenis May 18, 2021
0b34b56
[14.0][IMP] sale_promotion_rule: Improve coverage testing has_promoti…
rousseldenis May 18, 2021
826ba2e
[14.0][i18n] sale_promotion_rule: Regenerate pot and merge to avoid d…
rousseldenis May 18, 2021
9390ffd
[10.0][ADD] Add company_id + related rules
acsonefho May 27, 2019
93d60f4
[IMP] sale_promotion_rule : translate field
xavier-bouquiaux Jun 14, 2023
7949471
[IMP] pre-commit update
xavier-bouquiaux Jun 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions sale_promotion_rule/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
===================
Sale Promotion Rule
===================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/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--workflow-lightgray.png?logo=github
:target: https:/OCA/sale-workflow/tree/10.0/sale_promotion_rule
: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-10-0/sale-workflow-10-0-sale_promotion_rule
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/167/10.0
:alt: Try me on Runbot

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

This module adds the concept of promotion rules that can be applied on the sale
order.

Two kinds of rules are implemented:
* automatic
* coupon

Automatic rules are applied/recomputed automatically for a sale order when the
user clicks on the button "Apply discount" in the view form. Depending on the
rule's criteria more than one automatic rule can be applied to a same sale
order.

Coupon are special manual rules. Only one coupon can be applied to a
sale order. This rule takes always precedence over automatic rules.


.. image:: https://raw.githubusercontent.com/OCA/sale-workflow/10.0/sale_promotion_rule/sale_promotion_rule/static/description/promotion_rule.png
:alt: Promotion rules screenshot

**Table of contents**

.. contents::
:local:

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

* Add "automatic" rule that are automatically applied without coupon (only coupon have been implmented)
* Add gift support. (Only discount offer have been implemented)
* Improve condition by using custom filter on partner


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

Bugs are tracked on `GitHub Issues <https:/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 smashing it by providing a detailed and welcomed
`feedback <https:/OCA/sale-workflow/issues/new?body=module:%20sale_promotion_rule%0Aversion:%2010.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
~~~~~~~

* Akretion
* ACSONE SA/NV

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

* BEAU Sébastien <[email protected]>
* Benoît GUILLOT <[email protected]>
* Laurent Mignon <[email protected]>

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:/OCA/sale-workflow/tree/10.0/sale_promotion_rule>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_promotion_rule/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
24 changes: 24 additions & 0 deletions sale_promotion_rule/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2017 Akretion (http://www.akretion.com)
# Benoît GUILLOT <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sale Promotion Rule",
"summary": "Module to manage promotion rule on sale order",
"version": "14.0.1.0.0",
"development_status": "Beta",
"category": "Sale",
"website": "https:/OCA/sale-workflow",
"author": "Akretion, ACSONE SA/NV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["sale"],
"data": [
"wizards/sale_order_add_coupon.xml",
"views/sale_order.xml",
"views/sale_promotion_rule.xml",
"security/ir.model.access.csv",
"security/sale_promotion_rule.xml",
],
"demo": ["demo/product.xml", "demo/sale_demo.xml"],
}
7 changes: 7 additions & 0 deletions sale_promotion_rule/demo/product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="coupon" model="product.product">
<field name="name">Coupon</field>
<field name="type">service</field>
</record>
</odoo>
Comment on lines +1 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed with current coupon logic?

38 changes: 38 additions & 0 deletions sale_promotion_rule/demo/sale_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="sale_order_promotion" model="sale.order">
<field name="partner_id" ref="base.res_partner_4" />
<field name="partner_invoice_id" ref="base.res_partner_4" />
<field name="partner_shipping_id" ref="base.res_partner_4" />
<field name="user_id" ref="base.user_admin" />
<field name="pricelist_id" ref="product.list0" />
<field name="team_id" ref="sales_team.team_sales_department" />
<field name="campaign_id" ref="utm.utm_campaign_email_campaign_products" />
<field name="medium_id" ref="utm.utm_medium_email" />
<field name="source_id" ref="sale.utm_source_sale_order_0" />
</record>
<record id="sale_order_promotion_line_1" model="sale.order.line">
<field name="order_id" ref="sale_order_promotion" />
<field
name="name"
model="sale.order.line"
eval="obj().env.ref('product.product_product_1').get_product_multiline_description_sale()"
/>
<field name="product_id" ref="product.product_product_1" />
<field name="product_uom_qty">10</field>
<field name="product_uom" ref="uom.product_uom_hour" />
<field name="price_unit">30.75</field>
</record>
<record id="sale_order_promotion_line_2" model="sale.order.line">
<field name="order_id" ref="sale_order_promotion" />
<field
name="name"
model="sale.order.line"
eval="obj().env.ref('product.product_delivery_01').get_product_multiline_description_sale()"
/>
<field name="product_id" ref="product.product_delivery_01" />
<field name="product_uom_qty">1</field>
<field name="product_uom" ref="uom.product_uom_unit" />
<field name="price_unit">70.00</field>
</record>
</odoo>
Loading