Skip to content

Commit

Permalink
[REV] base: revert rename ir.logging type to logging_type
Browse files Browse the repository at this point in the history
This reverts commit c42a130
and commit fb7ac56.

The runbot is using cross db logging and those commit were breaking the
mechanism. As a result, the master builds logs were empty.
If we update the runbot to use logging_type instead, the other versions
builds will be impacted hence this revert.
  • Loading branch information
d-fence committed Nov 8, 2018
1 parent 13e68d6 commit 8dde05e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion addons/delivery/models/delivery_carrier.py
Expand Up @@ -174,7 +174,7 @@ def log_xml(self, xml_string, func):
env = api.Environment(cr, SUPERUSER_ID, {})
IrLogging = env['ir.logging']
IrLogging.sudo().create({'name': 'delivery.carrier',
'logging_type': 'server',
'type': 'server',
'dbname': db_name,
'level': 'DEBUG',
'message': xml_string,
Expand Down
2 changes: 1 addition & 1 deletion odoo/addons/base/models/ir_actions.py
Expand Up @@ -507,7 +507,7 @@ def _get_eval_context(self, action=None):
def log(message, level="info"):
with self.pool.cursor() as cr:
cr.execute("""
INSERT INTO ir_logging(create_date, create_uid, logging_type, dbname, name, level, message, path, line, func)
INSERT INTO ir_logging(create_date, create_uid, type, dbname, name, level, message, path, line, func)
VALUES (NOW() at time zone 'UTC', %s, %s, %s, %s, %s, %s, %s, %s, %s)
""", (self.env.uid, 'server', self._cr.dbname, __name__, level, message, "action", action.id, action.name))

Expand Down
2 changes: 1 addition & 1 deletion odoo/addons/base/models/ir_logging.py
Expand Up @@ -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)
logging_type = fields.Selection([('client', 'Client'), ('server', 'Server')], string='Type', required=True, index=True, oldname='type')
type = fields.Selection([('client', 'Client'), ('server', 'Server')], required=True, index=True)
dbname = fields.Char(string='Database Name', index=True)
level = fields.Char(index=True)
message = fields.Text(required=True)
Expand Down
8 changes: 4 additions & 4 deletions odoo/addons/base/views/ir_logging_views.xml
Expand Up @@ -7,7 +7,7 @@
<group>
<field name="create_date" />
<field name="dbname" />
<field name="logging_type" />
<field name="type" />
<field name="name" />
<field name="level" />
<field name="path" />
Expand All @@ -25,7 +25,7 @@
<field name="create_date" />
<field name="create_uid" />
<field name="dbname" />
<field name="logging_type" />
<field name="type" />
<field name="name" />
<field name="level" />
<field name="path" />
Expand All @@ -39,14 +39,14 @@
<field name="arch" type="xml">
<search string="Logs">
<field name="dbname" />
<field name="logging_type" />
<field name="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': 'logging_type'}" />
<filter string="Type" name="group_by_type" domain="[]" context="{'group_by': 'type'}" />
<filter string="Creation Date" name="group_by_month" domain="[]" context="{'group_by': 'create_date'}" />
</group>
</search>
Expand Down
2 changes: 1 addition & 1 deletion odoo/netsvc.py
Expand Up @@ -51,7 +51,7 @@ def emit(self, record):

val = ('server', ct_db, record.name, levelname, msg, record.pathname[len(path_prefix)+1:], record.lineno, record.funcName)
cr.execute("""
INSERT INTO ir_logging(create_date, logging_type, dbname, name, level, message, path, line, func)
INSERT INTO ir_logging(create_date, type, dbname, name, level, message, path, line, func)
VALUES (NOW() at time zone 'UTC', %s, %s, %s, %s, %s, %s, %s, %s)
""", val)

Expand Down

0 comments on commit 8dde05e

Please sign in to comment.