I added a boolean field : 'isTrue' in res.partner model , I want to show or hide the button 'Reward' on 'NumpadWidget' based on boolean value; And , to take into consideration this value when changing from customer to anotherin pos interface.
Here is my code :
odoo.define('customer', function(require){
'use strict';
var models = require('point_of_sale.models');
var screens = require('point_of_sale.screens');
models.load_fields('res.partner','is_true');
screens.NumpadWidget.include({
changedMode: function() {
var is_true = is_true;
if (is_true) {
$('#RewardButton').('show');
} else {
$('#RewardButton').('hide');
}
self._super();
},
});
});
Any help please? Thanks.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
1
الرد
4352
أدوات العرض
Hi,
Try the following code.
odoo.define('customer', function(require){
"use strict";
const components = {
NumpadWidget: require('point_of_sale.NumpadWidget'),
};
const { patch } = require('web.utils');
var models = require('point_of_sale.models');
models.load_fields('res.partner','is_true');patch(components.NumpadWidget, 'customer', {
mounted() { if (this.env.pos.config.module_pos_loyalty) {
$($('.numpad').find('.mode-button')[2]).removeClass('disable');
}else{
$($('.numpad').find('.mode-button')[2]).addClass('disable'); },
changeMode(mode) {
if (is_true)
{
this.$('#RewardButton').show(); } else {
this.$('#RewardButton').hide();
} }
}
});
});
Regards
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
2
أغسطس 24
|
6374 | ||
|
1
أكتوبر 22
|
24115 | ||
|
2
سبتمبر 21
|
12799 | ||
|
1
أغسطس 21
|
8346 | ||
|
1
ديسمبر 23
|
29109 |