This commit is contained in:
gsinghpal
2026-05-16 13:18:52 -04:00
parent 191a9c82be
commit 9ebf89bde2
1080 changed files with 0 additions and 1197 deletions

Binary file not shown.

View File

@@ -0,0 +1,2 @@
from . import models
from . import wizards

View File

@@ -0,0 +1,48 @@
{
'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',
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
Server action bound to documents.document so the
"Create Vendor Invoice" workflow appears in the cog/Actions
menu of the Documents kanban + list views.
We dispatch through ``action_create_invoice`` so the same
validation runs whether the user clicks the action or calls
the method programmatically.
-->
<record id="action_create_invoice_from_document" model="ir.actions.server">
<field name="name">Create Vendor Invoice (Fusion)</field>
<field name="model_id" ref="documents.model_documents_document"/>
<field name="binding_model_id" ref="documents.model_documents_document"/>
<field name="binding_view_types">list,kanban</field>
<field name="state">code</field>
<field name="code">
if records and len(records) == 1:
action = records.action_create_invoice()
else:
raise UserError(_("Select exactly one document to convert into a vendor invoice."))
</field>
</record>
</odoo>

View File

@@ -0,0 +1,107 @@
# Graph Report - /Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents (2026-04-22)
## Corpus Check
- 9 files · ~3,618 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 36 nodes · 44 edges · 11 communities detected
- Extraction: 89% EXTRACTED · 11% INFERRED · 0% AMBIGUOUS · INFERRED: 5 edges (avg confidence: 0.8)
- Token cost: 0 input · 0 output
## Community Hubs (Navigation)
- [[_COMMUNITY_Community 0|Community 0]]
- [[_COMMUNITY_Community 1|Community 1]]
- [[_COMMUNITY_Community 2|Community 2]]
- [[_COMMUNITY_Community 3|Community 3]]
- [[_COMMUNITY_Community 4|Community 4]]
- [[_COMMUNITY_Community 5|Community 5]]
- [[_COMMUNITY_Community 6|Community 6]]
- [[_COMMUNITY_Community 7|Community 7]]
- [[_COMMUNITY_Community 8|Community 8]]
- [[_COMMUNITY_Community 9|Community 9]]
- [[_COMMUNITY_Community 10|Community 10]]
## God Nodes (most connected - your core abstractions)
1. `TestDocumentToInvoice` - 11 edges
2. `AccountMove` - 3 edges
3. `DocumentsDocument` - 2 edges
4. `CreateInvoiceFromDocumentWizard` - 2 edges
5. `Tests for the documents.document <-> account.move bridge.` - 1 edges
6. `Reverse linkage from account.move back to source documents.` - 1 edges
7. `Bridge documents.document to accounting moves. Adds a Many2one link to the crea` - 1 edges
8. `Open the wizard to create a vendor invoice from this document.` - 1 edges
9. `Wizard to create a vendor invoice from a Documents document. The wizard creates` - 1 edges
## Surprising Connections (you probably didn't know these)
- None detected - all connections are within the same source files.
## Communities
### Community 0 - "Community 0"
Cohesion: 0.48
Nodes (2): TestDocumentToInvoice, TransactionCase
### Community 1 - "Community 1"
Cohesion: 0.33
Nodes (3): DocumentsDocument, Bridge documents.document to accounting moves. Adds a Many2one link to the crea, Open the wizard to create a vendor invoice from this document.
### Community 2 - "Community 2"
Cohesion: 0.4
Nodes (0):
### Community 3 - "Community 3"
Cohesion: 0.4
Nodes (2): AccountMove, Reverse linkage from account.move back to source documents.
### Community 4 - "Community 4"
Cohesion: 0.4
Nodes (2): CreateInvoiceFromDocumentWizard, Wizard to create a vendor invoice from a Documents document. The wizard creates
### Community 5 - "Community 5"
Cohesion: 0.67
Nodes (1): Tests for the documents.document <-> account.move bridge.
### Community 6 - "Community 6"
Cohesion: 1.0
Nodes (0):
### Community 7 - "Community 7"
Cohesion: 1.0
Nodes (0):
### Community 8 - "Community 8"
Cohesion: 1.0
Nodes (0):
### Community 9 - "Community 9"
Cohesion: 1.0
Nodes (0):
### Community 10 - "Community 10"
Cohesion: 1.0
Nodes (0):
## Knowledge Gaps
- **5 isolated node(s):** `Tests for the documents.document <-> account.move bridge.`, `Reverse linkage from account.move back to source documents.`, `Bridge documents.document to accounting moves. Adds a Many2one link to the crea`, `Open the wizard to create a vendor invoice from this document.`, `Wizard to create a vendor invoice from a Documents document. The wizard creates`
These have ≤1 connection - possible missing edges or undocumented components.
- **Thin community `Community 6`** (1 nodes): `__init__.py`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 7`** (1 nodes): `__init__.py`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 8`** (1 nodes): `__init__.py`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 9`** (1 nodes): `__init__.py`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 10`** (1 nodes): `__manifest__.py`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `TestDocumentToInvoice` connect `Community 0` to `Community 2`, `Community 5`?**
_High betweenness centrality (0.142) - this node is a cross-community bridge._
- **Why does `CreateInvoiceFromDocumentWizard` connect `Community 4` to `Community 2`?**
_High betweenness centrality (0.101) - this node is a cross-community bridge._
- **What connects `Tests for the documents.document <-> account.move bridge.`, `Reverse linkage from account.move back to source documents.`, `Bridge documents.document to accounting moves. Adds a Many2one link to the crea` to the rest of the system?**
_5 weakly-connected nodes found - possible documentation gaps or missing edges._

View File

@@ -0,0 +1 @@
{"nodes": [{"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py", "label": "account_move.py", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L1"}, {"id": "account_move_accountmove", "label": "AccountMove", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L6"}, {"id": "account_move_accountmove_compute_source_document_count", "label": "._compute_source_document_count()", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L21"}, {"id": "account_move_accountmove_action_open_source_documents", "label": ".action_open_source_documents()", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L25"}, {"id": "account_move_rationale_1", "label": "Reverse linkage from account.move back to source documents.", "file_type": "rationale", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L1"}], "edges": [{"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py", "target": "odoo", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L3", "weight": 1.0}, {"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py", "target": "account_move_accountmove", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L6", "weight": 1.0}, {"source": "account_move_accountmove", "target": "account_move_accountmove_compute_source_document_count", "relation": "method", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L21", "weight": 1.0}, {"source": "account_move_accountmove", "target": "account_move_accountmove_action_open_source_documents", "relation": "method", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L25", "weight": 1.0}, {"source": "account_move_rationale_1", "target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py", "relation": "rationale_for", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L1", "weight": 1.0}], "raw_calls": [{"caller_nid": "account_move_accountmove_compute_source_document_count", "callee": "len", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L23"}, {"caller_nid": "account_move_accountmove_action_open_source_documents", "callee": "ensure_one", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L26"}, {"caller_nid": "account_move_accountmove_action_open_source_documents", "callee": "_", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py", "source_location": "L29"}]}

View File

@@ -0,0 +1 @@
{"nodes": [{"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_init_py", "label": "__init__.py", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/__init__.py", "source_location": "L1"}], "edges": [{"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_init_py", "target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_init_py", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/__init__.py", "source_location": "L1", "weight": 1.0}], "raw_calls": []}

View File

@@ -0,0 +1 @@
{"nodes": [{"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_manifest_py", "label": "__manifest__.py", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/__manifest__.py", "source_location": "L1"}], "edges": [], "raw_calls": []}

View File

@@ -0,0 +1 @@
{"nodes": [{"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py", "label": "__init__.py", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/__init__.py", "source_location": "L1"}], "edges": [{"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py", "target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/__init__.py", "source_location": "L1", "weight": 1.0}, {"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py", "target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/__init__.py", "source_location": "L2", "weight": 1.0}], "raw_calls": []}

View File

@@ -0,0 +1 @@
{"nodes": [{"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py", "label": "__init__.py", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/__init__.py", "source_location": "L1"}], "edges": [{"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py", "target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/__init__.py", "source_location": "L1", "weight": 1.0}, {"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py", "target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/__init__.py", "source_location": "L2", "weight": 1.0}], "raw_calls": []}

View File

@@ -0,0 +1 @@
{"nodes": [{"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_init_py", "label": "__init__.py", "file_type": "code", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/__init__.py", "source_location": "L1"}], "edges": [{"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_init_py", "target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_init_py", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/__init__.py", "source_location": "L1", "weight": 1.0}], "raw_calls": []}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,862 @@
{
"directed": false,
"multigraph": false,
"graph": {},
"nodes": [
{
"label": "__init__.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/__init__.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py",
"community": 6,
"norm_label": "__init__.py"
},
{
"label": "__manifest__.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/__manifest__.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_manifest_py",
"community": 10,
"norm_label": "__manifest__.py"
},
{
"label": "__init__.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/__init__.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_init_py",
"community": 7,
"norm_label": "__init__.py"
},
{
"label": "test_document_to_invoice.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_test_document_to_invoice_py",
"community": 5,
"norm_label": "test_document_to_invoice.py"
},
{
"label": "TestDocumentToInvoice",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L11",
"id": "test_document_to_invoice_testdocumenttoinvoice",
"community": 0,
"norm_label": "testdocumenttoinvoice"
},
{
"label": "TransactionCase",
"file_type": "code",
"source_file": "",
"source_location": "",
"id": "transactioncase",
"community": 0,
"norm_label": "transactioncase"
},
{
"label": "setUpClass()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L14",
"id": "test_document_to_invoice_setupclass",
"community": 5,
"norm_label": "setupclass()"
},
{
"label": "._make_document()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L26",
"id": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"community": 0,
"norm_label": "._make_document()"
},
{
"label": ".test_invoice_candidate_flag_pdf()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L49",
"id": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_pdf",
"community": 0,
"norm_label": ".test_invoice_candidate_flag_pdf()"
},
{
"label": ".test_invoice_candidate_flag_image()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L53",
"id": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_image",
"community": 0,
"norm_label": ".test_invoice_candidate_flag_image()"
},
{
"label": ".test_invoice_candidate_flag_text_excluded()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L61",
"id": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_text_excluded",
"community": 0,
"norm_label": ".test_invoice_candidate_flag_text_excluded()"
},
{
"label": ".test_action_create_invoice_opens_wizard()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L69",
"id": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_opens_wizard",
"community": 2,
"norm_label": ".test_action_create_invoice_opens_wizard()"
},
{
"label": ".test_wizard_creates_invoice_and_links()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L80",
"id": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_invoice_and_links",
"community": 2,
"norm_label": ".test_wizard_creates_invoice_and_links()"
},
{
"label": ".test_action_create_invoice_already_linked_raises()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L111",
"id": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_already_linked_raises",
"community": 0,
"norm_label": ".test_action_create_invoice_already_linked_raises()"
},
{
"label": ".test_action_create_invoice_non_candidate_raises()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L121",
"id": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_non_candidate_raises",
"community": 2,
"norm_label": ".test_action_create_invoice_non_candidate_raises()"
},
{
"label": ".test_wizard_creates_credit_note()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L130",
"id": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_credit_note",
"community": 2,
"norm_label": ".test_wizard_creates_credit_note()"
},
{
"label": "Tests for the documents.document <-> account.move bridge.",
"file_type": "rationale",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L1",
"id": "test_document_to_invoice_rationale_1",
"community": 5,
"norm_label": "tests for the documents.document <-> account.move bridge."
},
{
"label": "account_move.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py",
"community": 3,
"norm_label": "account_move.py"
},
{
"label": "AccountMove",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L6",
"id": "account_move_accountmove",
"community": 3,
"norm_label": "accountmove"
},
{
"label": "._compute_source_document_count()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L21",
"id": "account_move_accountmove_compute_source_document_count",
"community": 3,
"norm_label": "._compute_source_document_count()"
},
{
"label": ".action_open_source_documents()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L25",
"id": "account_move_accountmove_action_open_source_documents",
"community": 3,
"norm_label": ".action_open_source_documents()"
},
{
"label": "Reverse linkage from account.move back to source documents.",
"file_type": "rationale",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L1",
"id": "account_move_rationale_1",
"community": 3,
"norm_label": "reverse linkage from account.move back to source documents."
},
{
"label": "documents_document.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_documents_document_py",
"community": 1,
"norm_label": "documents_document.py"
},
{
"label": "DocumentsDocument",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L21",
"id": "documents_document_documentsdocument",
"community": 1,
"norm_label": "documentsdocument"
},
{
"label": "_compute_is_invoice_candidate()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L40",
"id": "documents_document_compute_is_invoice_candidate",
"community": 1,
"norm_label": "_compute_is_invoice_candidate()"
},
{
"label": ".action_create_invoice()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L48",
"id": "documents_document_documentsdocument_action_create_invoice",
"community": 1,
"norm_label": ".action_create_invoice()"
},
{
"label": "Bridge documents.document to accounting moves. Adds a Many2one link to the crea",
"file_type": "rationale",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L1",
"id": "documents_document_rationale_1",
"community": 1,
"norm_label": "bridge documents.document to accounting moves. adds a many2one link to the crea"
},
{
"label": "Open the wizard to create a vendor invoice from this document.",
"file_type": "rationale",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L49",
"id": "documents_document_rationale_49",
"community": 1,
"norm_label": "open the wizard to create a vendor invoice from this document."
},
{
"label": "__init__.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/__init__.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py",
"community": 8,
"norm_label": "__init__.py"
},
{
"label": "__init__.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/__init__.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_init_py",
"community": 9,
"norm_label": "__init__.py"
},
{
"label": "create_invoice_from_document.py",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L1",
"id": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"community": 4,
"norm_label": "create_invoice_from_document.py"
},
{
"label": "CreateInvoiceFromDocumentWizard",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L20",
"id": "create_invoice_from_document_createinvoicefromdocumentwizard",
"community": 4,
"norm_label": "createinvoicefromdocumentwizard"
},
{
"label": "_default_journal()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L62",
"id": "create_invoice_from_document_default_journal",
"community": 4,
"norm_label": "_default_journal()"
},
{
"label": "_onchange_company_id()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L70",
"id": "create_invoice_from_document_onchange_company_id",
"community": 4,
"norm_label": "_onchange_company_id()"
},
{
"label": ".action_create_invoice()",
"file_type": "code",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L78",
"id": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice",
"community": 2,
"norm_label": ".action_create_invoice()"
},
{
"label": "Wizard to create a vendor invoice from a Documents document. The wizard creates",
"file_type": "rationale",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L1",
"id": "create_invoice_from_document_rationale_1",
"community": 4,
"norm_label": "wizard to create a vendor invoice from a documents document. the wizard creates"
}
],
"links": [
{
"relation": "imports_from",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/__init__.py",
"source_location": "L2",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py",
"_tgt": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py",
"target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_init_py",
"confidence_score": 1.0
},
{
"relation": "imports_from",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/__init__.py",
"source_location": "L1",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_init_py",
"_tgt": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_init_py",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_init_py",
"target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_init_py",
"confidence_score": 1.0
},
{
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L11",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_test_document_to_invoice_py",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_test_document_to_invoice_py",
"target": "test_document_to_invoice_testdocumenttoinvoice",
"confidence_score": 1.0
},
{
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L14",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_test_document_to_invoice_py",
"_tgt": "test_document_to_invoice_setupclass",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_test_document_to_invoice_py",
"target": "test_document_to_invoice_setupclass",
"confidence_score": 1.0
},
{
"relation": "rationale_for",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L1",
"weight": 1.0,
"_src": "test_document_to_invoice_rationale_1",
"_tgt": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_test_document_to_invoice_py",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_tests_test_document_to_invoice_py",
"target": "test_document_to_invoice_rationale_1",
"confidence_score": 1.0
},
{
"relation": "inherits",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L11",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "transactioncase",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "transactioncase",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L26",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L49",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_pdf",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_pdf",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L53",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_image",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_image",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L61",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_text_excluded",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_text_excluded",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L69",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_opens_wizard",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_opens_wizard",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L80",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_invoice_and_links",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_invoice_and_links",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L111",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_already_linked_raises",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_already_linked_raises",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L121",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_non_candidate_raises",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_non_candidate_raises",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L130",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_credit_note",
"source": "test_document_to_invoice_testdocumenttoinvoice",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_credit_note",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L50",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_pdf",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_pdf",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L54",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_image",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_image",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L62",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_text_excluded",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_invoice_candidate_flag_text_excluded",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L70",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_opens_wizard",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_opens_wizard",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L81",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_invoice_and_links",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_invoice_and_links",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L112",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_already_linked_raises",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_already_linked_raises",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L122",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_non_candidate_raises",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_non_candidate_raises",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L131",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_credit_note",
"_tgt": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"source": "test_document_to_invoice_testdocumenttoinvoice_make_document",
"target": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_credit_note",
"confidence_score": 1.0
},
{
"relation": "calls",
"confidence": "INFERRED",
"confidence_score": 0.8,
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L71",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_opens_wizard",
"_tgt": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice",
"source": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_opens_wizard",
"target": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice"
},
{
"relation": "calls",
"confidence": "INFERRED",
"confidence_score": 0.8,
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L88",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_invoice_and_links",
"_tgt": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice",
"source": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_invoice_and_links",
"target": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice"
},
{
"relation": "calls",
"confidence": "INFERRED",
"confidence_score": 0.8,
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L119",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_already_linked_raises",
"_tgt": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice",
"source": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_already_linked_raises",
"target": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice"
},
{
"relation": "calls",
"confidence": "INFERRED",
"confidence_score": 0.8,
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L128",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_non_candidate_raises",
"_tgt": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice",
"source": "test_document_to_invoice_testdocumenttoinvoice_test_action_create_invoice_non_candidate_raises",
"target": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice"
},
{
"relation": "calls",
"confidence": "INFERRED",
"confidence_score": 0.8,
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/tests/test_document_to_invoice.py",
"source_location": "L137",
"weight": 1.0,
"_src": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_credit_note",
"_tgt": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice",
"source": "test_document_to_invoice_testdocumenttoinvoice_test_wizard_creates_credit_note",
"target": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice"
},
{
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L6",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py",
"_tgt": "account_move_accountmove",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py",
"target": "account_move_accountmove",
"confidence_score": 1.0
},
{
"relation": "rationale_for",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L1",
"weight": 1.0,
"_src": "account_move_rationale_1",
"_tgt": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_account_move_py",
"target": "account_move_rationale_1",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L21",
"weight": 1.0,
"_src": "account_move_accountmove",
"_tgt": "account_move_accountmove_compute_source_document_count",
"source": "account_move_accountmove",
"target": "account_move_accountmove_compute_source_document_count",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/account_move.py",
"source_location": "L25",
"weight": 1.0,
"_src": "account_move_accountmove",
"_tgt": "account_move_accountmove_action_open_source_documents",
"source": "account_move_accountmove",
"target": "account_move_accountmove_action_open_source_documents",
"confidence_score": 1.0
},
{
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L21",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_documents_document_py",
"_tgt": "documents_document_documentsdocument",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_documents_document_py",
"target": "documents_document_documentsdocument",
"confidence_score": 1.0
},
{
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L40",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_documents_document_py",
"_tgt": "documents_document_compute_is_invoice_candidate",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_documents_document_py",
"target": "documents_document_compute_is_invoice_candidate",
"confidence_score": 1.0
},
{
"relation": "rationale_for",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L1",
"weight": 1.0,
"_src": "documents_document_rationale_1",
"_tgt": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_documents_document_py",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_documents_document_py",
"target": "documents_document_rationale_1",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L48",
"weight": 1.0,
"_src": "documents_document_documentsdocument",
"_tgt": "documents_document_documentsdocument_action_create_invoice",
"source": "documents_document_documentsdocument",
"target": "documents_document_documentsdocument_action_create_invoice",
"confidence_score": 1.0
},
{
"relation": "rationale_for",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/documents_document.py",
"source_location": "L49",
"weight": 1.0,
"_src": "documents_document_rationale_49",
"_tgt": "documents_document_documentsdocument_action_create_invoice",
"source": "documents_document_documentsdocument_action_create_invoice",
"target": "documents_document_rationale_49",
"confidence_score": 1.0
},
{
"relation": "imports_from",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/models/__init__.py",
"source_location": "L2",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py",
"_tgt": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py",
"target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_models_init_py",
"confidence_score": 1.0
},
{
"relation": "imports_from",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/__init__.py",
"source_location": "L1",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_init_py",
"_tgt": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_init_py",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_init_py",
"target": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_init_py",
"confidence_score": 1.0
},
{
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L20",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"_tgt": "create_invoice_from_document_createinvoicefromdocumentwizard",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"target": "create_invoice_from_document_createinvoicefromdocumentwizard",
"confidence_score": 1.0
},
{
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L62",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"_tgt": "create_invoice_from_document_default_journal",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"target": "create_invoice_from_document_default_journal",
"confidence_score": 1.0
},
{
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L70",
"weight": 1.0,
"_src": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"_tgt": "create_invoice_from_document_onchange_company_id",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"target": "create_invoice_from_document_onchange_company_id",
"confidence_score": 1.0
},
{
"relation": "rationale_for",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L1",
"weight": 1.0,
"_src": "create_invoice_from_document_rationale_1",
"_tgt": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"source": "users_gurpreet_github_odoo_modules_fusion_accounting_documents_wizards_create_invoice_from_document_py",
"target": "create_invoice_from_document_rationale_1",
"confidence_score": 1.0
},
{
"relation": "method",
"confidence": "EXTRACTED",
"source_file": "/Users/gurpreet/Github/Odoo-Modules/fusion_accounting_documents/wizards/create_invoice_from_document.py",
"source_location": "L78",
"weight": 1.0,
"_src": "create_invoice_from_document_createinvoicefromdocumentwizard",
"_tgt": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice",
"source": "create_invoice_from_document_createinvoicefromdocumentwizard",
"target": "create_invoice_from_document_createinvoicefromdocumentwizard_action_create_invoice",
"confidence_score": 1.0
}
],
"hyperedges": []
}

View File

@@ -0,0 +1,2 @@
from . import documents_document
from . import account_move

View File

@@ -0,0 +1,33 @@
"""Reverse linkage from account.move back to source documents."""
from odoo import _, fields, models
class AccountMove(models.Model):
_inherit = 'account.move'
source_document_ids = fields.One2many(
'documents.document',
'move_id',
string='Source Documents',
readonly=True,
help="Documents in the Documents app that were used to create this move.",
)
source_document_count = fields.Integer(
string='Source Document Count',
compute='_compute_source_document_count',
)
def _compute_source_document_count(self):
for m in self:
m.source_document_count = len(m.source_document_ids)
def action_open_source_documents(self):
self.ensure_one()
return {
'type': 'ir.actions.act_window',
'name': _('Source Documents'),
'res_model': 'documents.document',
'view_mode': 'kanban,list',
'domain': [('move_id', '=', self.id)],
}

View File

@@ -0,0 +1,71 @@
"""Bridge documents.document to accounting moves.
Adds a Many2one link to the created invoice/move, a computed
``is_invoice_candidate`` flag for PDFs/images that have not yet been
turned into a vendor bill, and the ``action_create_invoice`` entry
point used by both the form button and the server action.
"""
from odoo import _, api, fields, models
from odoo.exceptions import UserError
INVOICE_CANDIDATE_MIMETYPES = (
'application/pdf',
'image/png',
'image/jpeg',
'image/jpg',
)
class DocumentsDocument(models.Model):
_inherit = 'documents.document'
move_id = fields.Many2one(
'account.move',
string='Linked Invoice/Move',
copy=False,
ondelete='set null',
help="The accounting move this document was used to create.",
)
is_invoice_candidate = fields.Boolean(
string='Is Invoice Candidate',
compute='_compute_is_invoice_candidate',
store=True,
help="True when this document looks like a vendor bill "
"(PDF/image binary) and has not yet been linked to a move.",
)
@api.depends('mimetype', 'type', 'move_id')
def _compute_is_invoice_candidate(self):
for d in self:
d.is_invoice_candidate = (
d.type == 'binary'
and (d.mimetype or '') in INVOICE_CANDIDATE_MIMETYPES
and not d.move_id
)
def action_create_invoice(self):
"""Open the wizard to create a vendor invoice from this document."""
self.ensure_one()
if self.move_id:
raise UserError(_(
"This document is already linked to invoice %s.",
self.move_id.display_name,
))
if self.type == 'folder':
raise UserError(_(
"Folders cannot be turned into invoices."
))
if (self.mimetype or '') not in INVOICE_CANDIDATE_MIMETYPES:
raise UserError(_(
"Only PDF or image documents can be turned into invoices."
))
return {
'type': 'ir.actions.act_window',
'name': _('Create Invoice from Document'),
'res_model': 'fusion.create.invoice.from.document.wizard',
'view_mode': 'form',
'target': 'new',
'context': {'default_document_id': self.id},
}

View File

@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_fusion_create_invoice_wizard_user,fusion.create.invoice.wizard.user,model_fusion_create_invoice_from_document_wizard,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_fusion_create_invoice_wizard_user fusion.create.invoice.wizard.user model_fusion_create_invoice_from_document_wizard base.group_user 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -0,0 +1 @@
from . import test_document_to_invoice

View File

@@ -0,0 +1,140 @@
"""Tests for the documents.document <-> account.move bridge."""
import base64
from odoo.exceptions import UserError
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
@tagged('post_install', '-at_install', 'fusion_accounting_documents')
class TestDocumentToInvoice(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.vendor = cls.env['res.partner'].create({
'name': 'Test Doc Vendor',
'supplier_rank': 1,
})
cls.purchase_journal = cls.env['account.journal'].search(
[('type', '=', 'purchase'),
('company_id', '=', cls.env.company.id)],
limit=1,
)
def _make_document(self, name='Test Bill PDF',
mimetype='application/pdf',
payload=b'%PDF-fake-bill-content'):
attachment = self.env['ir.attachment'].create({
'name': name,
'datas': base64.b64encode(payload),
'mimetype': mimetype,
})
Document = self.env['documents.document']
doc_vals = {
'name': name,
'attachment_id': attachment.id,
'mimetype': mimetype,
'type': 'binary',
}
if 'folder_id' in Document._fields:
folder = Document.search(
[('type', '=', 'folder')], limit=1,
)
if folder:
doc_vals['folder_id'] = folder.id
return Document.create(doc_vals)
def test_invoice_candidate_flag_pdf(self):
doc = self._make_document()
self.assertTrue(doc.is_invoice_candidate)
def test_invoice_candidate_flag_image(self):
doc = self._make_document(
name='scan.png',
mimetype='image/png',
payload=b'\x89PNG\r\n\x1a\nfake',
)
self.assertTrue(doc.is_invoice_candidate)
def test_invoice_candidate_flag_text_excluded(self):
doc = self._make_document(
name='note.txt',
mimetype='text/plain',
payload=b'just a note',
)
self.assertFalse(doc.is_invoice_candidate)
def test_action_create_invoice_opens_wizard(self):
doc = self._make_document()
action = doc.action_create_invoice()
self.assertEqual(action['type'], 'ir.actions.act_window')
self.assertEqual(
action['res_model'],
'fusion.create.invoice.from.document.wizard',
)
self.assertEqual(action['target'], 'new')
self.assertEqual(action['context']['default_document_id'], doc.id)
def test_wizard_creates_invoice_and_links(self):
doc = self._make_document()
wizard = self.env['fusion.create.invoice.from.document.wizard'].create({
'document_id': doc.id,
'partner_id': self.vendor.id,
'move_type': 'in_invoice',
})
self.assertTrue(wizard.journal_id, "Default journal should resolve")
action = wizard.action_create_invoice()
self.assertEqual(action['res_model'], 'account.move')
move = self.env['account.move'].browse(action['res_id'])
self.assertEqual(move.move_type, 'in_invoice')
self.assertEqual(move.partner_id, self.vendor)
self.assertEqual(doc.move_id, move)
self.assertFalse(doc.is_invoice_candidate,
"Linked docs should no longer be candidates")
self.assertEqual(move.source_document_count, 1)
self.assertIn(doc, move.source_document_ids)
attachments = self.env['ir.attachment'].search([
('res_model', '=', 'account.move'),
('res_id', '=', move.id),
])
self.assertTrue(
attachments,
"An attachment copy should land on the new move",
)
def test_action_create_invoice_already_linked_raises(self):
doc = self._make_document()
existing_move = self.env['account.move'].create({
'move_type': 'in_invoice',
'partner_id': self.vendor.id,
})
doc.move_id = existing_move.id
with self.assertRaises(UserError):
doc.action_create_invoice()
def test_action_create_invoice_non_candidate_raises(self):
doc = self._make_document(
name='note.txt',
mimetype='text/plain',
payload=b'hello',
)
with self.assertRaises(UserError):
doc.action_create_invoice()
def test_wizard_creates_credit_note(self):
doc = self._make_document(name='credit-note.pdf')
wizard = self.env['fusion.create.invoice.from.document.wizard'].create({
'document_id': doc.id,
'partner_id': self.vendor.id,
'move_type': 'in_refund',
})
action = wizard.action_create_invoice()
move = self.env['account.move'].browse(action['res_id'])
self.assertEqual(move.move_type, 'in_refund')
self.assertEqual(doc.move_id, move)

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_move_form_inherit_fusion_documents" model="ir.ui.view">
<field name="name">account.move.form.inherit.fusion.documents</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button"
type="object"
name="action_open_source_documents"
icon="fa-file-text-o"
invisible="source_document_count == 0">
<field name="source_document_count"
widget="statinfo"
string="Source Docs"/>
</button>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
The Documents app does not ship a regular form view for
documents.document; editing happens in the side panel of the
kanban/list views. We therefore add the new fields to the
kanban + list views and rely on a server action (defined in
data/server_actions_data.xml) to expose the "Create Invoice"
workflow from the Actions menu.
-->
<record id="view_documents_document_kanban_inherit_fusion_acc"
model="ir.ui.view">
<field name="name">documents.document.kanban.inherit.fusion.acc</field>
<field name="model">documents.document</field>
<field name="inherit_id" ref="documents.document_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="is_invoice_candidate"/>
<field name="move_id"/>
</xpath>
</field>
</record>
<record id="view_documents_document_list_inherit_fusion_acc"
model="ir.ui.view">
<field name="name">documents.document.list.inherit.fusion.acc</field>
<field name="model">documents.document</field>
<field name="inherit_id" ref="documents.documents_view_list_main"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="is_invoice_candidate" optional="hide"/>
<field name="move_id"
string="Linked Invoice"
optional="hide"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
from . import create_invoice_from_document

View File

@@ -0,0 +1,132 @@
"""Wizard to create a vendor invoice from a Documents document.
The wizard creates an empty draft ``account.move`` of the chosen
move type, copies the document's binary attachment onto the new
move, posts a chatter note linking back to the source document,
and finally stores the move on ``documents.document.move_id`` so
the source no longer appears as an invoice candidate.
"""
from odoo import _, api, fields, models
from odoo.exceptions import UserError
MOVE_TYPE_LABELS = {
'in_invoice': _('Vendor Bill'),
'in_refund': _('Vendor Credit Note'),
}
class CreateInvoiceFromDocumentWizard(models.TransientModel):
_name = 'fusion.create.invoice.from.document.wizard'
_description = 'Create Vendor Invoice from Document'
document_id = fields.Many2one(
'documents.document',
string='Source Document',
required=True,
readonly=True,
ondelete='cascade',
)
document_name = fields.Char(related='document_id.name', readonly=True)
document_mimetype = fields.Char(related='document_id.mimetype', readonly=True)
partner_id = fields.Many2one(
'res.partner',
string='Vendor',
domain="[('supplier_rank', '>', 0)]",
)
move_type = fields.Selection(
[
('in_invoice', 'Vendor Bill'),
('in_refund', 'Vendor Credit Note'),
],
string='Type',
default='in_invoice',
required=True,
)
company_id = fields.Many2one(
'res.company',
string='Company',
default=lambda self: self.env.company,
required=True,
)
journal_id = fields.Many2one(
'account.journal',
string='Journal',
domain="[('type', '=', 'purchase'), ('company_id', '=', company_id)]",
default=lambda self: self._default_journal(),
)
@api.model
def _default_journal(self):
return self.env['account.journal'].search(
[('type', '=', 'purchase'),
('company_id', '=', self.env.company.id)],
limit=1,
)
@api.onchange('company_id')
def _onchange_company_id(self):
if self.journal_id and self.journal_id.company_id != self.company_id:
self.journal_id = self.env['account.journal'].search(
[('type', '=', 'purchase'),
('company_id', '=', self.company_id.id)],
limit=1,
)
def action_create_invoice(self):
self.ensure_one()
if not self.document_id:
raise UserError(_("No document selected."))
if self.document_id.move_id:
raise UserError(_(
"Document %(doc)s is already linked to invoice %(inv)s.",
doc=self.document_id.display_name,
inv=self.document_id.move_id.display_name,
))
if not self.journal_id:
raise UserError(_(
"No purchase journal configured for company %s.",
self.company_id.display_name,
))
move_vals = {
'move_type': self.move_type,
'journal_id': self.journal_id.id,
'company_id': self.company_id.id,
}
if self.partner_id:
move_vals['partner_id'] = self.partner_id.id
move = self.env['account.move'].create(move_vals)
attachment = self.document_id.attachment_id
if attachment:
attachment_copy = attachment.copy({
'res_model': 'account.move',
'res_id': move.id,
})
move.message_post(
body=_(
"Created from Documents source: <strong>%s</strong>",
self.document_id.name,
),
attachment_ids=[attachment_copy.id],
)
else:
move.message_post(body=_(
"Created from Documents source: <strong>%s</strong> "
"(no attachment to copy).",
self.document_id.name,
))
self.document_id.move_id = move.id
return {
'type': 'ir.actions.act_window',
'name': MOVE_TYPE_LABELS.get(self.move_type, _('Invoice')),
'res_model': 'account.move',
'view_mode': 'form',
'res_id': move.id,
}

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_create_invoice_from_document_wizard_form" model="ir.ui.view">
<field name="name">fusion.create.invoice.from.document.wizard.form</field>
<field name="model">fusion.create.invoice.from.document.wizard</field>
<field name="arch" type="xml">
<form string="Create Invoice from Document">
<sheet>
<group>
<field name="document_id" invisible="1"/>
<field name="document_name" readonly="1"/>
<field name="document_mimetype" readonly="1"/>
</group>
<group>
<field name="move_type"/>
<field name="partner_id" options="{'no_create': True}"/>
<field name="company_id"
groups="base.group_multi_company"
options="{'no_create': True}"/>
<field name="journal_id" options="{'no_create': True}"/>
</group>
</sheet>
<footer>
<button name="action_create_invoice"
string="Create Invoice"
type="object"
class="btn-primary"
data-hotkey="q"/>
<button string="Cancel"
class="btn-secondary"
special="cancel"
data-hotkey="x"/>
</footer>
</form>
</field>
</record>
</odoo>