Browse Source

[FIX] fixes Recipients field

pull/12/head
x620 9 years ago
parent
commit
4a6b340026
  1. 3
      mail_base/README.rst
  2. 2
      mail_base/__init__.py
  3. 18
      mail_base/models.py
  4. 2
      mail_base/static/src/js/base.js

3
mail_base/README.rst

@ -2,8 +2,9 @@ Mail Base
========= =========
* makes built-in mail js features extendable. * makes built-in mail js features extendable.
* handle ``search_default_*`` parameters in context.
* handles ``search_default_*`` parameters in context.
* fixes toggling left bar * fixes toggling left bar
* fixes Recipients field. Out-of-box this field could be empty.
Usage Usage
----- -----

2
mail_base/__init__.py

@ -1 +1,3 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import models

18
mail_base/models.py

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from openerp import api, models
class MailMessage(models.Model):
_inherit = 'mail.message'
@api.multi
def write(self, values):
if values.get('needaction_partner_ids'):
if not values.get('partner_ids'):
values['partner_ids'] = []
for triplet in values.get('needaction_partner_ids'):
if triplet[0] == 6:
for id in triplet[2]:
values['partner_ids'].append((4, id, False))
return super(MailMessage, self).write(values)

2
mail_base/static/src/js/base.js

@ -269,6 +269,8 @@ var MailTools = core.Class.extend({
var msg = { var msg = {
id: data.id, id: data.id,
author_id: data.author_id, author_id: data.author_id,
needaction_partner_ids: data.needaction_partner_ids,
partner_ids: data.partner_ids,
body_short: data.body_short || "", body_short: data.body_short || "",
body: data.body || "", body: data.body || "",
date: moment(time.str_to_datetime(data.date)), date: moment(time.str_to_datetime(data.date)),

Loading…
Cancel
Save