콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
3240 화면

The controller I wrote works on a common new web page ( website.test-add-fields), but when I adapt the code to use it in a page from an odoo model (website_hr_recruitment.apply_audition_result_form), it doesn't give any result (nor error...).


Here is my Python code:


class TestAddDropdownGood(http.Controller):

  @http.route('/audition-selection-result-form-94', auth='public', type='http', website='True')
def handler(self):

current_user = http\.request\.env\.context\.get\('uid'\)

\ \ \ \ \ \ \ \ students\ =\ request\.env\['x_students'\]\.sudo\(\)\.search\(\[\('id','!=',False\)\]\)

\ \ \ \ \ \ \ \ values\ =\ \{
\ \ \ \ \ \ \ \ \ \ \ \ 'students':\ students
\ \ \ \ \ \ \ \ \}
\ \ \ \ \ \ \ \ return\ request\.render\('website_hr_recruitment\.apply_audition_result_form',\ values\)


Here\ is\ my\ xml:

\ \ \ \ \ \ \ \ \ \ \ \

\ \ \ \ \ \ \ \ \ \ \ \

Can someone tell me the problem?


Thank you so much for your help!!

아바타
취소
베스트 답변

You are altering existing class, you need to inherit that class first. like here https://www.odoo.com/documentation/16.0/developer/reference/backend/http.html

아바타
취소
작성자 베스트 답변

Thank you Jacob, bit I am not sufficiently experienced to write the needed code...

Could you tell me more concretely what I have to add in my main.py file?

thank you for your help!

아바타
취소

did you manage to solve it?

작성자

Someone else did it for me! Thank you for your help.

관련 게시물 답글 화면 활동
3
7월 20
12921
0
4월 20
4272
3
6월 17
14947
0
3월 15
4487
1
5월 25
3201