osbzr/gooderp_addons

View on GitHub
core/static/src/xml/base.xml

Summary

Maintainability
Test Coverage
<?xml version='1.0' encoding='utf-8'?>
<template>
    <tr t-name="ListView.row"
    t-att-data-id="record.get('id')"
    t-attf-style="#{(view.fonts || view.colors) ? view.style_for(record) : ''}"
    t-attf-class="#{view.compute_decoration_classnames(record)}">
        <t t-set="asData" t-value="record.toForm().data"/>
        <t t-foreach="columns" t-as="column">
            <td t-if="column.meta"></td>
        </t>
        <td t-if="options.deletable" class='oe_list_record_copy' width="13px">
            <span name="copy" class="fa fa-files-o"/>
        </td>
        <td t-if="edited and !options.deletable" class="oe_list_record_copy"/>
        <td t-if="options.selectable" class="o_list_record_selector">
            <t t-set="checked" t-value="options.select_view_id == record.get('id') ? 'checked' : null"/>
            <input t-if="options.radio" type="radio" name="radiogroup" t-att-checked="checked"/>
            <div t-if="!options.radio" class="o_checkbox">
                <input type="checkbox" name="radiogroup" t-att-checked="checked"/>
                <span/>
            </div>
        </td>
        <t t-foreach="columns" t-as="column">
            <t t-set="number" t-value="column.type === 'integer' or column.type == 'float' or column.type == 'monetary'"/>
            <t t-set="text" t-value="column.type === 'text'"/>
            <t t-set="modifiers" t-value="column.modifiers_for(asData)"/>
            <td t-if="!column.meta and column.invisible !== '1'" t-att-title="column.help"
            t-attf-class="#{modifiers.readonly ? 'o_readonly' : ''} #{number ? 'o_list_number' : ''} #{text ? 'o_list_text' : ''} #{column.id === 'sequence' ? 'o_handle_cell' : ''} #{column.tag === 'button' ? 'o_list_button' : ''}"
            t-att-data-field="column.id"
            >
                <t t-raw="render_cell(record, column)"/>
            </td>
        </t>
        <td t-if="options.deletable" class='o_list_record_delete'>
            <span name="delete" class="fa fa-trash-o"/>
        </td>
    </tr>
     <t t-extend="ListView">
       <t t-jquery="thead" t-operation="replace">
           <thead>
                <tr t-if="options.header">
                    <t t-foreach="columns" t-as="column" >
                        <th t-if="column.meta" rowspan="2" colspan="1">
                            <t t-esc="column.string"/>
                        </th>
                    </t>
                    <th t-if="options.deletable" class='oe_list_record_copy' width="13px" rowspan="2" />
                    <th t-if="options.selectable" class="o_list_record_selector" rowspan="2" colspan="1">
                        <div class="o_checkbox" >
                            <input type="checkbox"/><span/>
                        </div>
                    </th>
                    <t t-foreach="columns" t-as="column">
                        <th t-if="!column.meta and column.invisible !== '1' and column.merge!=='False' and column.merge!=='True'" t-att-data-id="column.id"  rowspan="2" colspan="1"
                            t-attf-class="#{((options.sortable and column.sortable and column.tag !== 'button') ? 'o_column_sortable' : '')}"
                            ><div>
                            <t t-if="column.tag !== 'button'"  ><t t-raw="column.heading()"/></t>
                        </div></th>
                         <th t-if="!column.meta and column.invisible !== '1' and column.merge=='False' "   rowspan="1" t-att-colspan="column.colspan" style='text-align:center;'><div>
                            <t t-if="column.tag !== 'button'"  ><t t-esc="column.base_string"/></t>
                        </div></th>
                    </t>
                    <th t-if="options.deletable" class="o_list_record_delete" rowspan="2" colspan="1"/>
                </tr>
                <tr>
                    <t t-foreach="columns" t-as="column">
                         <th   t-if="!column.meta and column.invisible !== '1' and ( column.merge=='False' or column.merge=='True')" rowspan="1" colspan="1" t-att-data-id="column.id"
                           t-attf-class="#{((options.sortable and column.sortable and column.tag !== 'button') ? 'o_column_sortable' : '')}" style='text-align:right;'><div>
                           <t t-esc="column.child_name"/>
                        </div></th>
                     </t>
                </tr>
           </thead>
        </t>
        <t t-jquery="tfoot > tr:first > td:first" t-operation="before">
            <td t-if="options.deletable" class='oe_list_record_copy' width="13px"/>
        </t>
    </t>
    <t t-name="FieldPdfViewer">
        <div class="o_form_field_pdfviewer">
            <div t-if="!widget.get('effective_readonly')" class="o_form_pdf_controls mt8">
                <span class="o_form_binary_progress">Uploading...</span>
                <button type="button" class="btn btn-sm btn-primary o_select_file_button" title="Select">Upload your file</button>
                <button class="btn btn-sm btn-default fa fa-pencil o_select_file_button" title="Select" type="button"></button>
                <button class="btn btn-sm btn-default fa fa-trash-o o_clear_file_button" title="Clear" type="button"></button>
            </div>
            <iframe class="o_pdfview_iframe o_form_field_pdfviewer"/>
            <t t-call="HiddenInputPDFFile">
                <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
                <t t-set="fileupload_style" t-translation="off">overflow-x: hidden</t>
            </t>
        </div>
    </t>
    <t t-extend="HiddenInputFile" t-name="HiddenInputPDFFile">
        <t t-jquery="input[type='file']:first" t-operation="replace">
            <input type="file" class="o_form_input_file" name="ufile" accept="application/pdf" />
            <input t-if="widget.widget=='image'" type="file" class="o_form_input_file" name="ufile" accept="image/jpeg,image/jpg,image/png"/>
        </t>
    </t>
    <t t-extend="FieldMany2ManyTag">
        <t t-jquery="span:first" t-operation="replace">
            <span t-attf-class="badge dropdown o_tag_color_#{el.color || 6}" t-att-data-color="el.color || 10" t-att-data-index="el_index" t-att-data-id="el.id">
                <span class="o_badge_text" t-attf-title="#{el['display_name']}"><t t-raw="el['display_name']"/></span>
                <span t-if="!readonly" class="fa fa-times o_delete"/>
            </span>
        </t>
    </t>
    <t t-name="BetterList">
        <iframe marginheight="0" marginwidth="0" width="100%" height="100%" src="http://www.gooderp.org" frameborder="0" allowfullscreen="True"></iframe>
    </t>
 </template>