Browse Source
[IMP] select "internal partners" by defualt (#112)
[IMP] select "internal partners" by defualt (#112)
[FIX] remove incorrect label "TO: followers of ..." [FIX] support Mail Composer in Internal Messagepull/114/head
ArtyomLosev
7 years ago
committed by
Ivan Yelizariev
6 changed files with 486 additions and 79 deletions
-
290mail_base/static/lib/base.js
-
2mail_private/__openerp__.py
-
27mail_private/full_composer_wizard.xml
-
11mail_private/models.py
-
113mail_private/static/src/js/mail_private.js
-
20mail_private/static/src/xml/mail_private.xml
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
|
|||
<record model="ir.ui.view" id="email_compose_message_wizard_form_private"> |
|||
<field name="name">mail.compose.message.form.private</field> |
|||
<field name="model">mail.compose.message</field> |
|||
<field name="groups_id" eval="[(4,ref('base.group_user'))]"/> |
|||
<field name="inherit_id" ref="mail.email_compose_message_wizard_form"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
|
|||
<xpath expr="//field[@name='active_domain']" position="after"> |
|||
<field name="is_private" invisible="1" /> |
|||
</xpath> |
|||
|
|||
<xpath expr="//div[@groups='base.group_user']/span[2]" position="attributes"> |
|||
<attribute name="attrs">{'invisible': [('is_private', '=', True)]} |
|||
</attribute> |
|||
</xpath> |
|||
|
|||
</data> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</odoo> |
@ -1,9 +1,14 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from odoo import models, fields |
|||
from odoo import models, fields, api |
|||
|
|||
|
|||
class MailComposeMessage(models.TransientModel): |
|||
_inherit = 'mail.compose.message' |
|||
|
|||
private = fields.Boolean(string='Send Internal Message') |
|||
is_private = fields.Boolean(string='Send Internal Message') |
|||
|
|||
@api.multi |
|||
def send_mail(self, auto_commit=False): |
|||
for w in self: |
|||
w.is_log = True if w.is_private else w.is_log |
|||
super(MailComposeMessage, self).send_mail(auto_commit=False) |
@ -1,21 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<template> |
|||
|
|||
<t t-extend="mail.Chatter"> |
|||
<t t-jquery="button[title='Send a message']" t-operation="after"> |
|||
<button class="btn btn-sm btn-link oe_compose_post_private" t-if="!widget.options.compose_placeholder and !widget.options.view_mailbox" title="Send a message to specified recipients only">Send internal message</button> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-extend="mail.chatter.ChatComposer"> |
|||
<t t-jquery="[t-if='!widget.is_private']" t-operation="replace"> |
|||
<t t-if="!widget.is_private and !widget.private"> |
|||
<span class="oe_all_follower"> |
|||
<t t-if="widget.parent_thread.parent_message.record_name"> |
|||
Followers of <t t-raw="'"' + widget.parent_thread.parent_message.record_name + '"'"/> |
|||
<t t-jquery="span[class='o_chatter_composer_info']" t-operation="replace"> |
|||
<span class="o_chatter_composer_info" t-if="!widget.options.is_private"> |
|||
To: Followers of |
|||
<t t-if="widget.options.record_name"> |
|||
"<t t-esc="widget.options.record_name"/>" |
|||
</t> |
|||
<t t-if="!widget.options.record_name"> |
|||
this document |
|||
</t> |
|||
<t t-if="!widget.parent_thread.parent_message.record_name and widget.options.view_inbox">My Followers</t> |
|||
<t t-if="!widget.parent_thread.parent_message.record_name and !widget.options.view_inbox">Followers of this document</t> |
|||
</span> |
|||
</t> |
|||
<t t-jquery="div[class='o_composer_suggested_partners']" t-operation="after"> |
|||
<button class="btn btn-sm btn-link oe_composer_uncheck" t-if="widget.options.is_private">Uncheck all</button> |
|||
</t> |
|||
</t> |
|||
|
|||
</template> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue