summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Demaret Rivarola <jde@odoo.com>2019-05-13 15:35:31 +0000
committerJohan Demaret Rivarola <jde@odoo.com>2019-05-13 16:34:27 +0000
commit2a14eea095e9758eaba4d1bee1e0783c7a9c3304 (patch)
tree0aee3ed48c3c8d71a5f4c44776d18b5eec18a40a
parentb03af37462c6b1fc1f3be7907871c0562ad5c0db (diff)
[FIX] website_{crm_partner_assign,customer}: fix 404 when crawling
When website_customer is not installed, some endpoints are not handled by the router, causing the following tests to fail: - test_10_crawl_public - test_20_crawl_demo - test_30_crawl_admin Those tests were failing due to /customers responding with 404. Indeed, the route /customers is defined in website_customer, but had some usage within website_crm_partner_assign, causing tests to fail when the former module is not installed. The new behavior can be explained as follows: - module website_crm_partner_assign on its own will lose the hyperlink. - module website_customer will now inherit the view definition in order to wrap the targeted HTML text elements with an anchor tag. Closes #33344 Signed-off-by: Christophe Simonis <chs@odoo.com>
-rw-r--r--addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml12
-rw-r--r--addons/website_customer/views/website_customer_templates.xml9
2 files changed, 12 insertions, 9 deletions
diff --git a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
index cbae6b073e1..3806cce6491 100644
--- a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
+++ b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
@@ -170,18 +170,12 @@
<template id="references_block" name="Partner References Block">
<t t-if="any([p.website_published for p in partner.implemented_partner_ids])">
<h3 id="references">References</h3>
- <div t-foreach="partner.implemented_partner_ids" t-as="reference" class="media">
- <t t-if="reference.website_published">
- <a class="pull-left" t-attf-href="/customers/#{slug(reference)}">
- <span t-field="reference.image_small" t-options='{"widget": "image", "class": "center-block"}'/>
- </a>
+ <div t-foreach="partner.implemented_partner_ids" t-if="reference.website_published" t-as="reference" class="media">
+ <span t-field="reference.image_small" t-options='{"widget": "image", "class": "center-block pull-left"}'/>
<div class="media-body" style="min-height: 64px;">
- <a class="media-heading" t-attf-href="/customers/#{slug(reference)}">
- <span t-field="reference.self"/>
- </a>
+ <span class="media-heading" t-field="reference.self"/>
<div t-field='reference.website_short_description'/>
</div>
- </t>
</div>
</t>
</template>
diff --git a/addons/website_customer/views/website_customer_templates.xml b/addons/website_customer/views/website_customer_templates.xml
index d4c743cdcd5..81b83e89e1d 100644
--- a/addons/website_customer/views/website_customer_templates.xml
+++ b/addons/website_customer/views/website_customer_templates.xml
@@ -208,4 +208,13 @@
</t>
</template>
+<template id="references_block_href" inherit_id="website_crm_partner_assign.references_block" name="Partner References Block">
+ <xpath expr="//div/span" position="replace">
+ <a class="pull-left" t-attf-href="/customers/#{slug(reference)}">$0</a>
+ </xpath>
+ <xpath expr="//div[@class='media-body']/span" position="replace">
+ <a class="media-heading" t-attf-href="/customers/#{slug(reference)}">$0</a>
+ </xpath>
+</template>
+
</odoo>