Skip to main content

Dynamic rules for account, product and payment terms mapping

Project description

Account Dynamic Rules

Overview

Allows to define dynamic rules to set Account, Product or Payment Terms on invoices based on Partner and Product criteria.

Features

  • Define rules matching by Partner, Product, and Payment Mode.
  • Automatically update Invoice Line (Account, Product) and Invoice (Payment Term) when a match is found.
  • Works for lines created via UI or API (e.g. n8n).

Configuration

Go to Accounting > Configuration > Account Dynamic Rules.

Defining Rules (Best Practices)

The engine evaluates rules by Priority (Sequence). The first matching rule wins.

1. Wildcards (Comodines)

You can leave fields empty to act as "Wildcards".

  • Empty Partner: Applies to ANY Partner.
  • Empty Product: Applies to ANY Product.

Example:

  • Rule A: Partner "Azure" + Product (Empty) -> Account "629000".
    • Result: All bills from Azure go to 629000, regardless of the product.

2. Description Matching

Use the "Description Match" field to refine rules based on text.

  • Logic: "Contains" (Case Insensitive).
  • Useful for generic invoices where the service type is in the text.

Example:

  • Rule B: Partner (Empty) + Description "Hosting" -> Analytic Account "IT Infrastructure".
    • Result: Any bill line containing "hosting" (e.g. "Annual Web Hosting", "Hosting Service") gets the analytic account.
    • Result: Any bill line containing "hosting" (e.g. "Annual Web Hosting", "Hosting Service") gets the analytic account.

Advanced Logic

1. Priority & Conflicts

If two rules match the same line (e.g. Rule A matches Partner+Product, Rule B matches Partner+Wildcard), the system ALWAYS applies the rule with the Lower Sequence. Specificity does not automatically grant priority.

2. Multiple Rules per Invoice

The engine works Line by Line.

  • Line 1 can match Rule A.
  • Line 2 can match Rule B.
  • Line 3 can match no rule. This allows a single invoice to have mixed accounts/analytics based on its content.

Note: If rules modify Header Fields (e.g. Payment Terms), the last matching line determines the final value for the whole invoice.

API & Automation (n8n / Imports)

This module enhances API reliability for Purchase Invoices (Vendor Bills). If you create an invoice via API (create method) and omit certain fields, the system auto-populates them from the Partner:

  1. Payment Terms: From partner.property_payment_term_id.
  2. Bank Account: From first partner.bank_ids.
  3. Payment Mode: From partner.supplier_payment_mode_id.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_account_dynamic_rules-16.0.1.0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_account_dynamic_rules-16.0.1.0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 727b0dd5fac9395d67c8111b97749a7f1299456506e1fc14b6da48532ac1ea1b
MD5 69fdba20120bb8e5861e7b8d6ebbd77b
BLAKE2b-256 b571b5ed33c630055346eb697fe0f43f0f413d72c7b939c011c1de8286b3aa56

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page