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): def __setup__(cls):
super(Activity, cls).__setup__() super(Activity, cls).__setup__()
cls._buttons.update({ cls._buttons.update({
'new': {}, 'new': {
'reply': {}, 'icon': 'tryton-email',
},
'reply': {
'icon': 'tryton-forward'
},
}) })
@property @property

View file

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

View file

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

View file

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