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': "'%s' Discount Approval Request" % (self.name), + 'body_html': mail_body, + 'email_to': user.partner_id.email, + 'model': 'sale.order', + } + template_id = self.env.ref( + 'sale_order_discount_approval_odoo.confirmation_mail_send' + ).id + template = self.env['mail.template'].browse(template_id) + template.sudo().send_mail(self.id, email_values=mail_values, + force_send=True) + 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..aa952a901 --- /dev/null +++ b/sale_order_discount_approval_odoo/security/sale_order_discount_approval_odoo_groups.xml @@ -0,0 +1,13 @@ + ++ Sale Order Discount Approval In Odoo15.
++ In this module, there is a discount manager feature available in + the Settings. + Users have the ability to establish a discount limit for each + salesperson. + If a salesperson exceeds their designated discount limit, an + email notification is automatically sent to the discount + manager. + The manager can then choose to either approve or reject the + discount request.
++ We can set a User as Discount Approval Manager +
++ We can set discount limit for the salesperson. +
++ If the salesperson gives discount within the limit , Salesperson can directly confirm the order. +
++ If salesperson gives the discount exceeding the limit, salesperson needs to get Approval from Discount Approval Manager . +
++ A Mail notification is sent to Discount Approval Manager +
++ Discount Approval Manager can either accept or cancel the request +
++ Easily procure + and + sell your products
++ Easy + configuration + and convivial experience
++ A platform for + educational management
++ Plan, track and + schedule your operations
++ Mobile + friendly, + awe-inspiring product pages
++ Keep track of + services and invoice
++ Run your bar or + restaurant methodically
++ An + all-inclusive + hotel management application
+