Skip to Content
Menu
This question has been flagged
2 Replies
8874 Views

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
Discard
Author Best Answer

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
Discard
Best Answer

have a look here

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 23
5907
0
Jun 17
2798
2
Aug 24
6936
2
Aug 23
2520
1
Jun 22
2740