Skip to Content
Menu
v 18.0 Third Party
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 39
Technical Name link_handler_enhance
LicenseAGPL-3
Websitehttps://github.com/Alexmalab/VesselManagementSystem/vessel_finder
You bought this module and need support? Click here!

Link Handler Enhance

Alpha license author repo

Description

Added 2 attributes support to url link a tag:

  • data-oe-view-id: specify which view id used;
  • data-oe-action-id: specify which action id used, now support for access action by id;

Explanation:

If you want to send an im message within sale orders with link, you may use _get_html_link method:

links = (
     record._get_html_link(title=record.name)
     for record in self
)
message_body = Markup("Order(s) %s need to check.") % Markup(", ".join(map(str, links)))

channel.message_post(
    author_id=...,
    body=message_body,
    message_type='comment',
    subtype_xmlid='mail.mt_comment'
)

Supposing you have a custom view inherited(using primary mode) by the default view of the model, for example an independent form view for sale.order,

if you are using the method above, it will always use the default form view id, specifically the default action id,

But you want the recipient open the order with specific customized view you may use this module by the following usage;

Use data-oe-view-id to specify which view you want one to open this record.

view_id = self.env.ref('module.view_xxx_custom_form').id
links = (
    Markup("<a href=# data-oe-model='%s' data-oe-id='%s' data-oe-view-id='%s'>%s</a>") % (
        record._name, record.id, view_id, record.name)
    for record in self
)
im_msg = Markup("You have been assigned to do your job for this order: %s") % Markup(
            ", ".join(map(str, links)))

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Credits

Authors

  • Alexandre Ma

Contributors

The copyright of this module belongs to Alexandre Ma

License

  • license

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.