[英]How to override renderElement function in screens.js in Odoo-12 Point of Sale
[英]How to update point_of_sale.screens in Odoo 14
我正在迁移到 Odoo14 并且 PoS 模块已更改。 我有一些函数继承了 ClientListScreenWidget 和 PaymentScreenWidget 等等,代码如下:
odoo.define('kyohei_pos_computerized_billing.models', function (require) {
"use strict";
var screens = require('point_of_sale.screens');
screens.ClientListScreenWidget.include({
// Client change alerts
save_changes: function () {
if (this.has_client_changed()) {
if (this.new_client) {
if (this.new_client.partner_billing_number === false && this.new_client.billing_name === false) {
alert(
'El cliente que está seleccionando no tiene la "Razón Social" definida!'
)
}else if (this.new_client.partner_billing_number !== false && this.new_client.billing_name === false) {
alert(
'El cliente que está seleccionando no tiene la "Razón Social" definida!'
)
}else if (this.new_client.partner_billing_number === false && this.new_client.billing_name !== false) {
alert(
'El cliente que está seleccionando no tiene el "Número de facturación" definido!'
)
}
}
}
this._super()
},
// Client save alerts
save_client_details: function (partner) {
let document_type = $('select[name="document_type"]').val()
let client_document_number = $('input[name="document_number"]').val()
let client_vat = $('input[name="vat"]').val()
let client_billing_name = $('input[name="billing_name"]').val()
let missing_data_message = 'Si desea facturar este pedido para este cliente, tiene que detallar la información faltante!'
if (!client_billing_name) {
this.gui.show_popup('alert',{
title: 'Falta la "Razón Social" del cliente!',
body: missing_data_message
});
}
switch(document_type) {
case '1':
case '2':
case '3':
case '4':
if (!client_document_number) {
this.gui.show_popup('alert',{
title: 'Falta el "Número de documento" del cliente!',
body: missing_data_message
});
}
break;
case '5':
if (!client_vat) {
this.gui.show_popup('alert',{
title: 'Falta el "NIT" del cliente!',
body: missing_data_message
});
}
}
this._super(partner)
}
})
});
但是屏幕文件在 Odoo14 中不存在。 那么我应该如何在Odoo14中继承呢? 这个文件怎么了?
代替
var screens = require('point_of_sale.screens');
有了这个
var screens = require('point_of_sale.ProductScreen');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.