forked from OCA/sale-promotion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
18 changed files
with
750 additions
and
0 deletions.
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,102 @@ | ||
======================================= | ||
Auto Refresh Coupons with Delivery line | ||
======================================= | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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--promotion-lightgray.png?logo=github | ||
:target: https://github.com/OCA/sale-promotion/tree/14.0/sale_coupon_delivery_auto_refresh | ||
: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-14-0/sale-promotion-14-0-sale_coupon_delivery_auto_refresh | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/296/14.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Sale Coupon Delivery Auto Refresh | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Bridge module between sale_coupon_auto_refresh and delivery_auto_refresh | ||
|
||
- *delivery_auto_refresh allows* "free shipping" coupon to be added automatically when delivery expenses are added to SO; | ||
- this module preserves this behavior when delivery expenses are added automatically to SO by delivery_auto_refresh. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
* No configuration is required | ||
|
||
Usage | ||
===== | ||
|
||
Please check description of the following modules: | ||
|
||
- delivery_auto_refresh | ||
- sale_coupon_auto_refresh | ||
|
||
Changelog | ||
========= | ||
|
||
14.0.1.0.0 | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* Initial release | ||
|
||
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 smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/sale-promotion/issues/new?body=module:%20sale_coupon_delivery_auto_refresh%0Aversion:%2014.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 | ||
~~~~~~~ | ||
|
||
* Ooops404 | ||
* Cetmix | ||
* | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Ooops404 <https://www.ooops404.com/> | ||
* Cetmix <https://cetmix.com/> | ||
|
||
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-promotion <https://github.com/OCA/sale-promotion/tree/14.0/sale_coupon_delivery_auto_refresh>`_ 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 @@ | ||
from . import models |
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,14 @@ | ||
{ | ||
"name": "Auto Refresh Coupons with Delivery line", | ||
"version": "15.0.1.0.0", | ||
"summary": "Allows to auto-apply the coupons after adding delivery line", | ||
"author": "Ooops404, Cetmix, , Odoo Community Association (OCA)", | ||
"contributors": "Ooops404, Cetmix", | ||
"license": "AGPL-3", | ||
"category": "Sale", | ||
"website": "https://github.com/OCA/sale-promotion", | ||
"depends": ["sale_coupon_auto_refresh", "delivery_auto_refresh"], | ||
"installable": True, | ||
"auto_install": True, | ||
"application": False, | ||
} |
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,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_coupon_delivery_auto_refresh | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2022-05-19 16:05+0000\n" | ||
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.3.2\n" | ||
|
||
#. module: sale_coupon_delivery_auto_refresh | ||
#: model:ir.model.fields,field_description:sale_coupon_delivery_auto_refresh.field_sale_order__display_name | ||
msgid "Display Name" | ||
msgstr "Nome Visualizzato" | ||
|
||
#. module: sale_coupon_delivery_auto_refresh | ||
#: model:ir.model.fields,field_description:sale_coupon_delivery_auto_refresh.field_sale_order__id | ||
msgid "ID" | ||
msgstr "ID" | ||
|
||
#. module: sale_coupon_delivery_auto_refresh | ||
#: model:ir.model.fields,field_description:sale_coupon_delivery_auto_refresh.field_sale_order____last_update | ||
msgid "Last Modified on" | ||
msgstr "Ultima modifica il" | ||
|
||
#. module: sale_coupon_delivery_auto_refresh | ||
#: model:ir.model,name:sale_coupon_delivery_auto_refresh.model_sale_order | ||
msgid "Sales Order" | ||
msgstr "Ordine di vendita" |
34 changes: 34 additions & 0 deletions
34
sale_coupon_delivery_auto_refresh/i18n/sale_coupon_delivery_auto_refresh.pot
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,34 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_coupon_delivery_auto_refresh | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.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: sale_coupon_delivery_auto_refresh | ||
#: model:ir.model.fields,field_description:sale_coupon_delivery_auto_refresh.field_sale_order__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: sale_coupon_delivery_auto_refresh | ||
#: model:ir.model.fields,field_description:sale_coupon_delivery_auto_refresh.field_sale_order__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: sale_coupon_delivery_auto_refresh | ||
#: model:ir.model.fields,field_description:sale_coupon_delivery_auto_refresh.field_sale_order____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: sale_coupon_delivery_auto_refresh | ||
#: model:ir.model,name:sale_coupon_delivery_auto_refresh.model_sale_order | ||
msgid "Sales Order" | ||
msgstr "" |
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 @@ | ||
from . import sale_order |
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,26 @@ | ||
from odoo import models | ||
|
||
|
||
class SaleOrder(models.Model): | ||
_inherit = "sale.order" | ||
|
||
def _auto_refresh_delivery(self): | ||
""" | ||
Override to change context value to refresh coupons after creation | ||
delivery line | ||
""" | ||
self = self.with_context( | ||
skip_auto_refresh_coupons=False, auto_refresh_delivery=True | ||
) | ||
return super(SaleOrder, self)._auto_refresh_delivery() | ||
|
||
def _create_delivery_line(self, carrier, price_unit): | ||
""" | ||
Override to refresh coupons after creation delivery line | ||
""" | ||
if self._check_skip_refresh(): | ||
return super()._create_delivery_line(carrier, price_unit) | ||
self_ctx = self.with_context(skip_auto_refresh_coupons=True) | ||
sol = super(SaleOrder, self_ctx)._create_delivery_line(carrier, price_unit) | ||
self._auto_refresh_coupons() | ||
return sol |
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 @@ | ||
* No configuration is required |
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,5 @@ | ||
* Ooops404 <https://www.ooops404.com/> | ||
* Cetmix <https://cetmix.com/> | ||
* `Tecnativa <https://www.tecnativa.com>`_ | ||
|
||
* Pilar Vargas |
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,6 @@ | ||
Sale Coupon Delivery Auto Refresh | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Bridge module between sale_coupon_auto_refresh and delivery_auto_refresh | ||
|
||
- *delivery_auto_refresh allows* "free shipping" coupon to be added automatically when delivery expenses are added to SO; | ||
- this module preserves this behavior when delivery expenses are added automatically to SO by delivery_auto_refresh. |
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,4 @@ | ||
14.0.1.0.0 | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* Initial release |
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,4 @@ | ||
Please check description of the following modules: | ||
|
||
- delivery_auto_refresh | ||
- sale_coupon_auto_refresh |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.