mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[MIG] V13 properties menu
This commit is contained in:
@@ -24,13 +24,13 @@ class IrHttp(models.AbstractModel):
|
||||
})
|
||||
# TODO: This user context update should be placed in other function ¿?
|
||||
res['user_context'].update({'allowed_pms_property_ids': [(property.id) for property in user.pms_property_ids]})
|
||||
# update current_company based on current_pms_property
|
||||
if user.pms_property_id.company_id in user.company_ids:
|
||||
user.company_id = user.pms_property_id.company_id
|
||||
res['company_id'] = user.pms_property_id.company_id.id
|
||||
else:
|
||||
raise MissingError(
|
||||
_("Wrong property and company access settings for this user. "
|
||||
"Please review property and company for user %s") % user.name)
|
||||
# TODO: update current_company based on current_pms_property
|
||||
# if user.pms_property_id.company_id in user.company_ids:
|
||||
# user.company_id = user.pms_property_id.company_id
|
||||
# res['company_id'] = user.pms_property_id.company_id.id
|
||||
# else:
|
||||
# raise MissingError(
|
||||
# _("Wrong property and company access settings for this user. "
|
||||
# "Please review property and company for user %s") % user.name)
|
||||
|
||||
return res
|
||||
|
||||
@@ -18,10 +18,10 @@ odoo.define('web.SwitchPmsMenu', function(require) {
|
||||
var SwitchPmsMenu = Widget.extend({
|
||||
template: 'SwitchPmsMenu',
|
||||
events: {
|
||||
'click .dropdown-item[data-menu] div.log_into': '_onSwitchPmsPropertyClick',
|
||||
'keydown .dropdown-item[data-menu] div.log_into': '_onSwitchPmsPropertyClick',
|
||||
'click .dropdown-item[data-menu] div.toggle_pms_property': '_onTogglePmsPropertyClick',
|
||||
'keydown .dropdown-item[data-menu] div.toggle_pms_property': '_onTogglePmsPropertyClick',
|
||||
'click .dropdown-item[data-menu] div.pms_log_into': '_onSwitchPmsPropertyClick',
|
||||
'keydown .dropdown-item[data-menu] div.pms_log_into': '_onSwitchPmsPropertyClick',
|
||||
'click .dropdown-item[data-menu] div.pms_toggle_property': '_onTogglePmsPropertyClick',
|
||||
'keydown .dropdown-item[data-menu] div.pms_toggle_property': '_onTogglePmsPropertyClick',
|
||||
},
|
||||
/**
|
||||
* @override
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="dropdown-item d-flex py-0 px-0" data-menu="pms_property" t-att-data-pms_property-id="pms_property[0]">
|
||||
<t t-set="is_allowed" t-value="widget.allowed_pms_property_ids.includes(pms_property[0])"/>
|
||||
<t t-set="is_current" t-value="pms_property[0] === widget.current_pms_property"/>
|
||||
<div role="menuitemcheckbox" t-att-aria-checked="is_allowed" t-att-aria-label="pms_property[1]" tabindex="0" class="ml-auto pl-3 pr-3 border border-top-0 border-left-0 border-bottom-0 toggle_company o_py">
|
||||
<div role="menuitemcheckbox" t-att-aria-checked="is_allowed" t-att-aria-label="pms_property[1]" tabindex="0" class="ml-auto pl-3 pr-3 border border-top-0 border-left-0 border-bottom-0 pms_toggle_property o_py">
|
||||
<span style="height: 2rem;">
|
||||
<t t-if="is_allowed">
|
||||
<i class="fa fa-fw fa-check-square pt-2"></i>
|
||||
@@ -22,7 +22,7 @@
|
||||
</t>
|
||||
</span>
|
||||
</div>
|
||||
<div role="button" t-att-aria-pressed="is_current" aria-label="Switch to this property" tabindex="0" class="d-flex flex-grow-1 align-items-center py-0 log_into pl-3 o_py" t-att-style="is_current ? 'background-color: lightgrey;' : ''">
|
||||
<div role="button" t-att-aria-pressed="is_current" aria-label="Switch to this property" tabindex="0" class="d-flex flex-grow-1 align-items-center py-0 pms_log_into pl-3 o_py" t-att-style="is_current ? 'background-color: lightgrey;' : ''">
|
||||
<t t-if="is_allowed">
|
||||
<span class='mr-3 company_label'>
|
||||
<t t-esc="pms_property[1]"/>
|
||||
|
||||
Reference in New Issue
Block a user