-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
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 d90ecc3
sale_promotion_rule: add button to clean promotion rule
bguillot 466f46f
sale_promotion_rule: Improve implementation
lmignon 1164b3a
[IMP] sale_promotion_rule: Improve README
lmignon 850452e
[IMP] sale_promotion_rule: Remove demo data Avoid demo data with intr…
lmignon f0494cb
[IMP] sale_promotion_rule: s/restriction_amount/restriction_amount_field
lmignon bd19c1a
[IMP] sale_promotion_rule: Overrides name_get in place of defining a …
lmignon f4cec6d
[IMP] sale_promotion_rule: Improve performance
lmignon 843d7bc
[FIX] sale_promotion_rule: We must also include Coupon into the multi…
lmignon 18315f9
[ADD] icon.png
OCA-git-bot 056f420
[IMP] sale_promotion_rule: Add hook to exclude lines from the sale or…
lmignon 80b33bc
[IMP] sale_promotion_rule: Improve promotion rule form
lmignon f626012
[FIX] minimum amount must be evaluate without any discount applied
6c54801
[IMP] sale_promotion_rule: Supports discount amount
lmignon 9395962
[IMP] sale_promotion_rule: Use discount product for discount defined …
lmignon 2538c2e
[IMP] sale_promotion_rule: Improve tests coverage
lmignon d9f21cb
[FIX] sale_promotion_rule: Fix search for rules already used for one …
lmignon ffed7d7
[FIX] prevent to aply an automatic rule on a sale promotion line
28d1df6
!fixup
rousseldenis 1dc6dfc
sale_promotion_rule 10.0.2.0.1
OCA-git-bot ea86dcc
Update translation files
oca-transbot e0b4fae
Update translation files
oca-transbot 43d85f5
[10.0][FIX] Fix sale_promotion_rule in case of multi rules
acsonefho f8ba941
sale_promotion_rule 10.0.2.0.2
OCA-git-bot 6f9f57b
Update translation files
oca-transbot 4b93b0d
Update translation files
oca-transbot a22396c
Added translation using Weblate (Catalan)
georginaf e0a8614
[10.0][FIX] sale_promotion_rule: Apply coupon to lines if percentage
rousseldenis 3e8a838
sale_promotion_rule 10.0.2.1.0
OCA-git-bot 89c1413
[10.0][FIX] sale_promotion_rule: Enable sequence order
rousseldenis 9ec62be
sale_promotion_rule 10.0.2.1.1
OCA-git-bot bc89856
[IMP] sale_promotion_rule: black, isort, prettier
qgroulard 08d56f2
[MIG] 12.0 sale_promotion_rule
7899132
[IMP] sale_promotion_rule: black, isort, prettier
qgroulard d4f9692
[MIG] sale_promotion_rule: Migration to 13.0
qgroulard a777717
[FIX] Clear promotion keep manual discount
qgroulard 83b2e85
[IMP] sale_promotion_rule : black, isort, prettier
xavier-bouquiaux 32df8f9
[WIP][14.0][MIG] sale_promotion_rule
xavier-bouquiaux 3437208
[IMP] Add sale demo data
qgroulard e810bbf
[WIP][14.0][MIG] sale_promotion_rule
xavier-bouquiaux c02b40e
[14.0][IMP] sale_promotion_rule: Add test for multi currency case
rousseldenis 980ca72
[14.0][IMP] sale_promotion_rule: Improve coverage testing wizard
rousseldenis 0b34b56
[14.0][IMP] sale_promotion_rule: Improve coverage testing has_promoti…
rousseldenis 826ba2e
[14.0][i18n] sale_promotion_rule: Regenerate pot and merge to avoid d…
rousseldenis 9390ffd
[10.0][ADD] Add company_id + related rules
acsonefho 93d60f4
[IMP] sale_promotion_rule : translate field
xavier-bouquiaux 7949471
[IMP] pre-commit update
xavier-bouquiaux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import models | ||
from . import wizards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?