| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) • Invoicing (account) • Purchase (purchase) |
| Lines of code | 93 |
| Technical Name |
invoice_type_document_extension |
| License | OPL-1 |
| Website | https://www.ganemo.co |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) • Invoicing (account) • Purchase (purchase) |
| Lines of code | 93 |
| Technical Name |
invoice_type_document_extension |
| License | OPL-1 |
| Website | https://www.ganemo.co |
Document Automation
Auto-Fill Types & Series for Invoices/Stock
Eliminate manual entry errors. Automatically assign the correct Document Types and Series for your Purchases and Transfers based on smart defaults.
What We're Solving
----------------
Smart Defaults
Stop selecting the same Document Type manually every time. The system learns from your configuration and automatically populates the correct type (e.g., Invoice, Bill, Delivery Note) when creating records.
Series Consistency
Ensure your Series numbers match the document type. The module restricts valid series choices, preventing mismatches that could cause compliance issues with tax authorities.
Stock & Invoice Link
Seamlessly pass document information from Purchase Orders to Invoices and Stock Pickings. No more re-typing data that already exists in the system.
Localization Ready
Built to support localization requirements (like Peru's SUNAT), ensuring that the mandatory document types and series are always present and correct.
Setup & User Manual
Step-by-Step Implementation Guide
1. Configuration
Prepare the system for automation:
A. Define Document Types
Go to Accounting > Configuration > Document Types. Ensure your required types (e.g., '01' Factura, '03' Boleta, '09' Guía de Remisión) are created and active. This is the foundation for all validations.B. Configure Partners (Optional)
Go to Contacts, open a Partner, and navigate to the Accounting tab. Set a default Document Type. This is crucial for frequent vendors or customers where the document type is always the same.C. Check Journal Settings
Go to Accounting > Configuration > Journals. For Purchase/Sale journals, verify the "Use Documents" setting if available (depending on localization). This ensures the journal is ready to accept document types.2. Operational Workflow
Purchase Flow (Automatic)
- Create a Purchase Order. The "Document Type" field may appear if a partner default is set.
- Confirm the Order.
- Receipts (Stock Picking): The system auto-generates the
Receipt.
- Open the Receipt.
- Notice the Document Type is pre-filled.
- Enter the Series and Number provided by the vendor.
- Validation prevents mismatching series formats.
- Vendor Bills: Click "Create Bill" from the PO.
- The Document Type inherits from the PO/Partner.
- Enter the Document Number (e.g., F001-12345). The system splits this into Series and Number automatically.
Sales Flow
- Create a Sales Order.
- Delivery: The generated Delivery Order will default to using the Sales Order Name as the document number if no specific Series is configured, ensuring traceability.
- If you need a specific Guía de Remisión series, select it manually in the picking before validation.
Bulk Update (Server Action)
If you have historical records or transfers that were created before the invoice was finalized, you can trigger a manual update:
- Go to the Transfers list view.
- Select the records you want to update.
- Click on Action > Actualizar datos factura.
3. Technical Functional Logic
Understanding the algorithm behind the automation:
A. Triggers (When does it happen?)
The system constantly monitors the link between Stock Picking (Transfer) and Orders (Purchase/Sale). The auto-complete logic is triggered in two scenarios:
- Automatic Trigger: When an Invoice linked to the Purchase/Sales Order is created or its Reference/Name is modified. The system detects the change via standard Odoo dependencies and pushes the new data to the Transfer.
- Manual Trigger: Using the "Actualizar datos factura" Server Action. This forces the system to re-evaluate the logic on demand, useful for historical data correction or when the automatic trigger was missed (e.g., data import).
B. Purchase Priority Algorithm
For Purchase Transfers (Receipts), the system must decide which "Document Number" to use from the Vendor Bill. It follows this strict priority order:
l10n_latam_document_number): The official electronic document
number (e.g., F001-4455). This is the standard for compliant accounting.
ref): If the localization
field is empty, it falls back to the manual "Bill Reference" field.name): As a last resort, it
uses the Odoo internal sequence (e.g., BILL/2024/0001).C. Sales Logic (Delivery Orders)
For Sales Transfers (Delivery Orders), the logic is straightforward to ensure consistency with the issued Invoice:
- Source: It strictly uses the Invoice Name
(
name). - Format Required: The Invoice Name must contain a hyphen (e.g., F001-0021) to be successfully split into Series and Number.
- Document Type: Inherited directly from the Invoice's Document Type field.
Global Ready | Multi-Language Support
This module is fully translated into English and Spanish (en_US, es_ES, es_PE, es_MX), ensuring a professional experience for international organizations.
Why Choose Ganemo?
----------------
Ganemo is the world's leading Odoo App developer and a multi-award-winning Gold Partner. For over 5 years, we have been recognized as the #1 seller of high-quality apps on the Odoo App Store. Trusted as the "Best Partner" in USA, Mexico, Chile, Spain, Colombia, Ecuador, and Peru, we deliver robust, secure, and localization-compliant solutions for global businesses.
Get a Quote & Resolve Commercial Doubts
Join thousands of satisfied clients on Odoo. Contact our sales team directly.
Official WhatsApp
Fastest response time.
LINK
+1 (828) 672-6150
Book a Demo
Let's explore your needs.
LINK
Schedule Meeting
Need More? We Do It All
Professional Odoo Services
ERP Implementation
Transform your business with a full Odoo implementation. We analyze, configure, and train your team to maximize productivity. From Accounting to Inventory, we handle the complexity so you can focus on growth.
Module Dev & Migration
Need a custom feature? Or stuck on an older version? We develop high-performance custom modules and migrate your existing code to Odoo 19 with zero data loss. Expert developers at your service.
QA / User Testing Scenarios
Enterprise Validation Plan
Scenario 1: Standard Invoice Generation
- Create a Purchase Order for a Vendor with a default Document Type (e.g., Factura).
- Confirm the Order and click Create Bill.
- Verify: The created Bill has 'Factura' pre-selected.
- Verify: Enter a valid Series-Number (e.g., F001-445566). The system accepts it.
- Negative Test: Enter an invalid Series (e.g., 0001-123). The system should raise a validation error if the type requires a letter.
Scenario 2: Stock Transfers & Partner Defaults
- Go to Contacts and set 'Guía de Remisión Remitente' as default for Partner X.
- Create a Delivery Order for Partner X.
- Verify: The Document Type automatically switches to 'Guía de Remisión Remitente'.
- Verify: The Series/Number fields are visible and editable.
Scenario 3: Purchase Logic Priority (New Feature)
Verify how the system extracts the Transfer ID from invoice fields:
- Case A (Localization): Create a Bill with
l10n_latam_document_number= 'F001-999'. The Receipt should inherit 'F001' and '999'. - Case B (Ref): Create a Bill with NO localization number but
ref= 'INV-002'. The Receipt should inherit 'INV' and '002'. - Case C (Name): Create a Bill with no Ref, but name 'BILL-003'. The Receipt should inherit 'BILL' and '003'.
Scenario 4: Bulk Update Server Action
- Select multiple Stock Picking records in list view that have empty Document fields.
- Action > Actualizar datos factura.
- Verify: All selected records attempt to fetch data from their related orders/invoices.
Scenario 5: Multi-Company / Non-Peruvian
- Switch to a Company with Country != Peru (e.g., US Company).
- Open a Stock Picking.
- Verify: The 'Transfer Document Type', 'Series', and 'Number' fields are INVISIBLE.
Scenario 6: Sales Auto-complete Logic
- Create a Sales Order and Confirm it (Delivery Created).
- Create the Invoice (Draft). Set the Document Type (e.g., Factura).
- Post the Invoice. It generates a Name (e.g., F001-0021).
- Verify: Go back to the Delivery Order (Transfer).
- The Document Type, Series (F001), and Number (0021) must be auto-filled from the Invoice Name.
Scenario 7: Trigger Timing & Updates
- Modify Source: Go to the Invoice from Scenario 6. Reset to Draft, change the Number to 'F001-9999', and Post again.
- Verify Automatic: Check the Transfer. It should automatically update to '9999'.
- Manual Action Test: Manually clear the fields in the Transfer.
- Run Action > Actualizar datos factura.
- Verify Manual: The fields are re-populated correctly.
FAQ & Troubleshooting
Common Resolutions
Why can't I see the Document fields?
Reason: The fields are hidden if the Company's Country is not set to Peru (PE).
Fix: Go to Settings > Companies and ensure the Country is set to 'Peru'.
Series/Number not updating from Invoice?
Reason: The Invoice might not be posted, or the fields are empty.
Fix: Ensure the Vendor Bill has a valid 'Document Number' (with valid format like F001-123) and 'Document Type' set. Then use "Actualizar datos factura".
Is 'l10n_pe_delivery_note_20' required?
No. We have optimized the module to run independently of the full delivery note suite. It only requires the standard 'l10n_latam_invoice_document' which is included in standard Odoo enterprise.
Can I use this for non-Peruvian companies?
Yes, but... The fields will be hidden by default. If you need this functionality for other countries, you would need to extend the view to remove the 'country_code' check.
Commercial & Sales
For inquiries about licenses, demos, or partnerships.
Official WhatsApp
Fastest response time.
LINK
+1 (828) 672-6150
Book a Demo
Let's explore your needs.
LINK
Technical Support
Existing customers regarding module functionality.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module