Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi_livechat: change mail.channel.partner to mail.channel.member #461

Open
wants to merge 3 commits into
base: 16.0
Choose a base branch
from

Conversation

stanleykao72
Copy link

  1. mail.channel: the function _prepare_multi_livechat_channel_vals doesn't return public and group_public_id field when create mail.channel
  2. model mail.channel.partner change to mail.channel.member

multi_livechat/models/mail_channel.py Outdated Show resolved Hide resolved
Comment on lines 24 to 30
"public": "groups",
"group_public_id": self.env.ref("base.group_user").id,
# "public": "groups", # V16 dropout public field
"group_public_id": False, # V16 checks contrains with group_public_id self.env.ref("base.group_user").id,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field public is removed in v16 -> ok

Field group_public_id is computed in v16 with readonly=False. Maybe just remove the field from result?

https://github.com/odoo/odoo/blob/ef8a9cf01e67f518d85e30221a596372c358a65c/addons/mail/models/mail_channel.py#L196-L201

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove Field group_public_id, and it's working after I tested it.

@@ -41,7 +47,8 @@ def _compute_is_pinned(self):
def _inverse_is_pinned(self):
# TODO: make batch search via read_group
for r in self:
channel_partner = self.env["mail.channel.partner"].search(
# V16 change mail.channel.partner to mail.channel.member
channel_partner = self.env["mail.channel.member"].search(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

multi_livechat/models/demo/mail_channel.py Outdated Show resolved Hide resolved
Comment on lines 3 to 8
from odoo import api, fields, models
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError

import logging

_logger = logging.getLogger(__name__)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New imports are not used...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed not used imports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants