2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-01-16 11:34:37 +01:00
|
|
|
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
2018-01-16 06:58:15 +01:00
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra import api, models
|
2018-01-16 06:58:15 +01:00
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra.addons.calendar.models.calendar import get_real_ids
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
class MailInvite(models.TransientModel):
|
|
|
|
|
|
|
|
_inherit = 'mail.wizard.invite'
|
|
|
|
|
|
|
|
@api.model
|
|
|
|
def default_get(self, fields):
|
|
|
|
""" In case someone clicked on 'invite others' wizard in the followers widget, transform virtual ids in real ids """
|
|
|
|
if 'default_res_id' in self._context:
|
|
|
|
self = self.with_context(default_res_id=get_real_ids(self._context['default_res_id']))
|
|
|
|
|
|
|
|
result = super(MailInvite, self).default_get(fields)
|
|
|
|
if 'res_id' in result:
|
|
|
|
result['res_id'] = get_real_ids(result['res_id'])
|
|
|
|
return result
|