Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

231
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda