Hello,
New sale order '{self.name}' + created with Discount by '{self.env.user.name}' need your approval + on it.
To Approve, Cancel Order, Click on the Following + Link: Click Me
Thank You.
""" + mail_values = { + 'subject': f"{self.name} Discount Approval Request", + 'body_html': mail_body, + 'email_to': user.partner_id.email, + 'email_from': self.env.user.partner_id.email, + 'model': 'sale.order', + } + mail_id = self.env['mail.mail'].sudo().create(mail_values) + mail_id.send() + self.state = 'waiting_for_approval' + return res + + def action_waiting_approval(self): + """Method for approving the sale order discount""" + self.approval_user_id = self.env.user.id + self.state = 'sale' diff --git a/sale_order_discount_approval_odoo/security/sale_order_discount_approval_odoo_groups.xml b/sale_order_discount_approval_odoo/security/sale_order_discount_approval_odoo_groups.xml new file mode 100644 index 000000000..b9f48c106 --- /dev/null +++ b/sale_order_discount_approval_odoo/security/sale_order_discount_approval_odoo_groups.xml @@ -0,0 +1,14 @@ + ++ Sale Order Discount Approval In Odoo17. +
++
++ +
++
++ Discount Approval Manager allows user to give + discount in sales order +
++ In Settings,We have to set the user to be + Discount Approval Manager. +
++ We can provide the discount control to the + user and provide the allowed discount. +
++ Enable the Discount in sale settings to + provide discount to sale order line. +
++ User creates sale order with discount. +
++ If user creates sale order by adding + discount more than allowed limit and confirm + the order, Sale order will move to approval + state and approval e-mail goes to the users + with Discount Approval Manager group. +
++ Approval request to the user in group Discount Approval Manager. +
++ Discount Approval Manager can approve or cancel the order. +
++ Approved Manager will link with corresponding approved order. +
++ Community & Enterprise Support.
++ Set the Approval Manager in settings.
++ This module allows Discount On sale order line.
++ Discount Approval Manager allows user to give discount in sales order.
++ When a user applies a + discount that exceeds + their allowed limit, + the sales order is + flagged for approval. + The order cannot proceed + until it is reviewed and + approved by a user with + the necessary authorization. +
++ Approvers receive notifications + via email or within the Odoo system. + These notifications include details + of the sales order and the discount + applied, allowing approvers to + make informed decisions. +
+