Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

Accept and Sign Portal Function

Subscribe

Get notified when there's activity on this post

This question has been flagged
XMLPortalControllerOdoo17
1 Reply
2131 Views
Avatar
gladiator

Hello Community, I'm trying to add 'Accept and Sign' Portal Function at my maintenance request, but I'm still getting the Error Message as the following.

How can I correct it and help me to find the solution. 

Thanks a lot.



My XML Code -    

                           

                               

maintenance.id)" class="js_accept_json modal-content js_website_submit_form">

                                   

                                   

                                       

Validate Order

                                       

                                   

                                   

                                       

                                            By signing this proposal, I agree to the following terms:

                                           

                                                   

  •                                                     Accepted on the behalf of:
                                                                                                       
  •                                                

                                                   

                                               

                                       

                                       

                                           

                                            maintenance.id)"/>

                                           

                                       

                                   

                               

                           

                       

"""                        


"""   

                           

                               

maintenance.id)" class="js_accept_json modal-content js_website_submit_form">

                                   

                                   

                                       

Validate Order

                                       

                                   

                                   

                                       

                                            By signing this proposal, I agree to the following terms:

                                           

                                                   

  •                                                     Accepted on the behalf of:
                                                                                                       
  •                                                

                                                   

                                               

                                       

                                       

                                           

                                            maintenance.id)"/>

                                           

                                       

                                   

                               

                           

                    


                           

                       



My Controller Code -

@http.route(['/my/maintenance/'], type='http', methods=["POST","GET"], website=True)

    def get_maintenances_form(self, maintenance_id,**rec):

        vals = {

            "maintenance":maintenance_id,

            'page_name':'maintenance_request_form_view',

        }


        maintenance_records = request.env['maintenance.request'].search([])

        maintenance_ids = maintenance_records.ids

        maintenance_index = maintenance_ids.index(maintenance_id.id)


        if maintenance_index != 0 and maintenance_ids[maintenance_index - 1]:

            vals['prev_record'] = '/my/maintenance/{}'.format(maintenance_ids[maintenance_index - 1])

        if maintenance_index

            vals['next_record'] = '/my/maintenance/{}'.format(maintenance_ids[maintenance_index + 1])

        

        if request.httprequest.method == "POST":

            print(rec)

        else:

            print("GET METHOD....")


        data = request.render('snow_everest_development.se_maintenance_form_view_portal', vals)

        

        return data



My Error Message - 


2024-07-05 09:44:19,804 12745 WARNING SNOW_EVEREST_DEV odoo.http: No CSRF validation token provided for path '/my/maintenance/42'


Odoo URLs are CSRF-protected by default (when accessed with unsafe

HTTP methods). See

https://www.odoo.com/documentation/17.0/developer/reference/addons/http.html#csrf

for more details.


* if this endpoint is accessed through Odoo via py-QWeb form, embed a CSRF

  token in the form, Tokens are available via `request.csrf_token()`

  can be provided through a hidden input and must be POST-ed named

  `csrf_token` e.g. in your form add:

     


* if the form is generated or posted in javascript, the token value is

  available as `csrf_token` on `web.core` and as the `csrf_token`

  value in the default js-qweb execution context


* if the form is accessed by an external third party (e.g. REST API

  endpoint, payment gateway callback) you will need to disable CSRF

  protection (and implement your own protection if necessary) by

  passing the `csrf=False` parameter to the `route` decorator.


2024-07-05 09:44:20,025 12745 INFO SNOW_EVEREST_DEV werkzeug: 10.0.2.2 - - [05/Jul/2024 09:44:20] "POST /my/maintenance/42 HTTP/1.1" 400 - 23 0.016 0.247

2024-07-05 09:44:22,304 12745 INFO SNOW_EVEREST_DEV werkzeug: 10.0.2.2 - - [05/Jul/2024 09:44:22] "POST /web/webclient/version_info HTTP/1.1" 200 - 1 0.000 0.002

0
Avatar
Discard
gladiator
Author

Please Help

Avatar
Aneesh.AV
Best Answer
disable CSRF Protection in your code and try

@http.route(['/my/maintenance/'], type='http', methods=["POST","GET"], csrf=False, website=True)


0
Avatar
Discard
gladiator
Author

Thanks Mr. Aneesh.Av,
It's worked but the order of signature didn't return to my controller when I click the "Sign" button.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Inherit and Add Input Box at Helpdesk
Helpdesk Website Portal Odoo17
Avatar
Avatar
Avatar
2
जुल॰ 24
2259
How can I share my Projects with portal users | Odoo 17.4 Solved
projects Portal Quickstart SF-Experts Odoo17
Avatar
Avatar
Avatar
3
अक्तू॰ 25
7058
Displaying Many2one field on mobile devices identical to desktop view in Odoo 17
Odoo17
Avatar
Avatar
1
जुल॰ 25
1540
Update the discount in POS order
Odoo17
Avatar
0
नव॰ 24
1887
New employee Button in POS
Odoo17
Avatar
0
अक्तू॰ 24
2435
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now