Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
10302 Vistas

Extending and/or overriding Screen objects are easy. But copying the pattern does not work for Orderline object..

Here is my code:


odoo.define('pult_pos.main2', function (require) {
    "use strict";
	var pos_model = require('point_of_sale.models')
	
	pos_model.Orderline.include({
               
        get_display_price: function() {
			console.log('GetDisplayPrice 22 CALLED');
            return this.get_base_price();
            },
        
        });
       
})	

What is wrong?

Avatar
Descartar
Autor Mejor respuesta

The answer was in pos_restaurant module.
The objects defined in pos models.js are extended this way:

odoo.define('pult_pos.main2', function (require) {    
    "use strict";    
    var models = require('point_of_sale.models');
    
    models.Orderline = models.Orderline.extend({        
        get_display_price: function(){                   
            return this.get_base_price();             
            },        
        });  
});
Avatar
Descartar
Mejor respuesta

have a look here

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
abr 25
926
1
sept 23
7143
0
jun 17
3635
3
feb 25
13420
2
ago 23
4303