Skip to content

Commit

Permalink
[MIG] sale_coupon_order_line_link: Renamed to sale_loyalty_order_line…
Browse files Browse the repository at this point in the history
…_link + Migration to version 16.0

TT44349
  • Loading branch information
pilarvargas-tecnativa committed Sep 25, 2023
1 parent 5653957 commit 824bd8e
Show file tree
Hide file tree
Showing 17 changed files with 268 additions and 261 deletions.
26 changes: 12 additions & 14 deletions sale_loyalty_order_line_link/README.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
===========================
Link coupons to order lines
===========================
====================================
Link loyalty programs to order lines
====================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:48825c029f35b6de6644b4af46bb75003501eeea6212c0ff81dcb59db4429d02
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
Expand All @@ -17,16 +14,16 @@ Link coupons to order lines
: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/15.0/sale_coupon_order_line_link
:target: https://github.com/OCA/sale-promotion/tree/16.0/sale_loyalty_order_line_link
: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-15-0/sale-promotion-15-0-sale_coupon_order_line_link
:target: https://translation.odoo-community.org/projects/sale-promotion-16-0/sale-promotion-16-0-sale_loyalty_order_line_link
: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=15.0
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/sale-promotion&target_branch=16.0
:alt: Try me on Runboat

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

This module adds a link in the sale order line to the program used in a discount, so
it can be easily tracked afterwards. Also eases the implementation of coupon modules
Expand Down Expand Up @@ -56,8 +53,8 @@ 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:%20sale_coupon_order_line_link%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
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_loyalty_order_line_link%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.

Expand All @@ -75,6 +72,7 @@ Contributors
* `Tecnativa <https://www.tecnativa.com>`_:

* David Vidal
* Pilar Vargas

* `Ooops404 <https://www.ooops404.com>`_:

Expand All @@ -101,6 +99,6 @@ 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/15.0/sale_coupon_order_line_link>`_ project on GitHub.
This module is part of the `OCA/sale-promotion <https://github.com/OCA/sale-promotion/tree/16.0/sale_loyalty_order_line_link>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
10 changes: 5 additions & 5 deletions sale_loyalty_order_line_link/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Link coupons to order lines",
"summary": "Adds a link between coupons and their generated order lines for easing "
"tracking",
"version": "15.0.1.0.0",
"name": "Link loyalty programs to order lines",
"summary": "Adds a link between loyalty programs and their generated order lines"
"for easing tracking",
"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": ["sale_coupon"],
"depends": ["sale_loyalty"],
"data": ["reports/sale_report_views.xml", "views/sale_order_views.xml"],
}
78 changes: 39 additions & 39 deletions sale_loyalty_order_line_link/i18n/it.po
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_coupon_order_line_link
# * sale_loyalty_order_line_link
#
msgid ""
msgstr ""
Expand All @@ -16,90 +16,90 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__coupon_program_id
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_report__coupon_program_id
#: model_terms:ir.ui.view,arch_db:sale_coupon_order_line_link.view_order_product_search
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__coupon_program_id
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_report__coupon_program_id
#: model_terms:ir.ui.view,arch_db:sale_loyalty_order_line_link.view_order_product_search
msgid "Coupon Program"
msgstr "Programma buoni sconto"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order__display_name
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__display_name
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_report__display_name
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order__display_name
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__display_name
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_report__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order__id
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__id
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_report__id
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order__id
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__id
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_report__id
msgid "ID"
msgstr "ID"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order____last_update
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line____last_update
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_report____last_update
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order____last_update
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line____last_update
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_report____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,help:sale_coupon_order_line_link.field_sale_order_line__reward_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,help:sale_loyalty_order_line_link.field_sale_order_line__reward_line_ids
msgid "Link on the reward lines applied from this one"
msgstr "Collegamento alle righe ricompensa applicate da questa"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,help:sale_coupon_order_line_link.field_sale_order_line__reward_generated_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,help:sale_loyalty_order_line_link.field_sale_order_line__reward_generated_line_ids
msgid "Link on the reward lines generated meeting this line as criteria"
msgstr ""
"Collegamento alle righe ricompensa create che rispondono ai criteri di "
"questa riga"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,help:sale_coupon_order_line_link.field_sale_order_line__reward_origin_generated_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,help:sale_loyalty_order_line_link.field_sale_order_line__reward_origin_generated_line_ids
msgid ""
"Origin Link on the reward lines generated meeting this line as criteria"
msgstr ""
"Collegamento originario alle righe ricompensa create che rispondono ai "
"criteri di questa riga"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__reward_origin_generated_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__reward_origin_generated_line_ids
msgid "Origin Reward Generated lines"
msgstr "Righe originarie ricompensa create"

#. module: sale_coupon_order_line_link
#: model_terms:ir.ui.view,arch_db:sale_coupon_order_line_link.view_order_product_search
#. module: sale_loyalty_order_line_link
#: model_terms:ir.ui.view,arch_db:sale_loyalty_order_line_link.view_order_product_search
msgid "Promotion Lines"
msgstr "Righe promozione"

#. module: sale_coupon_order_line_link
#: model_terms:ir.ui.view,arch_db:sale_coupon_order_line_link.view_order_form
#. module: sale_loyalty_order_line_link
#: model_terms:ir.ui.view,arch_db:sale_loyalty_order_line_link.view_order_form
msgid "Promotions"
msgstr "Promozioni"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__reward_generated_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__reward_generated_line_ids
msgid "Reward Generated lines"
msgstr "Righe ricompense create"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__reward_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__reward_line_ids
msgid "Reward lines"
msgstr "Righe ricompense"

#. module: sale_coupon_order_line_link
#: model:ir.model,name:sale_coupon_order_line_link.model_sale_report
#. module: sale_loyalty_order_line_link
#: model:ir.model,name:sale_loyalty_order_line_link.model_sale_report
msgid "Sales Analysis Report"
msgstr "Resoconto analisi vendite"

#. module: sale_coupon_order_line_link
#: model:ir.model,name:sale_coupon_order_line_link.model_sale_order
#. module: sale_loyalty_order_line_link
#: model:ir.model,name:sale_loyalty_order_line_link.model_sale_order
msgid "Sales Order"
msgstr "Ordine di vendita"

#. module: sale_coupon_order_line_link
#: model:ir.model,name:sale_coupon_order_line_link.model_sale_order_line
#. module: sale_loyalty_order_line_link
#: model:ir.model,name:sale_loyalty_order_line_link.model_sale_order_line
msgid "Sales Order Line"
msgstr "Riga ordine di vendita"
54 changes: 27 additions & 27 deletions sale_loyalty_order_line_link/i18n/sale_coupon_order_line_link.pot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_coupon_order_line_link
# * sale_loyalty_order_line_link
#
msgid ""
msgstr ""
Expand All @@ -13,65 +13,65 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__coupon_program_id
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_report__coupon_program_id
#: model_terms:ir.ui.view,arch_db:sale_coupon_order_line_link.view_order_product_search
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__coupon_program_id
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_report__coupon_program_id
#: model_terms:ir.ui.view,arch_db:sale_loyalty_order_line_link.view_order_product_search
msgid "Coupon Program"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,help:sale_coupon_order_line_link.field_sale_order_line__reward_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,help:sale_loyalty_order_line_link.field_sale_order_line__reward_line_ids
msgid "Link on the reward lines applied from this one"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,help:sale_coupon_order_line_link.field_sale_order_line__reward_generated_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,help:sale_loyalty_order_line_link.field_sale_order_line__reward_generated_line_ids
msgid "Link on the reward lines generated meeting this line as criteria"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,help:sale_coupon_order_line_link.field_sale_order_line__reward_origin_generated_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,help:sale_loyalty_order_line_link.field_sale_order_line__reward_origin_generated_line_ids
msgid ""
"Origin Link on the reward lines generated meeting this line as criteria"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__reward_origin_generated_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__reward_origin_generated_line_ids
msgid "Origin Reward Generated lines"
msgstr ""

#. module: sale_coupon_order_line_link
#: model_terms:ir.ui.view,arch_db:sale_coupon_order_line_link.view_order_product_search
#. module: sale_loyalty_order_line_link
#: model_terms:ir.ui.view,arch_db:sale_loyalty_order_line_link.view_order_product_search
msgid "Promotion Lines"
msgstr ""

#. module: sale_coupon_order_line_link
#: model_terms:ir.ui.view,arch_db:sale_coupon_order_line_link.view_order_form
#. module: sale_loyalty_order_line_link
#: model_terms:ir.ui.view,arch_db:sale_loyalty_order_line_link.view_order_form
msgid "Promotions"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__reward_generated_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__reward_generated_line_ids
msgid "Reward Generated lines"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model.fields,field_description:sale_coupon_order_line_link.field_sale_order_line__reward_line_ids
#. module: sale_loyalty_order_line_link
#: model:ir.model.fields,field_description:sale_loyalty_order_line_link.field_sale_order_line__reward_line_ids
msgid "Reward lines"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model,name:sale_coupon_order_line_link.model_sale_report
#. module: sale_loyalty_order_line_link
#: model:ir.model,name:sale_loyalty_order_line_link.model_sale_report
msgid "Sales Analysis Report"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model,name:sale_coupon_order_line_link.model_sale_order
#. module: sale_loyalty_order_line_link
#: model:ir.model,name:sale_loyalty_order_line_link.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_coupon_order_line_link
#: model:ir.model,name:sale_coupon_order_line_link.model_sale_order_line
#. module: sale_loyalty_order_line_link
#: model:ir.model,name:sale_loyalty_order_line_link.model_sale_order_line
msgid "Sales Order Line"
msgstr ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2023 Tecnativa - Pilar Vargas
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade

_renamed_fields = [
(
"sale.order.line",
"sale_order_line",
"coupon_program_id",
"loyalty_program_id",
),
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_fields(env, _renamed_fields)
openupgrade.logged_query(
env.cr,
"""
ALTER TABLE sale_order_line
ADD COLUMN IF NOT EXISTS reward_id INTEGER;
""",
)
openupgrade.logged_query(
env.cr,
"""
UPDATE sale_order_line AS sol
SET sol.reward_id = lr.id
FROM loyalty_reward AS lr
WHERE sol.loyalty_program_id = lr.program_id
AND sol.loyalty_program_id IS NOT NULL;
""",
)
Loading

0 comments on commit 824bd8e

Please sign in to comment.