[FIX] pos_self_order: remove unused color that triggers access error
Current behavior: If you create a user that only have access to a branch of a company. If this user try to access the QR Menu of any PoS he will get an access error. Steps to reproduce: - Create a branch B for company A - Change access of user U to only have access to branch B - Login with user U, and try to open any PoS QR Menu - You get an access error opw-3745256 closes odoo/odoo#162222 Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
This commit is contained in:
@@ -11,7 +11,7 @@ from werkzeug.urls import url_quote
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.tools import image_to_base64
|
||||
|
||||
from odoo import api, fields, models, _, service, Command
|
||||
from odoo import api, fields, models, _, service
|
||||
from odoo.tools import file_open, split_every
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ class PosConfig(models.Model):
|
||||
"pos_config_id": self.id,
|
||||
"pos_session": self.current_session_id.read(["id", "access_token"])[0] if self.current_session_id and self.current_session_id.state == 'opened' else False,
|
||||
"company": {
|
||||
**self.company_id.read(["name", "color", "email", "website", "vat", "name", "phone", "point_of_sale_use_ticket_qr_code", "point_of_sale_ticket_unique_code"])[0],
|
||||
**self.company_id.read(["name", "email", "website", "vat", "name", "phone", "point_of_sale_use_ticket_qr_code", "point_of_sale_ticket_unique_code"])[0],
|
||||
"partner_id": [None, self.company_id.partner_id.contact_address],
|
||||
"country": self.company_id.country_id.read(["vat_label"])[0],
|
||||
},
|
||||
|
||||
@@ -6,7 +6,6 @@ import { formatMonetary } from "@web/views/fields/formatters";
|
||||
import { Product } from "@pos_self_order/app/models/product";
|
||||
import { Combo } from "@pos_self_order/app/models/combo";
|
||||
import { session } from "@web/session";
|
||||
import { getColor } from "@web/core/colors/colors";
|
||||
import { categorySorter, attributeFormatter, attributeFlatter } from "@pos_self_order/app/utils";
|
||||
import { Order } from "@pos_self_order/app/models/order";
|
||||
import { batched } from "@web/core/utils/timing";
|
||||
@@ -55,7 +54,6 @@ export class SelfOrder extends Reactive {
|
||||
this.comboByIds = {};
|
||||
this.ordering = false;
|
||||
this.orders = [];
|
||||
this.color = getColor(this.company.color);
|
||||
this.kitchenPrinters = [];
|
||||
|
||||
this.initData();
|
||||
|
||||
Reference in New Issue
Block a user