Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4834 Widoki

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?


Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć

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 Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lut 24
39298
1
sty 24
14151
2
mar 18
4998
0
sty 18
3114
2
lut 24
25522