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

Master website portal chatter pgu #28140

Open
wants to merge 9 commits into
base: master
from

Conversation

Projects
None yet
7 participants
@pgu-odoo
Copy link
Contributor

pgu-odoo commented Oct 25, 2018

Description of the issue/feature this PR addresses:
task id -
https://www.odoo.com/web#id=37264&action=327&model=project.task&view_type=form&menu_id=
Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

addons/portal/controllers/mail.py Outdated
# message is received in plaintext and saved in html
message = plaintext2html(message)
_message_post_helper(res_model, int(res_id), message, **kw)
_message_post_helper(res_model, int(res_id), message, attachments, **kw)

This comment has been minimized.

@Xavier-Do

Xavier-Do Oct 25, 2018

Contributor

Can you use keyword arguments instead to make it more bug proof?

This comment has been minimized.

@Xavier-Do

Xavier-Do Oct 25, 2018

Contributor

I meant something like:

_message_post_helper(res_model=res_model, res_id=int(res_id), message=message, attachments=attachments, **kw)

addons/portal/controllers/mail.py Outdated
@@ -56,8 +57,13 @@ def _message_post_helper(res_model='', res_id=None, message='', token='', nosubs
raise Forbidden()
kw.pop('csrf_token', None)
kw.pop('attachment_ids', None)
if attachments:
attachments = literal_eval(attachments)

This comment has been minimized.

@Xavier-Do

Xavier-Do Oct 25, 2018

Contributor

This should be done in the portal_chatter_post

addons/portal/controllers/mail.py Outdated
@@ -19,7 +20,7 @@ def _has_token_access(res_model, res_id, token=''):
return (token and record and consteq(record[token_field], token))


def _message_post_helper(res_model='', res_id=None, message='', token='', nosubscribe=True, **kw):
def _message_post_helper(res_model='', res_id=None, message='', attachments=None, token='', nosubscribe=True, **kw):

This comment has been minimized.

@Xavier-Do

Xavier-Do Oct 25, 2018

Contributor

Please, update docstring

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch Oct 25, 2018

@robodoo robodoo removed the CI 🤖 label Oct 25, 2018

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch 2 times, most recently Oct 25, 2018

@robodoo robodoo added the CI 🤖 label Oct 25, 2018

addons/portal/controllers/mail.py Outdated
@@ -33,6 +34,7 @@ def _message_post_helper(res_model='', res_id=None, message='', token='', nosubs
:param string token: access token if the object's model uses some kind of public access
using tokens (usually a uuid4) to bypass access rules
:param bool nosubscribe: set False if you want the partner to be set as follower of the object when posting (default to True)
:param list attatchments: if any attachments are added to message.

This comment has been minimized.

@Xavier-Do

Xavier-Do Oct 29, 2018

Contributor

attachments

addons/portal/controllers/mail.py Outdated
@@ -28,6 +29,7 @@ def _message_post_helper(res_model='', res_id=None, message='', token='', nosubs
:param string res_model: model name of the object
:param int res_id: id of the object
:param string message: content of the message
:param list attatchments: if any attachments are added to message.

This comment has been minimized.

@Xavier-Do

Xavier-Do Oct 29, 2018

Contributor

atta(t)chments

addons/portal/controllers/mail.py Outdated
@@ -56,8 +58,11 @@ def _message_post_helper(res_model='', res_id=None, message='', token='', nosubs
raise Forbidden()
kw.pop('csrf_token', None)
kw.pop('attachment_ids', None)
if isinstance(attachments, int):

This comment has been minimized.

@Xavier-Do

Xavier-Do Oct 29, 2018

Contributor

You should move the transformation to a list in portal_chatter_post to. as you wrote in the docstring:
:param list atta(t)chments:
portal_chatter_post must ensure that _message_post_helper will receive the right parameters: a list of attachement ids.
By the way you can rename it to attachment_ids to match message_post parameter

@robodoo robodoo removed the CI 🤖 label Oct 29, 2018

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch 2 times, most recently Oct 29, 2018

@robodoo robodoo added the CI 🤖 label Oct 29, 2018

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch Oct 30, 2018

@robodoo robodoo removed the CI 🤖 label Oct 30, 2018

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch Oct 30, 2018

@robodoo robodoo added the CI 🤖 label Oct 30, 2018

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch Oct 30, 2018

@robodoo robodoo removed the CI 🤖 label Oct 30, 2018

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch Oct 30, 2018

addons/portal/controllers/mail.py Outdated
@@ -58,6 +60,7 @@ def _message_post_helper(res_model='', res_id=None, message='', token='', nosubs
kw.pop('attachment_ids', None)

This comment has been minimized.

@Xavier-Do

Xavier-Do Oct 30, 2018

Contributor

this line looks useless

@robodoo robodoo added the CI 🤖 label Oct 30, 2018

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch Oct 31, 2018

@robodoo robodoo removed the CI 🤖 label Oct 31, 2018

@pgu-odoo pgu-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch 3 times, most recently Oct 31, 2018

@robodoo robodoo added the CI 🤖 label Oct 31, 2018

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 14, 2019

pka-odoo and others added some commits Feb 21, 2019

[IMP]portal: change user image if no image is available in portal cha…
…tter

Change image of user in portal chatter to avatar image instead of placeholder if no image available.

Related to task: #1839444
[MOV]mail,portal: 1)Add portal chatter on all documents.
2)Improve chatter so that user can attach attachments from portal.

Move the common code from mail which is used for attachment at backend and frontend both in a single less and xml file.
attachment.xml and composer_attachment.less is added.

This merge is related to task #37264.
[IMP]portal: Add portal chatter + attachment for all documents.
after this commit user can attach the files from portal in chatter. Added code for file attachment in portal chatter.

This merge is related to task #37264.

@mba-odoo mba-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch from a4e216b to 2ec8ec6 Mar 19, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 19, 2019

@mba-odoo mba-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch from 2ec8ec6 to 874a9f3 Mar 19, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 19, 2019

@mba-odoo mba-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch from 874a9f3 to b802d3e Mar 19, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 19, 2019

mba-odoo added some commits Mar 18, 2019

[IMP]portal : Increase the max width of portal page content so it sho…
…uld display in one line with bottom chatter.

@mba-odoo mba-odoo force-pushed the odoo-dev:master-website-portal-chatter-pgu branch from b802d3e to 87c9458 Mar 20, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.