Skip to Content
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Sign in
  • Nederlands English (US) Español (AR)
  • Contact Us
  • Home
  • Blog
  • Jobs
  • Contact us
Cafayate.Net
  • 0
  • 0
    • Home
    • Blog
    • Jobs
    • Contact us
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Sign in
  • Contact Us

Odoo DarkroomJS Widget

  • All Blogs
  • Tech Blog
  • Odoo DarkroomJS Widget
  • March 5, 2021 by
    Administrator

    This module provides a DarkroomJS web widget for use with images fields.

    This widget will allow you to perform the following actions on images:

    • Zoom
    • Rotate
    • Crop
    • Step back in history client-side (before save)

    Usage

    To use this module, you need to:

    • Install web_widget_darkroom

    • Add the to any One2many image relation by using the darkroom widget. Options can be passed through to Darkroom using the optionskey:

      <field name="image_id" widget="darkroom"
                             options="{'minWidth': 100}" />
      

    The Odoo DarkroomJS widget passes options directly through to Darkroom, which are copied from the source below:

    // Default options
    defaults: {
      // Canvas properties (dimension, ratio, color)
      minWidth: null,
      minHeight: null,
      maxWidth: null,
      maxHeight: null,
      ratio: null,
      backgroundColor: '#fff',
    
      // Plugins options
      plugins: {},
    
      // Post-initialisation callback
      initialize: function() { /* noop */ }
    },
    

    An example implementation can be found [[https://repo.laslabs.com/projects/ODOO/repos/web/browse/web_widget_darkroom_example|in the LasLabs repo]] or [[https://github.com/laslabs/odoo-web/tree/release/9.0/web_widget_darkroom_example|on our GitHub mirror]].

    Known Issues/Roadmap

    • Plugins are not able to be added without inheriting, then redefining the widget in the registry due to JS inheritance. ** This is not scalable because there would need to be an explicit dependency chain in order to avoid registry overwrite.

    https://apps.openerp.com/apps/modules/9.0/web_widget_darkroom/

    in Tech Blog
    Hardening Ubuntu 14.04 Server

    Designed for companies

    We are a team of passionate people whose goal is to improve everyone's life through disruptive products. We build great products to solve your business problems. Our products are designed for small to medium size companies willing to optimize their performance.

    Get in touch

    Plantexel
    Pedernera
    Salta Capital 
    Argenina

    • +31 653-919-302
    • [email protected]
    Follow us
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)