[FIX] base: res_users form message partner active correct condition

Before this commit, the condition and the field on which it applied were wrong
That is, when both the user and the partner were inactive, the message saying that
the partner was still active displayed anyway

After this commit, we show the message only when the user is inactive but its
directly related partner is still active

OPW 1928247

closes odoo/odoo#30337
This commit is contained in:
Lucas Perais (lpe)
2019-01-18 10:07:26 +00:00
parent 5607620623
commit 897834f406
3 changed files with 15 additions and 1 deletions
+5
View File
@@ -16344,6 +16344,11 @@ msgstr ""
msgid "Partner Titles"
msgstr ""
#. module: base
#: model:ir.model.fields,field_description:base.field_res_users__active_partner
msgid "Partner is Active"
msgstr ""
#. module: base
#: model:ir.module.module,summary:base.module_website_partner
msgid "Partner module for website"
+1
View File
@@ -224,6 +224,7 @@ class Users(models.Model):
"a change of password, the user has to login again.")
signature = fields.Html()
active = fields.Boolean(default=True)
active_partner = fields.Boolean(related='partner_id.active', readonly=True, string="Partner is Active")
action_id = fields.Many2one('ir.actions.actions', string='Home Action',
help="If specified, this action will be opened at log on for this user, in addition to the standard menu.")
groups_id = fields.Many2many('res.groups', 'res_groups_users_rel', 'uid', 'gid', string='Groups', default=_default_groups)
+9 -1
View File
@@ -167,7 +167,15 @@
<field name="active" widget="boolean_button" options='{"terminology": "active"}'/>
</button>
</div>
<div class="alert alert-info text-center o_form_header" attrs="{'invisible': [('active', '=', True)]}" role="alert">
<field name="active_partner" required="0" readonly="1" invisible="1"/>
<div class="alert alert-info text-center o_form_header"
attrs="{'invisible': [
'|', '|',
'&amp;', ('active', '=', True), ('active_partner', '=', True),
'&amp;', ('active', '=', False), ('active_partner', '=', False),
'&amp;', ('active', '=', True), ('active_partner', '=', False),
]}"
role="alert">
<a class="close" data-dismiss="alert" href="#">x</a>
<div>
<strong>The contact linked to this user is still active</strong>