Need to override the base function
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Here is the syntax for inheritance of js in odoo15
odoo.define("js_demo.DemoJs",function(require){ // odoo.define("ModuleName.FileName/DesiredName",function(require)
"use.strict";
const PosComponent = require('point_of_sale.PosComponent');
const { _t } = require('web.core');
const { getDataURLFromFile } = require('web.utils');
const Registries = require("point_of_sale.Registries");
var ClientDetailsEdit = require("point_of_sale.ClientDetailsEdit"); //var VaraibleName1 = require("InheritModuleName.InheritClassName");
// VaraibleName1 same as InheritClassName
var ClientDetailsEditInherit = (ClientDetailsEdit) => //var VaraibleName2 = (VaraibleName1) =>Arrow function
class extends ClientDetailsEdit { //class extends InheritClassName
savesChanges() { //BaseFunctionToInherit()
let processedChanges = {};
for (let [key, value] of Object.entries(this.changes)) {
if (this.intFields.includes(key)) {
processedChanges[key] = parseInt(value) || false;
} else {
processedChanges[key] = value;
}
}
if ((!this.props.partner.name && !processedChanges.name) ||
processedChanges.name === '' ){
return this.showPopup('ErrorPopup', {
title: _t(' Name Is Required'),
});
}
processedChanges.id = this.props.partner.id || false;
this.trigger('save-changes', { processedChanges });
}
};
Registries.Component.extend(ClientDetailsEdit,ClientDetailsEditInherit); //Registries.Component.extend(VaraibleName1,VaraibleName2)
return ClientDetailsEdit; //return VaraibleName1;
});
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 3 25
|
3530 | ||
|
2
thg 4 23
|
3670 | ||
|
0
thg 2 23
|
1698 | ||
|
1
thg 3 22
|
1568 | ||
|
3
thg 2 25
|
11129 |