Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Accounting
  3. Related fields for purchases and sales v 19.0
  4. Sales Conditions FAQ

Related fields for purchases and sales

by Ganemo https://www.ganemo.co
Odoo

$ 79.00

v 19.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
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
LicenseOPL-1
Websitehttps://www.ganemo.co
You bought this module and need support? Click here!
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
LicenseOPL-1
Websitehttps://www.ganemo.co
  • Description
  • License

Technical Specification for AI & LLM

This Odoo module 'invoice_type_document_extension' extends 'invoice_type_document' and 'l10n_pe_delivery_note_20'. It automates the assignment of Document Types (account.document.type) and Document Series in Purchase Invoices (account.move) and Stock Pickings (stock.picking). Key features: - Auto-selects document type based on partner or journal configuration. - Propagates document series from Purchase Orders to Invoices. - Validates required document fields for Peruvian Localization. Compatible with Odoo 19 (Enterprise, Odoo.SH, Ganemo Online). Multi-language support for English and Spanish included.

Enterprise (Odoo.SH, Ganemo Online or Ganemo.SH)
English & Spanish Included

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)
  1. Create a Purchase Order. The "Document Type" field may appear if a partner default is set.
  2. Confirm the Order.
  3. 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.
  4. 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
  1. Create a Sales Order.
  2. 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.
  3. 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:

  1. Go to the Transfers list view.
  2. Select the records you want to update.
  3. Click on Action > Actualizar datos factura.
Important Condition: This action is non-destructive. It will ONLY update records where the Document Type, Series, or Number fields are EMPTY. It will NOT overwrite existing data to prevent accidental loss of manual edits.

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:

1st Priority
Localization Field (l10n_latam_document_number): The official electronic document number (e.g., F001-4455). This is the standard for compliant accounting.
2nd Priority
Vendor Reference (ref): If the localization field is empty, it falls back to the manual "Bill Reference" field.
3rd Priority
Internal Name (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.

English Spanish

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.

QR WhatsApp

Official WhatsApp

Fastest response time.

COPY
LINK
https://wa.me/18286726150

+1 (828) 672-6150

QR Sales Email

Sales Email

For commercial inquiries.

COPY
ADDR
leads@ganemo.com

leads@ganemo.com

QR Book Demo

Book a Demo

Let's explore your needs.

COPY
LINK
ganemo.co/appointment/5

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

  1. Create a Purchase Order for a Vendor with a default Document Type (e.g., Factura).
  2. Confirm the Order and click Create Bill.
  3. Verify: The created Bill has 'Factura' pre-selected.
  4. Verify: Enter a valid Series-Number (e.g., F001-445566). The system accepts it.
  5. 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

  1. Go to Contacts and set 'Guía de Remisión Remitente' as default for Partner X.
  2. Create a Delivery Order for Partner X.
  3. Verify: The Document Type automatically switches to 'Guía de Remisión Remitente'.
  4. 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:

  1. Case A (Localization): Create a Bill with l10n_latam_document_number = 'F001-999'. The Receipt should inherit 'F001' and '999'.
  2. Case B (Ref): Create a Bill with NO localization number but ref = 'INV-002'. The Receipt should inherit 'INV' and '002'.
  3. 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

  1. Select multiple Stock Picking records in list view that have empty Document fields.
  2. Action > Actualizar datos factura.
  3. Verify: All selected records attempt to fetch data from their related orders/invoices.

Scenario 5: Multi-Company / Non-Peruvian

  1. Switch to a Company with Country != Peru (e.g., US Company).
  2. Open a Stock Picking.
  3. Verify: The 'Transfer Document Type', 'Series', and 'Number' fields are INVISIBLE.

Scenario 6: Sales Auto-complete Logic

  1. Create a Sales Order and Confirm it (Delivery Created).
  2. Create the Invoice (Draft). Set the Document Type (e.g., Factura).
  3. Post the Invoice. It generates a Name (e.g., F001-0021).
  4. Verify: Go back to the Delivery Order (Transfer).
  5. The Document Type, Series (F001), and Number (0021) must be auto-filled from the Invoice Name.

Scenario 7: Trigger Timing & Updates

  1. Modify Source: Go to the Invoice from Scenario 6. Reset to Draft, change the Number to 'F001-9999', and Post again.
  2. Verify Automatic: Check the Transfer. It should automatically update to '9999'.
  3. Manual Action Test: Manually clear the fields in the Transfer.
  4. Run Action > Actualizar datos factura.
  5. 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.

QR WhatsApp
Official WhatsApp

Fastest response time.

COPY
LINK
https://wa.me/18286726150

+1 (828) 672-6150

QR Sales Email
Sales Email

For commercial inquiries.

COPY
ADDR
leads@ganemo.com
QR Book Demo
Book a Demo

Let's explore your needs.

COPY
LINK
ganemo.co/appointment/5

Technical Support

Existing customers regarding module functionality.

QR Technical Support
Help Desk

Exclusive channel for technical assistance and bug reports.

COPY
ADDR
ayuda@ganemo.com
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

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with