Files
Odoo-Modules/fusion_accounting_documents/__manifest__.py
gsinghpal 71f39c8d33 feat(fusion_accounting_documents): Documents app <-> invoice bridge
Replaces Enterprise's documents_account with a Fusion-native bridge.
When a PDF/image lands in the Documents app, users can convert it
into a draft vendor bill via a wizard that copies the document's
binary onto the new account.move and posts a chatter note linking
back to the source document.

Adds:
- documents.document.move_id (Many2one to the linked invoice)
- documents.document.is_invoice_candidate (computed; True for
  unlinked PDF/image binaries)
- documents.document.action_create_invoice() opens the wizard
- account.move.source_document_ids reverse linkage + statinfo button
- fusion.create.invoice.from.document.wizard (TransientModel + form)
- ir.actions.server bound to documents.document so the workflow
  appears in the kanban/list Actions menu (the Documents app has
  no regular form view to inherit from in v19)

The wizard:
- defaults to the company's first purchase journal
- supports vendor bill or vendor credit note
- copies the source attachment onto the new move
- posts a chatter note linking back
- marks the document linked so it stops appearing as a candidate

Auto-installs when documents + fusion_accounting_core are both
present. 8 unit tests cover the candidate flag, wizard happy path,
attachment copy, reverse linkage, already-linked guard, non-PDF
guard, and credit-note creation.

Made-with: Cursor
2026-04-20 00:34:50 -04:00

49 lines
1.8 KiB
Python

{
'name': 'Fusion Accounting — Documents Bridge',
'version': '19.0.1.0.0',
'category': 'Accounting/Accounting',
'summary': 'Bridges the Documents app to Accounting: route scanned bills into vendor invoices.',
'description': """
Fusion Accounting — Documents Bridge
====================================
A Fusion-native replacement for Enterprise's ``documents_account`` module.
Adds:
- ``documents.document.move_id`` — Many2one to the linked accounting move.
- ``documents.document.is_invoice_candidate`` — computed flag for PDFs/images
not yet linked to a move.
- ``documents.document.action_create_invoice()`` — opens a wizard that
creates a draft vendor bill and copies the document's binary as an
attachment on the new ``account.move``.
- ``account.move.source_document_ids`` — reverse linkage with a stat button
on the invoice form.
- A ``fusion.create.invoice.from.document.wizard`` model + form view.
- A server action bound to ``documents.document`` so the workflow is
reachable from the Documents Actions menu (the Documents app uses
kanban/list views without a regular form view to inherit from).
Auto-installs when ``documents`` and ``fusion_accounting_core`` are both
present.
""",
'author': 'Nexa Systems Inc.',
'license': 'LGPL-3',
'depends': [
'fusion_accounting_core',
'account',
'documents',
],
'data': [
'security/ir.model.access.csv',
'wizards/create_invoice_from_document_views.xml',
'views/documents_document_views.xml',
'views/account_move_views.xml',
'data/server_actions_data.xml',
],
'auto_install': ['documents', 'fusion_accounting_core'],
'installable': True,
'application': False,
'icon': '/fusion_accounting_documents/static/description/icon.png',
}