From 67417a5798130b153b3891f0a99f64d10b1f377e Mon Sep 17 00:00:00 2001 From: Alexis Lopez - Adhoc Date: Tue, 18 Jul 2023 15:33:48 +0000 Subject: [PATCH] [FIX] stock_ux: bypassed allow picking cancelation when write PO Part-of: ingadhoc/stock#385 --- stock_ux/__manifest__.py | 3 ++- stock_ux/models/__init__.py | 1 + stock_ux/models/purchase_order.py | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 stock_ux/models/purchase_order.py diff --git a/stock_ux/__manifest__.py b/stock_ux/__manifest__.py index aa9b2cdb..6fa676a9 100644 --- a/stock_ux/__manifest__.py +++ b/stock_ux/__manifest__.py @@ -19,7 +19,7 @@ ############################################################################## { 'name': 'Stock UX', - 'version': "16.0.2.2.0", + 'version': "16.0.2.3.0", 'category': 'Warehouse Management', 'sequence': 14, 'summary': '', @@ -32,6 +32,7 @@ 'sale_stock', 'report_aeroo', 'stock_voucher', + 'purchase_stock', ], 'data': [ 'security/stock_ux_security.xml', diff --git a/stock_ux/models/__init__.py b/stock_ux/models/__init__.py index 161d59f6..c03d9e8c 100644 --- a/stock_ux/models/__init__.py +++ b/stock_ux/models/__init__.py @@ -12,3 +12,4 @@ from . import stock_picking_type from . import sale_order from . import res_config_settings +from . import purchase_order diff --git a/stock_ux/models/purchase_order.py b/stock_ux/models/purchase_order.py new file mode 100644 index 00000000..938bf88d --- /dev/null +++ b/stock_ux/models/purchase_order.py @@ -0,0 +1,10 @@ +from odoo import _, api, fields, models + + +class PurchaseOrder(models.Model): + _inherit = 'purchase.order' + + def write(self, values): + self = self.with_context(cancel_from_order=True) + return super().write(values) +