Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
How to get the current model data in JS function when editing a form,in odoo 13

When editing the form, I want to get current model field value in js, and through Ajax post to the controller, and then print the controller response result.

But now I can't get the fields and values of the current module in JS. How can I access them? i need access the current form value,not database data.

odoo.define('jy.abc2', function(require) {
  'use strict';

    var self=this;

    function tab1(){
      console.log('in setInterval');
        var checkDate = $('#checkDate').val();
        var orderNo = $('#orderNo').val();

    //var tmpmodel= self.model;  //cann't access that
    //console.log(tmpmodel);

        $.ajax({
            type: "POST",
            dataType: "json",
            url:"/jy/abc/testjson",
            data: {
                params:{
                    'hotelSeq': 111,
                    'orderNo': 'orderNo',
                    //'tmpmodel':tmpmodel, 

                }
            },
            success: function (msg) {
        console.log(msg);

            },
            error: function () {
                //alert("false")
            }
        });

    }


    $(document).ready(function() {
        var init = setInterval(tab1,5000);
    });


})
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!