[REF] mail: remove now unused channel_id field on invite
RATIONALE Channel model is a mail.thread enabled model behaving strangely with followers, notifications and discuss. Its code should however be simplified to be more self contained and avoid unwanted side effects on other models. SPECIFICATIONS Remove ``channel_id`` field from ``mail.invite.wizard``. As we removed support of (un)subscribing channel-based followers there is no need anymore to have a field to add them in invite wizard. We can now safely remove this field as it has no use anymore. LINKS Task ID-2070632 (main task) Task ID-2419762 (followup task) COM PR odoo/odoo#62859 ENT PR odoo/enterprise#15172 UPG PR odoo/upgrade#2005
This commit is contained in:
@@ -130,10 +130,6 @@ QUnit.test('click on "add followers" button', async function (assert) {
|
||||
'res.partner',
|
||||
"'The 'add followers' action should contain thread model in context'"
|
||||
);
|
||||
assert.notOk(
|
||||
payload.action.context.mail_invite_follower_channel_only,
|
||||
"The 'add followers' action should not be restricted to channels only"
|
||||
);
|
||||
assert.strictEqual(
|
||||
payload.action.context.default_res_id,
|
||||
100,
|
||||
|
||||
@@ -755,7 +755,7 @@ function factory(dependencies) {
|
||||
* Open a dialog to add partners as followers.
|
||||
*/
|
||||
promptAddPartnerFollower() {
|
||||
this._promptAddFollower({ mail_invite_follower_channel_only: false });
|
||||
this._promptAddFollower();
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
@@ -1523,10 +1523,8 @@ function factory(dependencies) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Object} [param0={}]
|
||||
* @param {boolean} [param0.mail_invite_follower_channel_only=false]
|
||||
*/
|
||||
_promptAddFollower({ mail_invite_follower_channel_only = false } = {}) {
|
||||
_promptAddFollower() {
|
||||
const action = {
|
||||
type: 'ir.actions.act_window',
|
||||
res_model: 'mail.wizard.invite',
|
||||
@@ -1537,7 +1535,6 @@ function factory(dependencies) {
|
||||
context: {
|
||||
default_res_model: this.model,
|
||||
default_res_id: this.id,
|
||||
mail_invite_follower_channel_only,
|
||||
},
|
||||
};
|
||||
this.env.bus.trigger('do-action', {
|
||||
|
||||
@@ -16,8 +16,6 @@ class Invite(models.TransientModel):
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
result = super(Invite, self).default_get(fields)
|
||||
if self._context.get('mail_invite_follower_channel_only'):
|
||||
result['send_mail'] = False
|
||||
if 'message' not in fields:
|
||||
return result
|
||||
|
||||
@@ -42,8 +40,6 @@ class Invite(models.TransientModel):
|
||||
res_model = fields.Char('Related Document Model', required=True, index=True, help='Model of the followed resource')
|
||||
res_id = fields.Integer('Related Document ID', index=True, help='Id of the followed resource')
|
||||
partner_ids = fields.Many2many('res.partner', string='Recipients', help="List of partners that will be added as follower of the current document.")
|
||||
channel_ids = fields.Many2many('mail.channel', string='Channels', help='List of channels that will be added as listeners of the current document.',
|
||||
domain=[('channel_type', '=', 'channel')])
|
||||
message = fields.Html('Message')
|
||||
send_mail = fields.Boolean('Send Email', default=True, help="If checked, the partners will receive an email warning they have been added in the document's followers.")
|
||||
|
||||
|
||||
@@ -13,13 +13,8 @@
|
||||
<field name="res_id" invisible="1"/>
|
||||
<field name="partner_ids" widget="many2many_tags_email"
|
||||
placeholder="Add contacts to notify..."
|
||||
context="{'force_email':True, 'show_email':True}"
|
||||
invisible="context.get('mail_invite_follower_channel_only')"/>
|
||||
<field name="channel_ids" widget="many2many_tags"
|
||||
placeholder="Add channels to notify..."
|
||||
invisible="not context.get('mail_invite_follower_channel_only')"
|
||||
options="{'no_create': True}"/>
|
||||
<field name="send_mail" invisible="context.get('mail_invite_follower_channel_only')"/>
|
||||
context="{'force_email':True, 'show_email':True}"/>
|
||||
<field name="send_mail"/>
|
||||
<field name="message" attrs="{'invisible': [('send_mail','!=',True)]}" options="{'style-inline': true, 'no-attachment': true}" class="test_message"/>
|
||||
</group>
|
||||
<footer>
|
||||
|
||||
Reference in New Issue
Block a user