<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      odoo 繼承(owl繼承、web繼承、view繼承)

      owl繼承

        1 /** @odoo-module */
        2 
        3 import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
        4 import { _t } from "@web/core/l10n/translation";
        5 import { onMounted, useRef, useState, onWillDestroy } from "@odoo/owl";
        6 import { Orderline } from "@point_of_sale/app/generic_components/orderline/orderline";
        7 import { OrderWidget } from "@point_of_sale/app/generic_components/order_widget/order_widget";
        8 import { omit } from "@web/core/utils/objects";
        9 import { useService } from "@web/core/utils/hooks";
       10 import { usePos } from "@point_of_sale/app/store/pos_hook";
       11 import { makeEnv } from "@web/env";
       12 
       13 
       14 // IMPROVEMENT: This code is very similar to TextInputPopup.
       15 //      Combining them would reduce the code.
       16 export class FRIDPopup extends AbstractAwaitablePopup {
       17     static template = "esale_frid.FRIDPopup";
       18     static components = {
       19         Orderline,
       20         OrderWidget,
       21     };
       22 
       23     static defaultProps = {
       24         confirmText: _t("OK"),
       25         cancelText: _t("Cancel"),
       26         clearText: _t("Clear All"),
       27         title: "RFID Reading",
       28     };
       29 
       30     static props = {
       31         data: Object,
       32         formatCurrency: Function,
       33     };
       34 
       35     get totalQty() {
       36         let sum = 0.0
       37         this.props.data.forEach(function(item) {
       38             sum += parseInt(item.qty);
       39         });
       40         return sum.toFixed(2);
       41     }
       42 
       43     /**
       44      * @param {Object} props
       45      * @param {string} props.startingValue
       46      */
       47     setup() {  // 鉤子,第一次安裝
       48         super.setup();
       49         this.orm = useService("orm"); // 獲取orm全局狀態(tài)
       50         this.pos = usePos(); // 獲取pos全局狀態(tài)
       51         const env = makeEnv(); // 語(yǔ)言、登錄信息之類
       52         
       53         console.log('這里是pos的配置信息:',this.pos.config)
       54 
       55 
       56         onWillDestroy(this.onWillDestroy) // 銷毀鉤子
       57         onMounted(this.onMounted); // 掛載鉤子
       58     }
       59 
       60     
       61     async addProductData (epc_barcode) {  // 普通方法
       62         if (this.epcList.has(epc_barcode)) {
       63             return
       64         }
       65         this.epcList.add(epc_barcode)
       66         let barcode = this.decodeEPC(epc_barcode)
       67         barcode = barcode.barcode
       68         console.log("barcode:", barcode)
       69         try {
       70             const limit = 30;
       71             const ProductIds = await this.orm.call(
       72                 "product.product",
       73                 "search",
       74                 [
       75                     [
       76                         ["barcode", "=", barcode],
       77                     ],
       78                 ],
       79                 {
       80                     offset: 0,
       81                     limit: limit,
       82                 }
       83             );
       84             console.log("ProductIds:",ProductIds)
       85             if (ProductIds.length > 0){
       86                 const product = await this.pos.db.get_product_by_id(ProductIds[0])
       87                 console.log("product:",product)
       88                 if (product) {
       89                     let pdata = {
       90                         'attributes':[],
       91                         'discount': '0',
       92                         'pack_lot_lines': false,
       93                         'price': product.lst_price.toFixed(2),
       94                         'price_without_discount': product.lst_price.toFixed(2),
       95                         'productName': product.display_name, //product.description_sale,
       96                         'product_id': ProductIds[0], //product.product_tmpl_id,
       97                         'qty': "1.00",
       98                         'unit': product.uom_id[1],
       99                         'unitPrice':product.lst_price.toFixed(2),
      100                         'noDel': true,
      101                         'epc_barcode': epc_barcode,
      102                         "product": product,
      103                     }
      104                     console.log("pdata:",pdata)
      105                     this.props.data.push(pdata)
      106    
      107                 }
      108             }
      109 
      110         } catch (error) {
      111             if (error instanceof ConnectionLostError || error instanceof ConnectionAbortedError) {
      112                 return this.popup.add(OfflineErrorPopup, {
      113                     title: _t("Network Error"),
      114                     body: _t(
      115                         "Product is not loaded. Tried loading the product from the server but there is a network error."
      116                     ),
      117                 });
      118             } else {
      119                 throw error;
      120             }
      121         }
      122        
      123     };
      124 
      125     onMounted() {  
      126         // this.inputRef.el.focus()
      127         this.epcList = new Set();
      128         this.heartbeatTimer = null;
      129         this.connectWebSocket(this.pos.config.rfid_url, this.pos.config.rfid_client_id,this.pos.config.rfid_room,this.pos.config.rfid_account,this.pos.config.rfid_devicename);
      130         console.log('onMounted')
      131     }
      132 
      133     onWillDestroy(){
      134         clearInterval(this.heartbeatTimer);
      135         this.stopRead()
      136         this.socket.close();
      137         console.log('onWillDestroy')
      138     }
      139    
      140     getPayload() {
      141         this.props.formatCurrency(this.props.data)
      142         return "";
      143     }
      144 
      145 }

       

      web繼承

       1 <?xml version="1.0" encoding="UTF-8" ?>
       2 <!-- point_of_sale_template 是固定語(yǔ)法 -->
       3 <template id="ClearItemIcon" inherit="point_of_sale_template" xml:space="preserve">  
       4     <t t-inherit="point_of_sale.Orderline" t-inherit-mode="extension">
       5         <xpath expr="http://div[hasclass('product-price')]" position="inside">
       6             <t t-if="!line.noDel">
       7                 <i style="margin-left:6px;cursor:pointer;color:red;" id="clear_icon" class="fa fa-trash" t-on-click="clear_button_fun"/>
       8             </t>
       9 
      10         </xpath>
      11     </t>
      12 </template>

       

      view繼承

       1 <?xml version="1.0" encoding="utf-8"?>
       2 <odoo>
       3     <data>
       4 
       5         <record id="rfid_pos_config_view_form_inherit" model="ir.ui.view">
       6             <field name="name">rfid.pos.config</field>
       7             <field name="model">pos.config</field>
       8             <field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
       9             <field eval="9" name="priority"/>
      10             <field name="arch" type="xml">
      11                 <xpath expr="http://div[@groups='base.group_system']" position="before">
      12                     <group>
      13                         <group>
      14                             <field name="yourself_field" />
      15                             
      16                         </group>
      17                         <group>
      18                             
      19                         </group>
      20                     </group>
      21                     
      22                 </xpath>
      23             </field>
      24         </record>
      25     </data>
      26 </odoo>

      注意,這三個(gè)資源在__manifest__.py中,view是配置到data中,owl和web是在assets中,如:

       1 # -*- coding: utf-8 -*-
       2 {
       3     'depends': ['base', 'point_of_sale'],
       4     'assets': {
       5         'point_of_sale._assets_pos': [
       6             'esale_frid/static/src/**/*',
       7         ],
       8     },
       9     'data': [
      10         'views/pos_config_rfid.xml',
      11     ],
      12 
      13 }

       

      posted @ 2024-03-29 09:31  看一百次夜空里的深藍(lán)  閱讀(268)  評(píng)論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 91精品久久久久久无码人妻| 在线观看特色大片免费视频| 依兰县| 国产精品久久中文字幕网| 亚洲乱人伦中文字幕无码| 国产成人精品亚洲日本片| 女人与公狍交酡女免费| 亚洲一区二区av高清| 爆乳日韩尤物无码一区| 人妻教师痴汉电车波多野结衣| 久久九九精品99国产精品| 婷婷色香五月综合缴缴情香蕉| 亚洲gay片在线gv网站| 97久久综合亚洲色hezyo| 国内精品久久人妻无码不卡| 日韩在线成年视频人网站观看| 国产日女人视频在线观看| 九九久久精品国产免费看小说| 99人中文字幕亚洲区三| 欧洲码亚洲码的区别入口| 日韩内射美女人妻一区二区三区| 1000部拍拍拍18勿入免费视频下载| 高清美女视频一区二区三区| 起碰免费公开97在线视频| 精品卡通动漫亚洲AV第一页| 亚洲精品综合一区二区在线| 精品伊人久久久香线蕉| 美女胸18下看禁止免费视频| 免费又黄又爽1000禁片| 四虎成人精品永久网站| 亚洲精品天堂在线观看| 精品久久久无码人妻中文字幕| 亚洲中文字幕日产无码成人片| 亚洲18禁一区二区三区| 最新精品国产自偷在自线| 国产激情艳情在线看视频| 国产中文字幕一区二区| 亚洲欧美综合人成在线| 又粗又紧又湿又爽的视频| 欧美成本人视频免费播放| 给我播放片在线观看|