Skip to content

Get Started

1. Install the module

roots_hemms_signature depends on three already-installed modules:

Dep From Purpose
sign_oca addons/oca/sign_oca (vendored Q4.1) The signing engine
roots_hemms_asset_inspection Layer 3 Inspection bridge target
roots_hemms_service_contracts Layer 3 Contract bridge target

Install via Apps → search "Roots HEMMS — e-Signature Bridge" → Activate.

On a fresh DB, you can install with the Demo data checkbox to also get the 2 pre-built sign templates (inspection + contract).

2. Verify the 4 seeded roles

Go to Sign → Settings → Roles. You should see 4 records seeded by this module:

Role EN/TH label Partner resolution
role_committee_chair Committee Chair (ประธานกรรมการ) Expression {{object.chair_id.partner_id.id}}
role_committee_member Committee Member (กรรมการ) Empty — bridge sets explicitly
role_hospital_signer Hospital Authorized Signer (ผู้มีอำนาจลงนาม) Empty — bridge sets explicitly
role_vendor_signer Vendor (ผู้รับเหมา) Expression {{object.partner_id.id}}

Plus the 2 default OCA roles (Customer, Employee) that ship with sign_oca itself.

3. Walk through your first inspection sign-off

You'll need a submitted inspection with a chair + 2 committee members each linked to an Odoo user. The bridge resolves partners via employee.user_id.partner_id, so an employee without a user account will fail at "Send for Signature" time with a clear error message.

Setup (one-time)

  1. Three employees with users. Go to Employees, ensure your committee members each have Related User set on their HR record. Create res.users accounts first if needed.

  2. Inspection committee group. Add your committee employees' users to the group Inspection Committee Member (roots_hemms_asset_inspection.group_hemms_inspection_committee). This isn't strictly required for signing — the bridge does the work via sudo() — but it gives the committee read access to the inspection itself.

Sign the inspection

  1. Open an inspection (Maintenance → Annual Inspection)
  2. Set Chair + Member 1 + Member 2; Start → fill conditions → Submit
  3. After Submit, a Send for Signature button appears in the header
  4. Click it. A new sign.oca.request form opens with:
  5. The rendered ปจป. PDF as the request payload
  6. 3 signers (chair + 2 members) with their partners auto-resolved
  7. State: Draft

  8. Click Configure Document if you want to drag signature fields onto the PDF preview (optional — the request can complete without any placed fields; the upstream signers just record their signed_on timestamps and the audit trail).

  9. Click Send. Each committee member sees a 📝 pencil icon in their systray; clicking it opens the request → click Sign → draw their signature in the canvas → submit.

  10. When the 3rd signer completes, the Q4.5 hook fires:

  11. inspection.roots_signed_pdf is populated with the composited PDF
  12. A chatter message lands on the inspection: "✅ Document signed by all parties — see attached AI-2026-00001-signed.pdf"
  13. The inspection's state stays submitted (no auto-advance, per OQ3/OQ2 locked design)

  14. Print the ปจป. report. The signature footer now carries the green "✅ ลงนามดิจิทัลครบถ้วน (Digitally Signed)" stamp pointing to the attached signed PDF in chatter.

4. Next steps

  • See Workflows for the contract signing flow
  • See Configuration for role customization and template field placement via the OCA Configure UI