Tuesday 21 March 2017

Display field name when inspect element on many2one and char field in odoo

Display field name when inspect element on many2one and char field in odoo

Code Applay In Version - 10

Example is below:-
Example: <input id="oe-field-input-13" name="field_name" type="text">
---------------------------------------------------------------------------------------------
Inherit FieldChar template for add 't-att-name="widget.name"''

Inherit FieldMany2One template for add 't-att-name="widget.name"''

After Create below file register in __openerp__.py file

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

    <t t-extend="FieldChar">
        <t t-jquery="input" t-operation="replace">
        <input t-if="!widget.get('effective_readonly')" class="o_form_input"
            t-att-barcode_events="widget.options.barcode_events"
            t-att-type="widget.password ? 'password' : 'text'"
            t-att-name="widget.name"
            t-att-id="widget.id_for_label"
            t-att-tabindex="widget.node.attrs.tabindex"
            t-att-autofocus="widget.node.attrs.autofocus"
            t-att-placeholder="widget.node.attrs.placeholder"
            t-att-autocomplete="widget.password ? 'new-password' : widget.node.attrs.autocomplete"
            t-att-maxlength="widget.field.size"/>
        </t>
    </t>

    <t t-extend="FieldMany2One">
        <t t-jquery="input" t-operation="replace">
       <input type="text" class="o_form_input"
            t-att-name="widget.name"
            t-att-barcode_events="widget.options.barcode_events"
            t-att-id="widget.id_for_label"
            t-att-tabindex="widget.node.attrs.tabindex"
            t-att-autofocus="widget.node.attrs.autofocus"
            t-att-placeholder="widget.node.attrs.placeholder"/>
        </t>
    </t>
</templates>

Code Applay In Version - 8

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

    <t t-extend="FieldChar">
        <t t-jquery="input" t-operation="replace">
   <input t-att-type="widget.password ? 'password' : 'text'"
            t-att-name="widget.name"
                t-att-id="widget.id_for_label"
                t-att-tabindex="widget.node.attrs.tabindex"
                t-att-autofocus="widget.node.attrs.autofocus"
                t-att-placeholder="widget.node.attrs.placeholder"
                t-att-maxlength="widget.field.size"
            />
        </t>
    </t>

    <t t-extend="FieldMany2One">
        <t t-jquery="input" t-operation="replace">
  <input type="text"
t-att-name="widget.name"
t-att-id="widget.id_for_label"
t-att-tabindex="widget.node.attrs.tabindex"
t-att-autofocus="widget.node.attrs.autofocus"
t-att-placeholder="widget.node.attrs.placeholder"
  />
        </t>
    </t>
</templates>

Tuesday 14 March 2017

Could not execute command 'lessc' in odoo-9

Could not execute command 'lessc' in odoo-9


If "Could not execute command 'lessc'" Error ocour while installing odoo-9 and the login page will not show clearly.
Then use this six command in terminal and run it one by one

1- sudo apt-get install nodejs

2- sudo apt-get install npm

3- sudo npm install -g less

4- sudo npm install -g less-plugin-clean-css

5- sudo ln -s /usr/local/bin/lessc /usr/bin/lessc

6- sudo ln -s /usr/bin/nodejs /usr/bin/node

Odoo 17 New Features

  Odoo 17 new Features 1) Duplicate  multiple records from List view. Please have look below screenshots first you need to select records th...