Skip to content

Commit

Permalink
[MIG] sale_order_product_recommendation: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BT-mchechlacz committed Nov 25, 2024
1 parent 607886e commit f60698c
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 86 deletions.
46 changes: 23 additions & 23 deletions sale_order_product_recommendation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Sale Order Product Recommendation
: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://github.com/OCA/sale-workflow/tree/17.0/sale_order_product_recommendation
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_order_product_recommendation
: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-17-0/sale-workflow-17-0-sale_order_product_recommendation
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_order_product_recommendation
: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-workflow&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -69,8 +69,8 @@ by default follow the next steps

You can define other default values like as:

- Months backwards to generate recommendations.
- Number of recommendations to display.
- Months backwards to generate recommendations.
- Number of recommendations to display.

You can force the addition of all the products recommended in the sale
order. You can then edit the desired quantities directly in the sale
Expand Down Expand Up @@ -107,7 +107,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_product_recommendation%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_product_recommendation%0Aversion:%2018.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 @@ -122,29 +122,29 @@ Authors
Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:
- `Tecnativa <https://www.tecnativa.com>`__:

- Jairo Llopis
- David Vidal
- Alexandre Díaz
- Pedro M. Baeza
- Sergio Teruel
- Carlos Roca
- Víctor Martínez
- Jairo Llopis
- David Vidal
- Alexandre Díaz
- Pedro M. Baeza
- Sergio Teruel
- Carlos Roca
- Víctor Martínez

- `Camptocamp SA <https://www.camptocamp.com>`__:
- `Camptocamp SA <https://www.camptocamp.com>`__:

- Telmo Santos
- Telmo Santos

- `Moduon <https://www.moduon.team>`__:
- `Moduon <https://www.moduon.team>`__:

- Rafael Blasco
- Gelo Joga
- Jairo Llopis
- Rafael Blasco
- Gelo Joga
- Jairo Llopis

- `Trobz <https://www.trobz.com>`__:
- `Trobz <https://www.trobz.com>`__:

- Tris Doan
- Tris Doan

Maintainers
-----------
Expand Down Expand Up @@ -173,6 +173,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sergio-teruel| |maintainer-rafaelbn| |maintainer-yajo|

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/17.0/sale_order_product_recommendation>`_ project on GitHub.
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_order_product_recommendation>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions sale_order_product_recommendation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Sale Order Product Recommendation",
"summary": "Recommend products to sell to customer based on history",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Sales",
"website": "https://github.com/OCA/sale-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand All @@ -13,7 +13,7 @@
"installable": True,
"maintainers": ["sergio-teruel", "rafaelbn", "yajo"],
"depends": [
"sale",
"sale_management",
],
"data": [
"security/ir.model.access.csv",
Expand Down
19 changes: 2 additions & 17 deletions sale_order_product_recommendation/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ msgstr ""
"recomendados."

#. module: sale_order_product_recommendation
#: model:ir.model.fields,field_description:sale_order_product_recommendation.field_sale_order_recommendation_line__product_priority
#: model:ir.model.fields,field_description:sale_order_product_recommendation.field_sale_order_recommendation_line__product_is_favorite
msgid "Favorite"
msgstr "Favorito"

Expand Down Expand Up @@ -433,19 +433,4 @@ msgstr "Perderás todos los cambios que hayas hecho. ¿Está seguro?"
#. module: sale_order_product_recommendation
#: model_terms:ir.ui.view,arch_db:sale_order_product_recommendation.sale_order_recommendation_view_form
msgid "times -"
msgstr "veces -"

#~ msgid "Sales Order Line"
#~ msgstr "Línea de pedido de venta"

#~ msgid "Complete Name"
#~ msgstr "Nombre Completo"

#~ msgid "Product Category"
#~ msgstr "Categoría de Producto"

#~ msgid "Last Compute"
#~ msgstr "Último cálculo"

#~ msgid "Sale Uom"
#~ msgstr "Unidad de medida de venta"
msgstr "veces -"
14 changes: 1 addition & 13 deletions sale_order_product_recommendation/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ msgstr ""
"Dominio applicato per trovare righe OV da proporre come prodotti suggeriti."

#. module: sale_order_product_recommendation
#: model:ir.model.fields,field_description:sale_order_product_recommendation.field_sale_order_recommendation_line__product_priority
#: model:ir.model.fields,field_description:sale_order_product_recommendation.field_sale_order_recommendation_line__product_is_favorite
msgid "Favorite"
msgstr "Favorito"

Expand Down Expand Up @@ -430,15 +430,3 @@ msgstr "Verranno perse tutte le modifiche fatte. Sicuri di procedere?"
#: model_terms:ir.ui.view,arch_db:sale_order_product_recommendation.sale_order_recommendation_view_form
msgid "times -"
msgstr "numero -"

#~ msgid "Sales Order Line"
#~ msgstr "Riga ordine di vendita"

#~ msgid "Complete Name"
#~ msgstr "Nome completo"

#~ msgid "Product Category"
#~ msgstr "Categoria prodotto"

#~ msgid "Last Compute"
#~ msgstr "Ultimo calcolo"
11 changes: 1 addition & 10 deletions sale_order_product_recommendation/i18n/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ msgstr ""
"recomendados."

#. module: sale_order_product_recommendation
#: model:ir.model.fields,field_description:sale_order_product_recommendation.field_sale_order_recommendation_line__product_priority
#: model:ir.model.fields,field_description:sale_order_product_recommendation.field_sale_order_recommendation_line__product_is_favorite
msgid "Favorite"
msgstr "Favorito"

Expand Down Expand Up @@ -433,12 +433,3 @@ msgstr "Você perderá todas as alterações feitas. Tem certeza?"
#: model_terms:ir.ui.view,arch_db:sale_order_product_recommendation.sale_order_recommendation_view_form
msgid "times -"
msgstr "vezes -"

#~ msgid "Sales Order Line"
#~ msgstr "Item do pedido de vendas"

#~ msgid "Product Category"
#~ msgstr "Categoria de Produto"

#~ msgid "Last Compute"
#~ msgstr "Última Computação"
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ msgid "Domain applied to find SO lines to propose as recommended products."
msgstr ""

#. module: sale_order_product_recommendation
#: model:ir.model.fields,field_description:sale_order_product_recommendation.field_sale_order_recommendation_line__product_priority
#: model:ir.model.fields,field_description:sale_order_product_recommendation.field_sale_order_recommendation_line__product_is_favorite
msgid "Favorite"
msgstr ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Sale Order Product Recommendation</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:31f3f19baf679e3c4c2022eb21dce8110f453fc63b5a0beeaad609d41c911268
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-workflow/tree/17.0/sale_order_product_recommendation"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_order_product_recommendation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_order_product_recommendation"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_order_product_recommendation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds a recommended products wizard to current sale order.</p>
<p>It is based on recent delivered products, and allows the salesman to
quickly know the most sold products for current customer, which results
Expand Down Expand Up @@ -453,7 +453,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_product_recommendation%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_product_recommendation%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -504,7 +504,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/sergio-teruel"><img alt="sergio-teruel" src="https://github.com/sergio-teruel.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/rafaelbn"><img alt="rafaelbn" src="https://github.com/rafaelbn.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/yajo"><img alt="yajo" src="https://github.com/yajo.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/17.0/sale_order_product_recommendation">OCA/sale-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_order_product_recommendation">OCA/sale-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from freezegun import freeze_time

from odoo.exceptions import UserError
from odoo.tests.common import Form
from odoo.tests import Form

from .test_recommendation_common import RecommendationCase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ def setUpClass(cls):
cls.prod_1 = cls.product_obj.create(
{
"name": "Test Product 1",
"detailed_type": "service",
"type": "service",
"list_price": 25.00,
"categ_id": cls.cat_b.id,
}
)
cls.prod_2 = cls.product_obj.create(
{
"name": "Test Product 2",
"detailed_type": "service",
"type": "service",
"list_price": 50.00,
"categ_id": cls.cat_b.id,
}
)
cls.prod_3 = cls.product_obj.create(
{
"name": "Test Product 3",
"detailed_type": "service",
"type": "service",
"list_price": 75.00,
"categ_id": cls.cat_a.id,
"default_code": "TEST-PROD-3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="sale.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//setting[@id='order_default_values']/.." position="after">
<xpath expr="//setting[@id='quotation_validity_days']/.." position="after">
<block
title="Sale order recommendations"
id="sale_order_recommendation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def generate_recommendations(self):
self.line_ids = recommendation_lines.sorted(
key=lambda line: (
"" if line[order_field] is False else line[order_field],
int(line.product_id.priority) * priority_multiplier,
int(line.product_id.sequence) * priority_multiplier,
),
reverse=order_dir == "desc",
)
Expand Down Expand Up @@ -239,13 +239,13 @@ def action_accept(self):
class SaleOrderRecommendationLine(models.TransientModel):
_name = "sale.order.recommendation.line"
_description = "Recommended product for current sale order"
_order = "product_priority desc, id"
_order = "product_is_favorite desc, id"

currency_id = fields.Many2one(related="product_id.currency_id")
partner_id = fields.Many2one(related="wizard_id.order_id.partner_id")
product_id = fields.Many2one("product.product", string="Product")
product_name = fields.Char(
name="Product name", related="product_id.name", readonly=True, store=True
name="Product name", related="product_id.name", readonly=True
)
product_categ_complete_name = fields.Char(
string="Product category",
Expand All @@ -256,8 +256,8 @@ class SaleOrderRecommendationLine(models.TransientModel):
product_default_code = fields.Char(
related="product_id.default_code", readonly=True, store=True
)
product_priority = fields.Selection(
related="product_id.priority", store=True, readonly=False
product_is_favorite = fields.Boolean(
related="product_id.is_favorite", store=True, readonly=False
)
product_uom_readonly = fields.Boolean(related="sale_line_id.product_uom_readonly")
product_uom_category_id = fields.Many2one(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
<field
name="line_ids"
nolabel="1"
mode="tree,kanban"
mode="list,kanban"
colspan="2"
invisible="not line_ids"
>
<tree create="0" delete="0" editable="top">
<list create="0" delete="0" editable="top">
<field
name="product_priority"
widget="priority"
name="product_is_favorite"
widget="boolean_favorite"
optional="show"
nolabel="1"
/>
Expand Down Expand Up @@ -68,7 +68,7 @@
groups="uom.group_uom"
readonly="product_uom_readonly"
/>
</tree>
</list>
<kanban
class="o_kanban_mobile"
quick_create="0"
Expand All @@ -85,7 +85,7 @@
<field name="units_included" />
<field name="currency_id" />
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div class="oe_kanban_global_click">
<div class="o_kanban_image me-1">
<img
Expand All @@ -106,7 +106,7 @@
</div>
<field
class="w-auto mb-0"
name="product_priority"
name="product_is_favorite"
widget="priority"
/>
</div>
Expand Down

0 comments on commit f60698c

Please sign in to comment.