Skip to Content
Menu
This question has been flagged
1 Reply
5152 Views

how can i add attribute to button (type object) from inherited form

<button string="Approve" name="action_approve" states="confirm" type="object" groups="hr_holidays.group_hr_holidays_user" class="oe_highlight"/>

Avatar
Discard
Best Answer

Let us suppose you want to add groups attribute to your button, you will inherit the form and use xpath as below:

<xpath expr="//button[@name='action_approve']" position="attributes>

<attribute name="groups">hr_holidays.group_hr_holidays_user</attribute>
</xpath>

Avatar
Discard
Author

it produces an error

Field `can_reset` does not exist

It seems you are using a field in domain not exists in the view

Please submit your XML to check it.

Author

i inherited 'hr_holidays.edit_holiday_new' Form .. and found this error:

Field `can_reset` does not exist

but i have no field 'can_reset' ...

this is the original button

<button string="Approve" name="action_approve" states="confirm" type="object" groups="hr_holidays.group_hr_holidays_user" class="oe_highlight"/>

how can i fix it ?

Author

it works now

i did fatal error in model name

thanks so much Waleed