Delete string at view level and add to ir.model.button.

Add icon attribute to cls._buttons on model.
This commit is contained in:
Juanjo Garcia 2019-10-02 15:15:58 +02:00
parent e3f01f1911
commit 1d9cac3612
4 changed files with 12 additions and 8 deletions

View File

@ -40,8 +40,12 @@ class Activity(metaclass=PoolMeta):
def __setup__(cls):
super(Activity, cls).__setup__()
cls._buttons.update({
'new': {},
'reply': {},
'new': {
'icon': 'tryton-email',
},
'reply': {
'icon': 'tryton-forward'
},
})
@property

View File

@ -22,7 +22,7 @@
<record model="ir.model.button" id="electronic_mail_new_button">
<field name="name">new</field>
<field name="string">New</field>
<field name="string">Send Mail</field>
<field name="model" search="[('model', '=', 'activity.activity')]"/>
</record>
<record model="ir.model.button-res.group"
@ -33,7 +33,7 @@
<record model="ir.model.button" id="electronic_mail_reply_button">
<field name="name">reply</field>
<field name="string">Reply</field>
<field name="string">Reply Mail</field>
<field name="model" search="[('model', '=', 'activity.activity')]"/>
</record>
<record model="ir.model.button-res.group"

View File

@ -10,8 +10,8 @@
<label name="mail" />
<field name="mail" />
<group colspan="2" col="2" id="buttons">
<button name="new" string="Send Mail" icon="tryton-email"/>
<button name="reply" string="Reply Mail" icon="tryton-forward"/>
<button name="new"/>
<button name="reply"/>
<field name="have_mail" invisible="1"/>
</group>
</group>

View File

@ -3,8 +3,8 @@
copyright notices and license terms. -->
<data>
<xpath expr="/tree/field[@name='state']" position="after">
<button name="new" string="Send Mail"/>
<button name="reply" string="Reply Mail"/>
<button name="new"/>
<button name="reply"/>
<field name="have_mail" tree_invisible="1"/>
</xpath>
</data>