I can't figure out why I'm not able to successfully extend this view in Odoo. I'm trying to add some content to one of the buttons in Kanban cards on the sales dashboard.
The base view is `crm.team.dashboard`, and has the following architecture:
<?xml version="1.0"?>
<kanban class="oe_background_grey o_kanban_dashboard o_salesteam_kanban"
create="0" js_class="sales_team_dashboard">
<field name="name"/>
<field name="user_id"/>
<field name="member_ids"/>
<field name="color"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="#{kanban_color(record.color.raw_value)}">
<div class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<div class="o_primary">
<field name="name"/>
</div>
</div>
<div class="o_kanban_manage_button_section">
<a class="o_kanban_manage_toggle_button" href="#">More <i class="fa fa-caret-down"/></a>
</div>
</div>
<div class="container o_kanban_card_content o_visible">
<div class="row">
<div class="col-xs-6 o_kanban_primary_left" name="to_replace_in_sale_crm">
</div>
<div class="col-xs-6 o_kanban_primary_right">
</div>
</div>
</div>
<div class="container o_kanban_card_manage_pane o_invisible">
<div class="row">
<div class="col-xs-4 o_kanban_card_manage_section o_kanban_manage_view">
<div class="o_kanban_card_manage_title">
<span>View</span>
</div>
</div>
<div class="col-xs-4 o_kanban_card_manage_section o_kanban_manage_new">
<div class="o_kanban_card_manage_title">
<span>New</span>
</div>
</div>
<div class="col-xs-4 o_kanban_card_manage_section o_kanban_manage_reports">
<div class="o_kanban_card_manage_title">
<span>Reports</span>
</div>
</div>
</div>
<div t-if="widget.editable" class="o_kanban_card_manage_settings row" groups="sales_team.group_sale_manager">
<div class="col-xs-8">
<ul class="oe_kanban_colorpicker" data-field="color"/>
</div>
<div class="col-xs-4 text-right">
<a type="edit">Settings</a>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
There is a view extending this one that adds the original "Quotations" button to the kanban cards. It's the `crm.team.kanban` view and it has the following architecture:
<?xml version="1.0"?> <data> <xpath expr="//templates" position="before"> <field name="use_quotations"/> <field name="use_invoices"/> <field name="invoiced"/> <field name="invoiced_target"/> <field name="currency_id"/> </xpath> <xpath expr="//div[contains(@class, 'o_kanban_primary_right')]" position="inside"> <div class="row mb4" t-if="record.use_invoices.raw_value"> <div class="col-xs-8"> <a name="266" type="action"> Sales to Invoice </a> </div> <div class="col-xs-4 text-right"> <field name="sales_to_invoice_amount" widget="monetary"/> </div> </div> </xpath> <xpath expr="//div[contains(@class, 'o_kanban_primary_left')]" position="inside"> <button class="btn btn-primary" name="267" type="action">Quotations</button> </xpath> <xpath expr="//div[contains(@class, 'o_kanban_primary_right')]" position="after"> <div t-if="record.invoiced_target.raw_value" class="col-xs-12 o_kanban_primary_bottom" groups="sales_team.group_sale_manager"> <field name="invoiced" widget="progress" title="Invoicing" options="{'current_value': 'invoiced', 'max_value': 'invoiced_target', 'editable': true, 'edit_max_value': true, 'on_change': 'update_invoiced_target'}"/> </div> <div t-if="!record.invoiced_target.raw_value" class="col-xs-12 o_kanban_primary_bottom text-center" groups="sales_team.group_sale_manager"> <a href="#" class="sales_team_target_definition o_inline_link">Click to define a team target</a> </div> </xpath> <xpath expr="//div[contains(@class, 'o_kanban_manage_view')]" position="inside"> <t t-if="record.use_quotations.raw_value"> <div> <a name="267" type="action" class="o_quotation_view_button">Quotations</a> </div> <div> <a name="265" type="action">Sales Orders</a> </div> </t> <div t-if="record.use_invoices.raw_value" groups="account.group_account_invoice"> <a name="268" type="action">Invoices</a> </div> </xpath> <xpath expr="//div[contains(@class, 'o_kanban_manage_new')]" position="inside"> <div t-if="record.use_quotations.raw_value"> <a name="272" type="action"> Quotation </a> </div> </xpath> <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> <t t-if="record.use_quotations.raw_value"> <div> <a name="269" type="action"> Quotation </a> </div> <div> <a name="270" type="action"> Sales </a> </div> </t> <div t-if="record.use_invoices.raw_value" groups="account.group_account_invoice"> <a name="271" type="action"> Invoices </a> </div> </xpath> </data>
My goal is to add some extra text in the "Quotations" button, so it says something like "Quotations (10)". I created a new view called ` x_crm.team.dashboard` that inherits from `crm.team.dashboard`, and gave it the following architecture:
<?xml version="1.0"?> <data> <xpath expr="//div[contains(@class, 'o_kanban_primary_left')]/button" position="inside"> Quotations (Test) </xpath> </data>
However, when I view the dashboard, my changes to not appear. I only see the original "Quotations" button. I have extended views in the past and it worked fine, but I seem to be missing something in this case.
Does anyone have any idea what I'm doing wrong?
If you are looking for an answer, it should be worth the effort of properly formatting your question, even if you have to manually enter line breaks.