跳至内容
菜单
此问题已终结
2 回复
10411 查看

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?

形象
丢弃
编写者 最佳答案

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();             
            },        
        });  
});
形象
丢弃
最佳答案

have a look here

形象
丢弃
相关帖文 回复 查看 活动
0
4月 25
1055
1
9月 23
7229
0
6月 17
3734
3
2月 25
13816
2
8月 23
4478