diff --git a/README.md b/README.md new file mode 100644 index 0000000..25d390b --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# Sign Image Field + +Add an Image field type to Odoo Sign templates to allow users to securely attach/upload images into documents. + +## Features + +- **New Field Type**: Adds an "Image" field to the Sign template editor toolbar. +- **Image Upload Integration**: Allows signers to click the field and upload local images (JPEG, PNG, GIF) directly onto the document. +- **Dynamic Positioning**: Place the image field anywhere on your document just like any other sign field. +- **Data Extensibility**: Integrates securely with Odoo's core `sign.request.item.value` models to retrieve images directly inside signed PDFs. + +## Usage + +1. **Edit a Template**: Go to Sign -> Templates and open a template for editing. +2. **Drag & Drop**: Drag the "Image" field from the left toolbar onto your document. +3. **Configure**: Click on the image field to label it appropriately. +4. **Save**: Save the template and send the sign request. +5. **Sign**: The recipient can click on the image box to browse their system for an image to upload. + +## Technical Details + +- **Module Name**: `sign_image_field` +- **Dependency**: `sign` (Enterprise) +- **Odoo Version**: 19.0 +- **Authors**: Suherdy Yacob + +### Technical Notes & Bug Fixes + +- **Trailing Whitespace Patch (`PDFIframe` crash)**: Custom template components injected into the Sign module canvas can sometimes incur trailing QWeb whitespace `Text` nodes. This causes Odoo’s native JS to crash on `target.lastChild` reference when opening documents. This module implements a frontend Javascript patch (`sign_image_upload.js`) wrapping Odoo's native `insertAdjacentHTML` method to instantly trim whitespace nodes upon injection. This ensures robust application stability without diverging core Odoo source code.