首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Odoo 14中更新point_of_sale.screens

如何在Odoo 14中更新point_of_sale.screens
EN

Stack Overflow用户
提问于 2020-11-23 23:29:57
回答 1查看 603关注 0票数 0

我正在迁移到Odoo14,并且PoS模块已经更改。我有一些继承了ClientListScreenWidget和PaymentScreenWidget等的函数,代码如下:

代码语言:javascript
复制
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中继承呢?这个文件怎么了?

EN

回答 1

Stack Overflow用户

发布于 2021-01-04 18:45:31

替换

代码语言:javascript
复制
var screens = require('point_of_sale.screens');

有了这个

代码语言:javascript
复制
var screens = require('point_of_sale.ProductScreen');
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64971364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档