Youssef Bashandy 5ad1a6db51 [FIX] sale : always lock confirmed order when auto-lock activated
Steps to reproduce:
	1- Install Sales module
	2- Activate Lock Confirmed Sales from Sales settings
	3- Create a new order as a Public user and make the payment
	4- Check the state of this order in backend

Current behavior before PR:
Upon creating and confirming an order as a public user the order does not get locked even if the 'Lock Confirmed Sales' setting is turned on. This is happening because when checking if the 'Lock Confirmed Sales' group is on or not we check if it is there for the current user which if he is a public user by default will not have this group.

Desired behavior after PR is merged:
Before we had this condition checking if self.env.user has the 'Lock Confirmed Sales' but this won't work if the SO is coming from eCommerce with public user env So now we are checking the creator of the SO that in the eCommerce scenario will be OdooBot and if the SO is created from the backend it will be one of the users who already has the group.

opw-3595964

closes odoo/odoo#148363

X-original-commit: 4cfd125837858f70d63d14f41265b9b9f47a933b
Signed-off-by: Youssef Bashandy (yoba) <yoba@odoo.com>
2024-01-05 21:51:30 +00:00
2023-11-02 21:02:44 +00:00
2024-01-05 15:14:38 +00:00
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%