redesign switch company-menu

develop
Andreas Osim 2024-03-18 10:19:51 +01:00
parent 102b275839
commit 1bb9d1a82a
3 changed files with 4 additions and 3 deletions

View File

@ -35,7 +35,8 @@ class Http(models.AbstractModel):
"username": user.login,
"company_id": request.env.user.company_id.id if request.session.uid else None,
"partner_id": request.env.user.partner_id.id if request.session.uid and request.env.user.partner_id else None,
"user_companies": {'current_company': (user.company_id.id, user.company_id.name), 'allowed_companies': [(comp.id, comp.name) for comp in user.company_ids]} if display_switch_company_menu else False,
# "user_companies": {'current_company': (user.company_id.id, user.company_id.name), 'allowed_companies': [(comp.id, comp.name, comp.partner_description or '') for comp in user.company_ids]} if display_switch_company_menu else False,
"user_companies": {'current_company': (user.company_id.id, user.company_id.name), 'allowed_companies': [(comp.id, comp.portal_prefix or '----', comp.partner_description or comp.name) for comp in user.company_ids]} if display_switch_company_menu else False,
"currencies": self.get_currencies(),
"web.base.url": self.env['ir.config_parameter'].sudo().get_param('web.base.url', default=''),
}

View File

@ -47,7 +47,7 @@ var SwitchCompanyMenu = Widget.extend({
} else {
a = '<span class="mr24"/>';
}
companies_list += '<li><a href="#" data-menu="company" data-company-id="' + company[0] + '">' + a + company[1] + '</a></li>';
companies_list += '<li><a href="#" style="font-family: \'Courier New\'; text-decoration: none" data-menu="company" data-company-id="' + company[0] + '">' + a + company[1] + ' ' + company[2] + '</a></li>';
});
self.$('.dropdown-menu').html(companies_list);
return this._super();

View File

@ -158,7 +158,7 @@ class Partner(models.Model):
help='The internal user that is in charge of communicating with this contact if any.')
vat = fields.Char(string='TIN', help="Tax Identification Number. "
"Fill it if the company is subjected to taxes. "
"Used by the some of the legal statements.")
"Used by the some of the legal statements.",copy=False)
bank_ids = fields.One2many('res.partner.bank', 'partner_id', string='Banks')
website = fields.Char(help="Website of Partner or Company")
comment = fields.Text(string='Notes')