Skip to content

Commit

Permalink
[MIG] purchase_analytic_tag: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreuOForgeFlow committed Nov 21, 2024
1 parent f3afb24 commit e5780a3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion purchase_analytic_tag/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Purchase Analytic Tag",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Purchase Management",
"website": "https://github.com/OCA/account-analytic",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
4 changes: 2 additions & 2 deletions purchase_analytic_tag/models/purchase_order_line.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2023 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import fields, models
from odoo import fields, models, Command


class PurchaseOrderLine(models.Model):
Expand All @@ -14,5 +14,5 @@ class PurchaseOrderLine(models.Model):
def _prepare_account_move_line(self, move=False):
vals = super()._prepare_account_move_line(move=move)
if self.analytic_tag_ids:
vals.update({"analytic_tag_ids": [(6, 0, self.analytic_tag_ids.ids)]})
vals.update({"analytic_tag_ids": [Command.set(self.analytic_tag_ids.ids)]})
return vals
1 change: 0 additions & 1 deletion purchase_analytic_tag/tests/test_purchase_analytic_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def setUpClass(cls):
cls.plan = cls.env["account.analytic.plan"].create(
{
"name": "Projects Plan",
"company_id": False,
}
)
cls.analytic_account_1 = cls.env["account.analytic.account"].create(
Expand Down
2 changes: 1 addition & 1 deletion purchase_analytic_tag/views/purchase_oder_view.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form</field>
<field name="name">purchase.order.form - purchase_analytic_tag</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
Expand Down

0 comments on commit e5780a3

Please sign in to comment.