'Returns any default values that are defined for the current model and user,
(and match ``condition``, if specified), previously registered via
:meth:`~.set_default`.
Defaults are global to a model, not field-specific, but an optional
``condition`` can be provided to restrict matching default values
to those that were defined for the same condition (usually based
on another field\'s value).
Default values also have priorities depending on whom they apply
to: only the highest priority value will be returned for any
field. See :meth:`~.set_default` for more details.
:param string model: model name
:param string condition: optional condition specification that can be used to
restrict the applicability of the default values
(e.g. based on another field\'s value). This is an
opaque string as far as the API is concerned, but client
stacks typically use single-field conditions in the
form ``\'key=stringified_value\'``.
(Currently, the condition is trimmed to 200 characters,
so values that share the same first 200 characters always
match)
:return: list of default values tuples of the form ``(id, field_name, value)``
(``id`` is the ID of the default entry, usually irrelevant)'

@api.model
def get_defaults(self, model, condition=False):

    query = '    SELECT    v.id,    v.name,    v.value    FROM    ir_values    v\n                                                                                LEFT    JOIN    res_users    u    ON    (v.user_id    =    u.id)\n                                                                                WHERE    v.key    =    %%s    AND    v.model    =    %%s\n                                                                                                AND    (v.user_id    =    %%s    OR    v.user_id    IS    NULL)\n                                                                                                AND    (v.company_id    IS    NULL    OR\n                                                                                                                    v.company_id    =    (SELECT    company_id    FROM    res_users    WHERE    id    =    %%s)\n                                                                                                                )\n                                                                                %s\n                                                                                ORDER    BY    v.user_id,    u.company_id'
    params = ('default', model, self._uid, self._uid)
    if condition:
        query = (query % 'AND    v.key2    =    %s')
        params += (condition[:200],)
    else:
        query = (query % 'AND    v.key2    IS    NULL')
    self._cr.execute(query, params)
    defaults = {}
    for row in self._cr.dictfetchall():
        value = pickle.loads(row['value'].encode('utf-8'))
        defaults.setdefault(row['name'], (row['id'], row['name'], value))
    return defaults.values()
