How to copy field in Odoo 10

0

I'm using Odoo 10 and I'm trying to copy a field. I want to copy a field called Address up to the street field

Pos_custom.xml code located in the src folder

<templates id="template" xml:space="preserve">
<t t-extend="ClientDetailsEdit">
    <t t-jquery=".detail client-name" t-operation="append">
        <div class='client-detail'>
                    <span class='label'>Direccion</span>
                    <input class='detail client-address-street' name='direccion'  placeholder='Direccion'></input>
        </div>

    </t>
</t>
</templates>

js code called pos_partner.js

odoo.define('punto_de_venta.pos_partner', function (require) {
"use strict";
var PosBaseWidget = require('point_of_sale.screens');
var gui = require('point_of_sale.gui');

var QWeb = core.qweb;
var _t = core._t;

var PaymentScreenWidget = PaymentScreenWidget.extend({
init: function(parent, options) {
    var self = this;
    this._super(parent, options);
},
render_detail client-name: function() {
    var self = this;
    var methods = $(QWeb.render('ClientDetailsEdit', { widget:this }));
    methods.on('click','.detail client-name',function(){
    self.click_detail client-name($(this).data('id'));
       });
       methods.on('click','.mode-button',function(){
            self.click_numpad($(this));
        });
    return methods;
},

});
});

Global Xml code

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_backend" name="custom_key_pad" inherit_id="web.assets_backend">
    <xpath expr="." position="inside">
        <script type="text/javascript" src="/punto_de_venta/static/src/js/pos_partner.js"></script>
    </xpath>
</template>
</odoo>

When I load it in the POS of Odoo, nothing appears to me.

    
asked by Yamile Rayme 27.06.2018 в 22:32
source

1 answer

0

I do not see if it is a custom module or if you are inheriting it but you can add the address field after the name field with xpath.

        <xpath expr="//field[@name='nombre']" position="after">
        <field name="direccion"/>
    </xpath>
    
answered by 09.01.2019 в 00:54