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 673880e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 59 deletions.
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 @@ -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,13 +25,13 @@
<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"
name="product_is_favorite"
widget="priority"
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 673880e

Please sign in to comment.