Using <xpath> in OpenERP/ odoo

<template id="report_saleorder_document">
  <t t-call="report.external_layout">
    <div class="page">
        <span t-field=""/>
      <table class="table table-condensed">
            <th class="text-right">Quantity</th>
            <th class="text-right">Unit Price</th>
            <th t-if="display_discount" class="text-right"</th>
            <th class="text-right">Taxes</th>
            <th class="text-right" name="price_subtotal_head">Price</th>

Using to add new label:

Option 1:

<xpath expr="//th[@name='price_subtotal_head']" position="after">
  <th class="text-right">New Label</th>

Option 2:

<xpath expr="//t/div/table/thead/tr/th[5]" position="after">
  <th class="text-right">New Label</th>

Option 3:

<xpath expr="//t/div/table/thead/tr/th[last()]" position="after">
  <th class="text-right">New Label</th>

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s