From e5780a3cbc641ba1f0d3f937378364b3c2ae858c Mon Sep 17 00:00:00 2001 From: Andreu Orensanz Date: Thu, 21 Nov 2024 16:24:23 +0100 Subject: [PATCH] [MIG] purchase_analytic_tag: Migration to 17.0 --- purchase_analytic_tag/__manifest__.py | 2 +- purchase_analytic_tag/models/purchase_order_line.py | 4 ++-- purchase_analytic_tag/tests/test_purchase_analytic_tag.py | 1 - purchase_analytic_tag/views/purchase_oder_view.xml | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/purchase_analytic_tag/__manifest__.py b/purchase_analytic_tag/__manifest__.py index 6d91a88144..95d9c4d1e8 100644 --- a/purchase_analytic_tag/__manifest__.py +++ b/purchase_analytic_tag/__manifest__.py @@ -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)", diff --git a/purchase_analytic_tag/models/purchase_order_line.py b/purchase_analytic_tag/models/purchase_order_line.py index 794836cc6c..c773b9cbe2 100644 --- a/purchase_analytic_tag/models/purchase_order_line.py +++ b/purchase_analytic_tag/models/purchase_order_line.py @@ -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): @@ -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 diff --git a/purchase_analytic_tag/tests/test_purchase_analytic_tag.py b/purchase_analytic_tag/tests/test_purchase_analytic_tag.py index 2397140337..37b8b0b6af 100644 --- a/purchase_analytic_tag/tests/test_purchase_analytic_tag.py +++ b/purchase_analytic_tag/tests/test_purchase_analytic_tag.py @@ -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( diff --git a/purchase_analytic_tag/views/purchase_oder_view.xml b/purchase_analytic_tag/views/purchase_oder_view.xml index a84924b200..00e7ed9cb3 100644 --- a/purchase_analytic_tag/views/purchase_oder_view.xml +++ b/purchase_analytic_tag/views/purchase_oder_view.xml @@ -1,7 +1,7 @@ - purchase.order.form + purchase.order.form - purchase_analytic_tag purchase.order