Browse Source

[FIX] res_partner_mails_count.xml use channel_archive

[FIX] remove unused main.js and delete link in templates.xml to it
pull/6/head
x620 9 years ago
parent
commit
f11c963e33
  1. 65
      res_partner_mails_count/static/src/js/main.js
  2. 9
      res_partner_mails_count/templates.xml
  3. 2
      res_partner_mails_count/views/res_partner_mails_count.xml

65
res_partner_mails_count/static/src/js/main.js

@ -1,65 +0,0 @@
odoo.define('res_partner_mails_count.sent', function (require) {
"use strict";
var base_obj = require('mail_base.base');
//-------------------------------------------------------------------------------
var bus = require('bus.bus').bus;
var config = require('web.config');
var core = require('web.core');
var data = require('web.data');
var Model = require('web.Model');
var session = require('web.session');
var time = require('web.time');
var web_client = require('web.web_client');
var _t = core._t;
//-------------------------------------------------------------------------------
// Inherit class and override methods
base_obj.MailTools.include({
get_properties: function(msg){
var properties = this._super.apply(this, arguments);
properties.is_sent_to = this.property_descr("channel_sent_to", msg, this);
return properties;
},
set_channel_flags: function(data, msg){
this._super.apply(this, arguments);
msg.is_sent_to = false;
if (data.sent && data.author_id[0] == session.partner_id) {
if (data.partner_ids[0] && data.partner_ids[0][0] == 5){
msg.is_sent_to = true;
}
}
return msg;
},
get_channel_array: function(msg){
var arr = this._super.apply(this, arguments);
return arr.concat('channel_sent_to');
},
get_domain: function(channel){
return (channel.id === "channel_sent_to") ? [
['sent', '=', true],
['author_id.user_ids', 'in', [openerp.session.uid]]
] : this._super.apply(this, arguments);
}
});
base_obj.chat_manager.is_ready.then(function(){
// Add sent channel
base_obj.chat_manager.mail_tools.add_channel({
id: "channel_sent_to",
name: _t("SentTo"),
type: "static"
});
return $.when();
});
return base_obj.chat_manager;
});

9
res_partner_mails_count/templates.xml

@ -1,15 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<openerp> <openerp>
<data> <data>
<template id="res_partner_mails_count_assets_backend"
name="res_partner_mails_count_assets_backend"
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script src="/res_partner_mails_count/static/src/js/main.js"
type="text/javascript"></script>
</xpath>
</template>
<record id="view_res_partner_mails_count_info_form" model="ir.ui.view"> <record id="view_res_partner_mails_count_info_form" model="ir.ui.view">
<field name="name">res.partner.mails.count</field> <field name="name">res.partner.mails.count</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>

2
res_partner_mails_count/views/res_partner_mails_count.xml

@ -7,7 +7,7 @@
<field name="res_model">mail.message</field> <field name="res_model">mail.message</field>
<field name="context">{ <field name="context">{
'ignore_search_model': True, 'ignore_search_model': True,
'active_id': 'channel_sent_to'
'active_id': 'channel_archive'
}</field> }</field>
<field name="help" type="html"> <field name="help" type="html">
<p> <p>

Loading…
Cancel
Save