[IMP] mass_mailing{_sms}: allow switching mail server in sent mailing

Currently, users can't switch Outgoing Mail Server once the mailing has been
sent. This might cause issue some situation. For example, the user has two
Email Servers. He tries sending with the first server and something is wrong
then emails couldn't be sent. So in this case user can not edit the mail
server and instead has to create another mailing with second working server.

This commit improves the behavior by removing the readonly attr on
`Mail Server` field of mass mailing.

Task-Id : 2223141
Closes  : #48256

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Krupal Oza
2020-03-30 10:26:54 +00:00
committed by Dharmraj Jhala
parent 5c97602c3f
commit 3287c28a0e
2 changed files with 2 additions and 6 deletions
@@ -218,8 +218,7 @@
<field name="attachment_ids" widget="many2many_binary" string="Attach a file" class="oe_inline"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</div>
<field name="mail_server_id" groups="base.group_no_one" options="{'no_create': True, 'no_open': True}"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="mail_server_id" groups="base.group_no_one" options="{'no_create': True, 'no_open': True}"/>
<field name="keep_archives" groups="base.group_no_one" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</group>
<group string="Marketing" groups="base.group_no_one,mass_mailing.group_mass_mailing_campaign">
@@ -138,10 +138,7 @@
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//field[@name='mail_server_id']" position="attributes">
<attribute name="attrs">{
'invisible': [('mailing_type', '!=', 'mail')],
'readonly': [('state', 'in', ('sending', 'done'))]}
</attribute>
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
</field>
</record>