<p>我的解决方案很像@SDBot one:</p>
<pre><code><template id="custom_header" inherit_id="website.layout" name="Custom Header">
<xpath expr="//div[@id='wrapwrap']/header" position="attributes">
<attribute name="id">my_header</attribute>
</xpath>
<xpath expr="//ul[@class='nav navbar-nav navbar-right']/li" position="before">
<t t-if="user_id.partner_id.name == 'Public user'">
<li>
<a href="/page/website.signin">
<span data-oe-model="website.menu" data-oe-id="3" data-oe-field="name" data-oe-type="char" data-oe-expression="submenu.name">SignUp</span>
</a>
</li>
</t>
<t t-if="not user_id.partner_id.name == 'Public user'">
<li>
<a href="/page/website.profile">
<span data-oe-model="website.menu" data-oe-id="3" data-oe-field="name" data-oe-type="char" data-oe-expression="submenu.name">My Profile</span>
</a>
</li>
</t>
</xpath>
</template>
</code></pre>