[REF] stock: don't use "extension" mode for custom component
It's bad practice to use the "extension" inheritance mode for a custom component. In this case, inheritance is only necessary for the "StockMoveX2ManyField" custom field. In this commit, we will therefore use primary mode to generate a custom template used only by "StockMoveX2ManyField". closes odoo/odoo#140301 Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
@@ -5,6 +5,8 @@ import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
import { X2ManyField, x2ManyField } from "@web/views/fields/x2many/x2many_field";
|
||||
|
||||
export class MovesListRenderer extends ListRenderer {
|
||||
static recordRowTemplate = "stock.MovesListRenderer.RecordRow";
|
||||
|
||||
processAllColumn(allColumns, list) {
|
||||
let cols = super.processAllColumn(...arguments);
|
||||
if (list.resModel === "stock.move") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-inherit-mode="extension" t-inherit="web.ListRenderer.RecordRow">
|
||||
<t t-name="stock.MovesListRenderer.RecordRow" t-inherit-mode="primary" t-inherit="web.ListRenderer.RecordRow">
|
||||
<xpath expr="//tr/t[1]" position="inside">
|
||||
<t t-if="column.type === 'opendetailsop'">
|
||||
<td class="o_data_cell cursor-pointer o_list_button">
|
||||
|
||||
Reference in New Issue
Block a user