diff --git a/product_approval_management/__manifest__.py b/product_approval_management/__manifest__.py index f68e5b40b..8f5a6e339 100644 --- a/product_approval_management/__manifest__.py +++ b/product_approval_management/__manifest__.py @@ -40,7 +40,7 @@ 'views/product_approval_views.xml' ], 'images': ['static/description/banner.png'], - 'version': '14.0.1.1.0', + 'version': '14.0.2.2.0', 'license': 'LGPL-3', 'installable': True, 'auto_install': False, diff --git a/product_approval_management/models/models.py b/product_approval_management/models/models.py index a03d150a9..78c293961 100644 --- a/product_approval_management/models/models.py +++ b/product_approval_management/models/models.py @@ -39,6 +39,11 @@ class ApproveProduct(models.Model): for rec in self: rec.approve_state = 'draft' + def confirm_products(self): + active_ids = self.env.context.get('active_ids') + products = self.env['product.template'].browse(active_ids) + products.confirm_product_approval() + class SaleOrderLine(models.Model): _inherit = 'sale.order.line' diff --git a/product_approval_management/views/product_approval_views.xml b/product_approval_management/views/product_approval_views.xml index d6ca2ffb4..c14e35b11 100644 --- a/product_approval_management/views/product_approval_views.xml +++ b/product_approval_management/views/product_approval_views.xml @@ -49,5 +49,14 @@ + + Confirm + + code + model.confirm_products() + + + +