[IMP][REF] website_forum: added the published mixin. A hook on res.users

has also been added, because the action open_website_url linked to the publish
button is not defined on res.users model (but on its inherited partner).
It now has the method that is routed on its partner.
This commit is contained in:
David Monjoie
2015-01-20 17:34:33 +01:00
committed by Thibault Delavallée
parent d4d5b1b562
commit 28c79ec7d0
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -105,3 +105,8 @@ class Users(models.Model):
else:
excluded_categories = ['forum']
return super(Users, self).get_serialised_gamification_summary()
# Wrapper for call_kw with inherits
@api.multi
def open_website_url(self):
return self.mapped('partner_id').open_website_url()
+4 -2
View File
@@ -12,8 +12,10 @@
<field name="karma" string="Forum Karma"/>
</field>
<xpath expr="//div[contains(@class, 'oe_right oe_button_box')]" position="inside">
<br/>
<field name="website_published" class="pull-right" widget="website_button"/>
<button class="oe_inline oe_stat_button" name="open_website_url"
type="object" icon="fa-globe">
<field name="website_published" widget="website_button"/>
</button>
</xpath>
</field>
</record>