[FIX] hr: show Create employee button based on company employee

Before this commit, the `Create Employee` button was not visible if user is linked to employee in any other company as the domain was based on `employee_count`. (Which represents Employee belongs to all companies)

With this commit, we check for `employee_id` which makes sure if the user has linked Employee for currently activated company.

Followup on 95564bcd2c

X-original-commit: cb9ac24caea53615e2808a36e850939a1ccaa041
This commit is contained in:
Swapnesh Shah
2020-05-18 11:58:10 +00:00
parent 32cd51f2af
commit fab315489c
+2 -1
View File
@@ -205,9 +205,10 @@
<xpath expr="//header" position="inside">
<field name="share" invisible="1"/>
<field name="employee_ids" invisible="1"/>
<field name="employee_id" invisible="1"/>
<button string="Create employee"
type="object" name="action_create_employee"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('share', '=', True), ('employee_count', '>', 0)]}"/>
attrs="{'invisible': ['|', '|', ('id', '=', False), ('share', '=', True), ('employee_id', '!=', False)]}"/>
<!-- share is not correctly recomputed because it depends on fields of reified view => invisible before saving (id=False) -->
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">