跳至內容
選單
此問題已被標幟
2 回覆
10440 瀏覽次數

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
1067
1
9月 23
7237
0
6月 17
3760
3
2月 25
13853
2
8月 23
4510