|
|
@ -27,13 +27,13 @@ class wizard(models.TransientModel): |
|
|
|
message_moved_by_message_id = fields.Many2one('mail.message', related='message_id.moved_by_message_id', string='Moved with', readonly=True) |
|
|
|
message_moved_by_user_id = fields.Many2one('res.users', related='message_id.moved_by_user_id', string='Moved by', readonly=True) |
|
|
|
message_is_moved = fields.Boolean(string='Is Moved', related='message_id.is_moved', readonly=True) |
|
|
|
parent_id = fields.Many2one('mail.message', string='Search by name') |
|
|
|
parent_id = fields.Many2one('mail.message', string='Search by name', ) |
|
|
|
model = fields.Selection(_model_selection, string='Model', default=_default_model) |
|
|
|
res_id = fields.Integer(string='Record ID', default=_default_res) |
|
|
|
record_url = fields.Char('Link to record', readonly=True) |
|
|
|
can_move = fields.Boolean('Can move', compute='get_can_move') |
|
|
|
move_back = fields.Boolean('Move to origin', help='Move message and submessages to original place') |
|
|
|
partner_id = fields.Many2one('res.partner', string='Author') |
|
|
|
partner_id = fields.Many2one('res.partner', string='Author', related='message_id.author_id') |
|
|
|
filter_by_partner = fields.Boolean('Filter Records by partner') |
|
|
|
|
|
|
|
@api.depends('message_id') |
|
|
@ -79,6 +79,7 @@ class wizard(models.TransientModel): |
|
|
|
def on_change_partner(self): |
|
|
|
domain = {'res_id': []} |
|
|
|
if self.model and self.filter_by_partner and self.partner_id: |
|
|
|
self.res_id = None |
|
|
|
fields = self.env[self.model].fields_get(False) |
|
|
|
contact_field = False |
|
|
|
for n, f in fields.iteritems(): |
|
|
@ -147,6 +148,11 @@ class wizard(models.TransientModel): |
|
|
|
'type': 'ir.actions.act_window', |
|
|
|
} |
|
|
|
|
|
|
|
@api.one |
|
|
|
def delete(self): |
|
|
|
self.message_id.unlink() |
|
|
|
return {} |
|
|
|
|
|
|
|
|
|
|
|
class mail_message(models.Model): |
|
|
|
_inherit = 'mail.message' |
|
|
|