SOLVED: I was using an xpath from the file itself, not from within the <xpath> elements of view.
So in report_invoice_layouted.xml:
<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document">
<xpath expr="//table/tbody/tr/td[@id='subtotal']" position="attributes">
<attribute name="groups">!sale.group_show_price_total</attribute>
</xpath>
<xpath expr="//table/tbody/tr/td[@id='subtotal']" position="after">
<td class="text-right" groups="sale.group_show_price_total">
<span t-field="l.price_total" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</xpath>
<xpath expr="//table" position="attributes">
<attribute name="groups">!sale.group_sale_layout</attribute>
</xpath>
<xpath expr="//table" position="after">
<t groups="sale.group_sale_layout" t-foreach="o.order_lines_layouted()" t-as="page" name="lines_layouted">
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">Disc.(%)</th>
<th class="text-right">Taxes</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<t t-foreach="page" t-as="layout_category">
<t t-if="layout_category_size > 1 or page_size > 1" groups="sale.group_sale_layout">
<tr class="active">
<td colspan="7" style="font-weight: bold; border-bottom: 1px solid black;">&bull;
<t t-esc="layout_category['name']"/>
</td>
</tr>
</t>
<!-- Lines associated -->
<t t-foreach="layout_category['lines']" t-as="l">
<tr>
<td><span t-field="l.name"/></td>
<td class="text-right">
<span t-field="l.quantity"/>
<span t-field="l.uom_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: x.description or x.name, l.invoice_line_tax_ids))"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
<td class="text-right" groups="sale.group_show_price_total">
<span t-field="l.price_total" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</tr>
</t>
<t t-if="(layout_category_size > 1 or page_size > 1) and layout_category['subtotal']" groups="sale.group_sale_layout">
<tr class="text-right">
<td colspan="6">
<strong>Subtotal: </strong>
<t t-set="subtotal" t-value="sum(line.price_subtotal for line in layout_category['lines'])"/>
<span t-esc="subtotal" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/>
</td>
</tr>
</t>
</t>
</tbody>
</table>
<t t-if="page_index < page_size - 1" groups="sale.group_sale_layout">
<p style="page-break-before:always;"> </p>
</t>
</t>
</xpath>
</data>
This:
/data[@inherit_id="account.report_invoice_document"]/xpath[4]/t[@groups="sale.group_sale_layout"]
...was throwing the error.
This
//t[@name="lines_layouted"]
... did not.
I didn't realize I had to start WITHIN one of the <xpath> elements.
There is no problem with inheriting an inherited view. Did you check your xpath expression with a xpath tester?
Yes. I tried ANY xpath expression and tested them. All couldn't be located in parent view.
Post a screenshot of your view so we can review the field values and XML content?