From 3805376f2cddfdd8d7ee91ca3213bb0f7246d876 Mon Sep 17 00:00:00 2001 From: "German Loredo [Vauxoo]" Date: Wed, 3 Apr 2024 08:58:32 -0600 Subject: [PATCH] [MIG] default_warehouse_from_sale_team: Migration to 17.0 - Adapt the use of name_get as part of [1]. - Change qty_done to quantity and picked = True as part of [2]. [1] odoo/odoo#122085 [2] odoo/odoo#137864 --- default_warehouse_from_sale_team/__manifest__.py | 2 +- .../models/account_journal.py | 12 +++--------- .../tests/test_default_warehouse.py | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/default_warehouse_from_sale_team/__manifest__.py b/default_warehouse_from_sale_team/__manifest__.py index f0310dce5ce..9de869d041a 100644 --- a/default_warehouse_from_sale_team/__manifest__.py +++ b/default_warehouse_from_sale_team/__manifest__.py @@ -8,7 +8,7 @@ "website": "http://www.vauxoo.com", "license": "LGPL-3", "category": "Inventory/Inventory", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "depends": [ "sale_stock", "purchase_requisition", diff --git a/default_warehouse_from_sale_team/models/account_journal.py b/default_warehouse_from_sale_team/models/account_journal.py index 4d82cd81c7d..24955cfea80 100644 --- a/default_warehouse_from_sale_team/models/account_journal.py +++ b/default_warehouse_from_sale_team/models/account_journal.py @@ -5,12 +5,6 @@ class AccountJournal(models.Model): _inherit = "account.journal" section_id = fields.Many2one("crm.team", string="Sales Team") - - def name_get(self): - """Avoid access errors when computing journal's display name - - Avoid access errors when user has access to a journal item but not to its journal, e.g. when - reconciling bank statements. - """ - self = self.sudo() - return super().name_get() + # Avoid access errors when user has access to a journal item but + # not to its journal, e.g. when reconciling bank statements. + display_name = fields.Char(compute="_compute_display_name", compute_sudo=True) diff --git a/default_warehouse_from_sale_team/tests/test_default_warehouse.py b/default_warehouse_from_sale_team/tests/test_default_warehouse.py index 5e565deb245..eb3df4cd5a9 100644 --- a/default_warehouse_from_sale_team/tests/test_default_warehouse.py +++ b/default_warehouse_from_sale_team/tests/test_default_warehouse.py @@ -121,5 +121,5 @@ def test_04_warehouse_team_sale_policy(self): sale.sudo().action_confirm() pick = sale.picking_ids pick.action_assign() - pick.move_ids.write({"quantity_done": 1}) + pick.move_ids.write({"quantity": 1, "picked": True}) pick.button_validate()