我需要在odoo 9

时间:2017-07-06 06:21:42

标签: jquery odoo-9

我想在odoo 9中使用jquery获取xml字段值

我在xml文件中有一个字段作为文本框  我的代码是:

<record id="shortcut_form" model="ir.ui.view">
        <field name="name">keybord.form</field>
        <field name="model">pos.shortcut</field>
        <field name="arch" type="xml">
            <form string="Pierce_shortcut">
                <sheet>
                    <group>
                        <t t-name="PosConfig">
                            <group>
                                <field  class="payment" name="payment"/>
                                <field name="select_customer" class="select_customer" />
                                <field name="back" class="price" />
                            </group>
                        </t>
                    </group>

                </sheet>

            </form>
        </field>
    </record>

如果我在文本框中输入值,则应使用jquery中onchange事件中的内部html打印近文本框 和我的模板xml文件,用于插入js文件:

<template id="PosConfig" name="pierce_ pos_backend"
        inherit_id="web.assets_backend">
        <xpath expr="." position="inside">
            <script type="text/javascript"
                src="/pierce_pos_keyboard_shortcuts/static/src/js/pos_config.js"></script>
        </xpath> 
    </template>

如何编写js代码

感谢。

0 个答案:

没有答案