Browse Source

💚

pull/179/head
Ivan Yelizariev 6 years ago
parent
commit
2043561858
No known key found for this signature in database GPG Key ID: B87954F73B65AC8A
  1. 2
      mail_base/__manifest__.py
  2. 2
      mail_move_message/__manifest__.py
  3. 4
      mail_move_message/doc/index.rst
  4. 11
      mail_move_message/mail_move_message_models.py

2
mail_base/__manifest__.py

@ -4,7 +4,7 @@
"summary": """Makes Mail extendable""",
"category": "Discuss",
"images": [],
"version": "1.0.5",
"version": "10.0.1.0.5",
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@it-projects.info",

2
mail_move_message/__manifest__.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
{
'name': 'Mail relocation',
'version': '1.0.6',
'version': '10.0.1.0.6',
'author': 'IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko',
'license': 'LGPL-3',
'category': 'Discuss',

4
mail_move_message/doc/index.rst

@ -0,0 +1,4 @@
=================
Mail relocation
=================

11
mail_move_message/mail_move_message_models.py

@ -71,7 +71,7 @@ class Wizard(models.TransientModel):
parent_id = fields.Many2one('mail.message', string='Search by name', )
model = fields.Selection(_model_selection, string='Model')
res_id = fields.Integer(string='Record')
can_move = fields.Boolean('Can move', compute='get_can_move')
can_move = fields.Boolean('Can move', compute='_compute_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')
filter_by_partner = fields.Boolean('Filter Records by partner')
@ -88,15 +88,10 @@ class Wizard(models.TransientModel):
@api.depends('message_id')
@api.multi
def get_can_move(self):
def _compute_can_move(self):
for r in self:
r.get_can_move_one()
@api.multi
def get_can_move_one(self):
self.ensure_one()
# message was not moved before OR message is a top message of previous move
self.can_move = not self.message_id.moved_by_message_id or self.message_id.moved_by_message_id.id == self.message_id.id
r.can_move = not r.message_id.moved_by_message_id or r.message_id.moved_by_message_id.id == r.message_id.id
@api.onchange('move_back')
def on_change_move_back(self):

Loading…
Cancel
Save