[IMP] base, fetchmail: improve the mail servers list

Purpose
=======
Improve the incoming mail server list view and the outgoing form view.
Show the most used option first, and make the view more responsive.

Task-2811567

Part-of: odoo/odoo#88215
This commit is contained in:
std-odoo
2022-07-12 15:36:49 +02:00
parent 9a0050149e
commit eb2dd1d674
3 changed files with 17 additions and 12 deletions
+1 -1
View File
@@ -43,8 +43,8 @@ class FetchmailServer(models.Model):
server = fields.Char(string='Server Name', readonly=True, help="Hostname or IP of the mail server", states={'draft': [('readonly', False)]})
port = fields.Integer(readonly=True, states={'draft': [('readonly', False)]})
server_type = fields.Selection([
('pop', 'POP Server'),
('imap', 'IMAP Server'),
('pop', 'POP Server'),
('local', 'Local Server'),
], string='Server Type', index=True, required=True, default='pop')
is_ssl = fields.Boolean('SSL/TLS', help="Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP3S=995)")
+6 -5
View File
@@ -5,14 +5,14 @@
<field name="name">fetchmail.server.list</field>
<field name="model">fetchmail.server</field>
<field name="arch" type="xml">
<tree decoration-info="state == 'draft'" string="POP/IMAP Servers">
<tree string="POP/IMAP Servers">
<field name="name"/>
<field name="server_type"/>
<field name="is_ssl"/>
<field name="object_id"/>
<field name="user"/>
<field name="date"/>
<field name="message_ids" string="Email Count"/>
<field name="state"/>
<field name="state" widget="badge"
decoration-info="state == 'draft'"
decoration-success="state == 'done'"/>
</tree>
</field>
</record>
@@ -78,6 +78,7 @@
<field name="arch" type="xml">
<search string="Search Incoming Mail Servers">
<field name="name" string="Incoming Mail Server"/>
<field name="user"/>
<filter string="IMAP" name="imap" domain="[('server_type', '=', 'imap')]" help="Server type IMAP."/>
<filter string="POP" name="pop" domain="[('server_type', '=', 'pop')]" help="Server type POP."/>
<separator/>
@@ -10,14 +10,18 @@
name="test_smtp_connection" class="btn-primary"/>
</header>
<sheet>
<group col="4">
<field name="name" placeholder="e.g. My Outgoing Server"/>
<field name="from_filter"/>
<field name="sequence"/>
<field name="active" widget="boolean_toggle"/>
<group>
<group>
<field name="name" placeholder="e.g. My Outgoing Server"/>
<field name="from_filter"/>
</group>
<group>
<field name="sequence"/>
<field name="active" widget="boolean_toggle"/>
</group>
</group>
<group>
<group string="Authentication">
<group>
<field name="smtp_authentication" widget="radio"/>
<field name="smtp_user" attrs="{'invisible': [('smtp_authentication', '!=', 'login')]}" force_save="1"/>
<field name="smtp_pass" attrs="{'invisible': [('smtp_authentication', '!=', 'login')]}" password="True" force_save="1"/>