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

[15.0][MIG] sale_coupon_delivery_auto_refresh: Migration to version 15.0 #121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
102 changes: 102 additions & 0 deletions sale_coupon_delivery_auto_refresh/README.rst
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.
1 change: 1 addition & 0 deletions sale_coupon_delivery_auto_refresh/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions sale_coupon_delivery_auto_refresh/__manifest__.py
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,
}
37 changes: 37 additions & 0 deletions sale_coupon_delivery_auto_refresh/i18n/it.po
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"
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 ""
1 change: 1 addition & 0 deletions sale_coupon_delivery_auto_refresh/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
26 changes: 26 additions & 0 deletions sale_coupon_delivery_auto_refresh/models/sale_order.py
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
1 change: 1 addition & 0 deletions sale_coupon_delivery_auto_refresh/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* No configuration is required
5 changes: 5 additions & 0 deletions sale_coupon_delivery_auto_refresh/readme/CONTRIBUTORS.rst
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
6 changes: 6 additions & 0 deletions sale_coupon_delivery_auto_refresh/readme/DESCRIPTION.rst
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.
4 changes: 4 additions & 0 deletions sale_coupon_delivery_auto_refresh/readme/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
14.0.1.0.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Initial release
4 changes: 4 additions & 0 deletions sale_coupon_delivery_auto_refresh/readme/USAGE.rst
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.
Loading