Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
4676 Weergaven

Hi Odoo users,

I want to add a button that skips the applicant to the last stage 'HIRED'. Adding this button would need to be something like

I copied this code to a certain extent from the CRM pipeline that has a similar button but I don't understand where the object, my "action_set_hired" should be added. In the CRM pipeline button it is named action_set_won_rainbowman but I cannot find this anywhere within Odoo.

I have many more wishes of buttons to add to different modules, but can't seem to get any to work. I am missing something. Could someone help me?


Avatar
Annuleer
Beste antwoord

Hi,

You can define a function as follows:

<button name="action_hired" string="Hired" type="object" class="oe_highlight"/>

def action_hired(self):
hired_stage = self.env['hr.recruitment.stage'].search([('name', '=', 'Hired')])
if hired_stage:
self.stage_id = hired_stage.id

Thanks

Avatar
Annuleer

i have searched using the name, which is not a recommended way, hope it give you some insights

Auteur

Hi Niyas,
Seems easier said than done. I am not an expert sorry, but where should I even add such code? I can't put this in the view hr.applicant as this is Python code if I am not mistaken. Or can't I do this in Odoo but do I have to do this in the server?

if you are customizing system from custom module, you can inherit the model in python file and add the above code, if you are doing from ui in debug mode, create a server action(from debug mode) that executes python code and paste this code and take the id of the created action and set the ID as name of the button in xml

Auteur Beste antwoord

The code used is

button name="action_set_archived_rainbowman" string="Mark Archived" type="object" class="oe_highlight" attrs="{'invisible': [('active', '=', False),('emp_id', '=', False)]}"/>

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
feb. 24
39064
1
jan. 24
13963
2
mrt. 18
4878
0
jan. 18
3006
2
feb. 24
25367