From 1dcaee5de7c57f486a86482368ea339dd8655f71 Mon Sep 17 00:00:00 2001 From: RLeeOSI <51208020+RLeeOSI@users.noreply.github.com> Date: Wed, 29 May 2024 15:08:39 -0700 Subject: [PATCH] [FIX] partner_identification_dea: remove error on picking --- partner_identification_dea/models/__init__.py | 1 - .../models/stock_picking.py | 22 ------------------- 2 files changed, 23 deletions(-) delete mode 100644 partner_identification_dea/models/stock_picking.py diff --git a/partner_identification_dea/models/__init__.py b/partner_identification_dea/models/__init__.py index 42b52354bb8..6302c5c1b92 100644 --- a/partner_identification_dea/models/__init__.py +++ b/partner_identification_dea/models/__init__.py @@ -4,4 +4,3 @@ from . import res_partner from . import sale_order from . import res_partner_id_number -from . import stock_picking diff --git a/partner_identification_dea/models/stock_picking.py b/partner_identification_dea/models/stock_picking.py deleted file mode 100644 index 6a4866d8d0b..00000000000 --- a/partner_identification_dea/models/stock_picking.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2021 Open Source Integrators -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import _, fields, models -from odoo.exceptions import ValidationError - - -class StockPicking(models.Model): - _inherit = "stock.picking" - - def _action_done(self): - # Do not allow DO to be completed, if not a valid DEA license. - for picking in self.filtered( - lambda p: p.picking_type_code == "outgoing" and p.partner_id - ): - running_licenses = picking.partner_id.id_numbers.filtered( - lambda l: l.status == "open" - and l.valid_until - and l.valid_until >= fields.Date.today() - ) - if not running_licenses: - raise ValidationError(_("Customer does not have a valid DEA license.")) - return super(StockPicking, self)._action_done()