From 890dcf7299908d09dfab96829ab313213e954a40 Mon Sep 17 00:00:00 2001 From: duongtq Date: Wed, 25 Oct 2023 11:43:38 +0700 Subject: [PATCH] [IMP] sale_order_import: Provide confirming order feature on Sale Order Import --- sale_order_import/wizard/sale_order_import.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sale_order_import/wizard/sale_order_import.py b/sale_order_import/wizard/sale_order_import.py index 583f2b360b2..12ab03d660d 100644 --- a/sale_order_import/wizard/sale_order_import.py +++ b/sale_order_import/wizard/sale_order_import.py @@ -56,6 +56,8 @@ class SaleOrderImport(models.TransientModel): "res.partner", string="Shipping Address", readonly=True ) sale_id = fields.Many2one("sale.order", string="Quotation to Update") + # Confirm order after creating Sale Order + confirm_order = fields.Boolean(default=False) @api.onchange("order_file") def order_file_change(self): @@ -320,6 +322,9 @@ def create_order(self, parsed_order, price_source, order_filename=None): order = soo.create(so_vals) bdio.post_create_or_update(parsed_order, order, doc_filename=order_filename) logger.info("Sale Order ID %d created", order.id) + if self.confirm_order: + order.action_confirm() + logger.info("Sale Order ID %d confirmed", order.id) return order @api.model