Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
10485 Visualizzazioni

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
Abbandona
Autore Risposta migliore

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
Abbandona
Risposta migliore

have a look here

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
apr 25
1095
1
set 23
7256
0
giu 17
3787
3
feb 25
13945
2
ago 23
4541