Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
1401 Переглядів

Hi!

I have a problem. I've added button in my kanban view in hr_applicant addon.
My XML file looks like this:

?xml version="1.0" encoding="UTF-8"?

templates xml:space="preserve"

    t t-name="my_addon.KanbanViewExtension" t-inherit="web.KanbanView" t-inherit-mode="extension"

        xpath expr="//t[@t-if='canCreate and props.showButtons']" position="after"

            button type="button"

                    t-if="model.root.resModel == 'hr.applicant'"

                    class="btn btn-primary"

                    id="my_addon_vacancy_parser_button"

                    Update Vacancy

            /button

        /xpath

    /t

/templates


But I don't know how to connect my method from model hr.applicant for this button.

I will accept any help, maybe you just indicate where to find something similar or in which direction to move.

Thank you for all your answers. 

Аватар
Відмінити
Найкраща відповідь

Take a look at this simple example of project module

To add button or link or something do like this : https://github.com/odoo/odoo/blob/17.0/addons/project/models/project_project.py#L692

Аватар
Відмінити
Автор

Thank you for your answer.

As I correctly understood, it is a simple case of adding action for button. But in my case I try to add button in header of kanban view and logic here is a more difficult, to my mind. I needed to create a template is static/src/xml root and it's not easy to just add parameter name inside button tag. But I can mistaken. Can I use this way with buttons in headers?

Thank you:)

Найкраща відповідь

Hi Olena

Please Let me know what is the purpose of the button considering that only we can decide you need to create a server action or method 
both way it is easy to solve this issue

Regards

 

Аватар
Відмінити
Автор

Hi Azhar.

This button should scrape specific data from job site and then save it in my Odoo system as new applicants. But in this case the main problem is connect button action to method in my model. I will be very appreciated if you can help me with it.

Thanks:)

Related Posts Відповіді Переглядів Дія
1
серп. 25
1720
2
серп. 25
282
2
бер. 25
1311
1
лют. 25
1611
1
груд. 24
2128