Skip to content

[14.0] helpdesk_mgmt: Forward port multiple 12.0 commits#448

Closed
ypapouin wants to merge 12 commits intoOCA:14.0from
decgroupe:14.0-fw-port-12.0
Closed

[14.0] helpdesk_mgmt: Forward port multiple 12.0 commits#448
ypapouin wants to merge 12 commits intoOCA:14.0from
decgroupe:14.0-fw-port-12.0

Conversation

@ypapouin
Copy link
Copy Markdown
Contributor

See commits for details.
This is a pack multiple commits authored by @eLBati, fixed and rewritten to be compatible with Odoo 14.0.

  • Set "e-mail" channel when ticket generated from fetchmail cron task.
  • Add a list of attachments in the ticket portal view.
  • When a ticket is created by a customer with attachments, an access token is automatically generated.
  • Allow a portal user to close its ticket if the final stage is set with portal_user_can_close.
  • Sequence field added to allow kanban reordering.
  • E-mail templates are simplified, they now all use the mail.mail_notification_light layout to have a consistent design.
  • Send a notification to the partner each time the ticket stage changes.

@ypapouin ypapouin force-pushed the 14.0-fw-port-12.0 branch from 3199f4c to d4bfa67 Compare March 29, 2023 14:22
@lk-eska
Copy link
Copy Markdown

lk-eska commented Apr 13, 2023

when do we expect to merge these changes?

Copy link
Copy Markdown
Contributor

@HekkiMelody HekkiMelody left a comment

Choose a reason for hiding this comment

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

Code review

Comment on lines +101 to +103
IrAttachment = request.env["ir.attachment"]
attachment_ids = IrAttachment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what's the point of this?

Suggested change
IrAttachment = request.env["ir.attachment"]
attachment_ids = IrAttachment
attachment_ids = request.env["ir.attachment"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

IrAttachment is used in the create statement below, that's why the model is set once outside the loop


def send_partner_mail(self):
created_ticket_template = self.env.ref(
"helpdesk_mgmt.created_ticket_template", raise_if_not_found=False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This template is missing

Copy link
Copy Markdown
Contributor

@HekkiMelody HekkiMelody left a comment

Choose a reason for hiding this comment

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

Really want these changes merged.

There are some issues. For example the customer can add some attachments and see them, but there doesn't seem to be a way for the internal operator to upload attachments from the user view and show them for the customer in the portal view.

Also, I think the "created" email template should not be forcefully sent in the create method, but should be attached to the "new" state and work like every other email template.

That said, I'd rather this be merged and these issues fixes in future PRs, personally. The only thing that's blocking IMO is the missing email template for new tickets.

eLBati and others added 9 commits April 25, 2023 11:38
Forward port of 656c2d9

Note that the commit fc3905e (allow portal users to write tickets) has not been forward ported as it is not necessary
…uttons on portal

Forward port of 6eb1124 with minor fixes
- Better style
- Avoid email_cc (error "message without recipients")
- Use coherent partner/user reference
- Access button from e-mail notifications

Forward port of 98e5ef7

Please note that the commit a5041c2 (An e-mail is sent to the ticket after each create/edit) has not been forward ported because the assignment notify is done internally by odoo in `_message_auto_subscribe_followers` from `mail.thread`
…d on ticket submit

Otherwise they stay "private" and are not displayed on the portal.
@ypapouin ypapouin force-pushed the 14.0-fw-port-12.0 branch from d4bfa67 to a56b0d8 Compare April 25, 2023 09:40
@ypapouin
Copy link
Copy Markdown
Contributor Author

@aleuffre, the missing template is re-added.

About this, I tried to use the built-in way to send email notification on ticket creation by assigning helpdesk_ticket_stage_new.mail_template_id but it's not working when the ticket is created from the portal or duplicated from the backend, I've added a comment in the send_partner_mail function (It could be related to the odoo framework).

About attachments, the chatter allows the internal users to add public attachments from the backend (using Send message) and since Odoo 14.0, any users (portal/internal) can add public attachments from the portal.
The attachment list is still there as a feedback.

Also, please give me some time, I will try to increase code coverage before merging.

- `portal_user_can_close` is now set to `done` and `cancelled` stages by default
- `/ticket/close` has been replaced with `/close/ticket` to be consistent with other routes
@pedrobaeza
Copy link
Copy Markdown
Member

Too much things in one PR. This should be split by each function to be discussed and reviewed isolatedly, or there are few chances of this being merged as is.

@pedrobaeza pedrobaeza added this to the 14.0 milestone Apr 25, 2023
@ypapouin
Copy link
Copy Markdown
Contributor Author

@pedrobaeza, I understand your position but most of these commits are already merged in the 12.0 branch, its like a migration update, others one are tests.

@pedrobaeza
Copy link
Copy Markdown
Member

I use the module since 13.0, so I didn't take part on the decisions made on v12, so I'm still reluctant to approve this on batch.

@HekkiMelody
Copy link
Copy Markdown
Contributor

I also need these commits on v14. Will start opening some PRs separately if the whole thing won't be accepted.

@ypapouin
Copy link
Copy Markdown
Contributor Author

@pedrobaeza as your request, this PR has been split into multiple PRs.
So I'm closing this one.

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.

5 participants