diff --git a/addons/account/models/__init__.py b/addons/account/models/__init__.py index 80c0ce03e17..a809415fe8b 100644 --- a/addons/account/models/__init__.py +++ b/addons/account/models/__init__.py @@ -2,6 +2,7 @@ from . import sequence_mixin from . import partner +from . import ir_http from . import res_partner_bank from . import account_account_tag from . import account_account diff --git a/addons/account/models/ir_http.py b/addons/account/models/ir_http.py new file mode 100644 index 00000000000..6157cdfe74b --- /dev/null +++ b/addons/account/models/ir_http.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +from odoo import models + + +class IrHttp(models.AbstractModel): + _inherit = 'ir.http' + + def session_info(self): + result = super(IrHttp, self).session_info() + result['is_quick_edit_mode_enabled'] = self.env.user._is_internal() and self.env.company.quick_edit_mode + return result diff --git a/addons/account/static/src/components/systray_item/systray_item.js b/addons/account/static/src/components/systray_item/systray_item.js new file mode 100644 index 00000000000..9fa25a9009e --- /dev/null +++ b/addons/account/static/src/components/systray_item/systray_item.js @@ -0,0 +1,26 @@ +/** @odoo-module **/ + +import { registry } from "@web/core/registry"; +import { useService } from "@web/core/utils/hooks"; +import { Component } from "@odoo/owl"; +import { session } from '@web/session'; + +export class AccountSystrayItem extends Component { + static template = "account.SystrayItem"; + static props = {}; + + setup() { + this.currentCompany = useService("company").currentCompany; + this.isQuickEditModeEnabled = session.is_quick_edit_mode_enabled; + } +} + +export const systrayItem = { + Component: AccountSystrayItem, + isDisplayed : function(env) { + const { availableCompanies } = env.services.company; + return Object.keys(availableCompanies).length === 1; + }, +}; + +registry.category("systray").add("AccountSystrayItem", systrayItem, { sequence: 1 }); diff --git a/addons/account/static/src/components/systray_item/systray_item.xml b/addons/account/static/src/components/systray_item/systray_item.xml new file mode 100644 index 00000000000..f2cc401285c --- /dev/null +++ b/addons/account/static/src/components/systray_item/systray_item.xml @@ -0,0 +1,8 @@ + + + +
+ +
+
+