sign_sequence_field/README.md

32 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Sign Sequence Field
Add a Sequence field type to Odoo Sign templates to automatically generate numbers upon document completion.
## Features
- **New Field Type**: Adds a "Sequence" field to the Sign template editor toolbar.
- **Auto-Generation**: Automatically generates the next sequence number from a linked `ir.sequence` when all signers have completed the document.
- **Live Editing**: Edit Sequence Prefix, Suffix, Padding, and Next Number directly from the template editor sidebar.
- **Dynamic Positioning**: Place the sequence number anywhere on your document just like any other sign field.
## Usage
1. **Edit a Template**: Go to Sign -> Templates and open a template for editing.
2. **Drag & Drop**: Drag the "Sequence" field from the left toolbar onto your document.
3. **Configure**: Click on the sequence field to open its configuration popover:
- Select an existing **Sequence** record.
- (Optional) Modify the **Prefix**, **Suffix**, **Padding**, or **Next Number**.
4. **Save**: Save the template.
5. **Sign**: When a document created from this template is fully signed, the sequence number will be generated and stamped onto the final PDF.
## Technical Details
- **Module Name**: `sign_sequence_field`
- **Dependency**: `sign` (Enterprise)
- **Odoo Version**: 19.0
- **Authors**: Suherdy Yacob
### Technical Notes & Bug Fixes
- **Trailing Whitespace Patch**: Custom templates injected into the Sign module canvas can sometimes incur trailing QWeb whitespace `Text` nodes. This crashed Odoos native `target.lastChild` reference when opening templates or dragging new fields. This module implements frontend Javascript patches (`sign_backend_patch.js`) over Odoo's native `insertAdjacentHTML` method to instantly trim whitespace nodes on injection. This ensures robust reliability across Odoo updates without touching core source code.