[REF] base: rename ir.logging type field to logging_type

Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
This commit is contained in:
mreficent
2018-10-19 09:13:03 +00:00
committed by Thibault Delavallée
parent 529c1a2e28
commit fb7ac56d65
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -174,7 +174,7 @@ class DeliveryCarrier(models.Model):
env = api.Environment(cr, SUPERUSER_ID, {})
IrLogging = env['ir.logging']
IrLogging.sudo().create({'name': 'delivery.carrier',
'type': 'server',
'logging_type': 'server',
'dbname': db_name,
'level': 'DEBUG',
'message': xml_string,
+1 -1
View File
@@ -10,7 +10,7 @@ class IrLogging(models.Model):
create_date = fields.Datetime(readonly=True)
create_uid = fields.Integer(string='Uid', readonly=True) # Integer not m2o is intentionnal
name = fields.Char(required=True)
type = fields.Selection([('client', 'Client'), ('server', 'Server')], required=True, index=True)
logging_type = fields.Selection([('client', 'Client'), ('server', 'Server')], string='Type', required=True, index=True, oldname='type')
dbname = fields.Char(string='Database Name', index=True)
level = fields.Char(index=True)
message = fields.Text(required=True)
+4 -4
View File
@@ -7,7 +7,7 @@
<group>
<field name="create_date" />
<field name="dbname" />
<field name="type" />
<field name="logging_type" />
<field name="name" />
<field name="level" />
<field name="path" />
@@ -25,7 +25,7 @@
<field name="create_date" />
<field name="create_uid" />
<field name="dbname" />
<field name="type" />
<field name="logging_type" />
<field name="name" />
<field name="level" />
<field name="path" />
@@ -39,14 +39,14 @@
<field name="arch" type="xml">
<search string="Logs">
<field name="dbname" />
<field name="type" />
<field name="logging_type" />
<field name="name" />
<field name="level" />
<field name="message" />
<group expand="0" string="Group By">
<filter string="Database" name="database" domain="[]" context="{'group_by': 'dbname'}" />
<filter string="Level" name="group_by_level" domain="[]" context="{'group_by': 'level'}" />
<filter string="Type" name="group_by_type" domain="[]" context="{'group_by': 'type'}" />
<filter string="Type" name="group_by_type" domain="[]" context="{'group_by': 'logging_type'}" />
<filter string="Creation Date" name="group_by_month" domain="[]" context="{'group_by': 'create_date'}" />
</group>
</search>