Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
4687 Vizualizări

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?


Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează

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

Autor

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

Autor Cel mai bun răspuns

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)]}"/>

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
feb. 24
39074
1
ian. 24
13971
2
mar. 18
4880
0
ian. 18
3008
2
feb. 24
25371