[FIX] P3: (ir.values).value is bytes
or buffer/memoryview when coming directly from XML
This commit is contained in:
@@ -407,7 +407,7 @@ class IrValues(models.Model):
|
||||
for id, name, value in self._cr.fetchall():
|
||||
if not value:
|
||||
continue # skip if undefined
|
||||
action_model, action_id = value.decode('utf-8').split(',')
|
||||
action_model, action_id = bytes(value).decode('utf-8').split(',')
|
||||
if action_model not in self.env:
|
||||
continue # unknown model? skip it!
|
||||
action = self.env[action_model].browse(int(action_id))
|
||||
|
||||
@@ -64,7 +64,7 @@ class TestServerActions(TestServerActionsBase):
|
||||
# Test: ir_values created
|
||||
ir_values = self.env['ir.values'].search([('name', '=', 'Run TestAction')])
|
||||
self.assertEqual(len(ir_values), 1, 'ir_actions_server: create_action should have created an entry in ir_values')
|
||||
self.assertEqual(ir_values.value, 'ir.actions.server,%s' % self.action.id, 'ir_actions_server: created ir_values should reference the server action')
|
||||
self.assertEqual(ir_values.value, b'ir.actions.server,%d' % self.action.id, 'ir_actions_server: created ir_values should reference the server action')
|
||||
self.assertEqual(ir_values.model, 'res.partner', 'ir_actions_server: created ir_values should be linked to the action base model')
|
||||
|
||||
# Do: remove contextual action
|
||||
|
||||
Reference in New Issue
Block a user