addons-cm/product_main_seller
snt 6f593c6240 [ADD] product_main_seller: Restore OCA addon from original version
- Restored product_main_seller addon to fix dependency chain
- Addon required by product_origin_char and website_sale_aplicoop

[IMP] website_sale_aplicoop: Add demo data configuration to manifest

- Updated __manifest__.py to include demo data files
- Demo data includes partners, suppliers, products, group orders, and sale orders
- Demo data successfully loads during module installation
2026-02-27 14:07:41 +01:00
..
i18n [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
models [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
readme [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
static/description [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
tests [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
views [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
__init__.py [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
__manifest__.py [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
hooks.py [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
pyproject.toml [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
README.md [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00
README.rst [ADD] product_main_seller: Restore OCA addon from original version 2026-02-27 14:07:41 +01:00

Product Main Seller

Summary

Adds a "Main Vendor" field to products that automatically tracks the primary supplier based on supplierinfo sequence.

Features

  • Automatic Main Vendor: Computed field showing the primary supplier
  • Based on Sequence: Uses the supplierinfo with the lowest sequence number
  • Visible in Views: Shows in product form and tree views
  • Searchable: Can search and filter products by main vendor
  • Related Fields: Access to vendor name and reference

Technical Details

Models Extended

  • product.template: Main product template
  • product.product: Product variants

Fields Added

  • main_seller_id (Many2one → res.partner, computed, stored)
    • The main vendor for this product
    • Computed from seller_ids with lowest sequence
    • Stored for performance
    • Searchable and filterable

Computation Logic

The main vendor is determined by:

  1. Looking at all supplierinfo records (seller_ids)
  2. Filtering for valid suppliers (active partners)
  3. Selecting the one with the lowest sequence number
  4. If no suppliers, returns empty

Dependencies

  • purchase (Odoo core)

Installation

docker-compose exec odoo odoo -d odoo -u product_main_seller --stop-after-init

Usage

Usage

Viewing Main Vendor

  1. Open a product form (Products > Products > [Product])
  2. See "Main Vendor" field (usually in Purchase tab)
  3. Field is automatically computed from vendor list

Changing Main Vendor

To change the main vendor:

  1. Go to product form > Purchase tab
  2. Edit the vendor list (seller_ids)
  3. Change the sequence numbers (lower = more priority)
  4. Save - the "Main Vendor" will update automatically

Searching by Vendor

# Find all products from a specific vendor
products = self.env['product.template'].search([
    ('main_seller_id', '=', vendor_id)
])

Use Cases in Kidekoop

This module is critical for:

  • Vendor performance analysis
  • Purchase order management
  • Inventory planning by supplier
  • Default supplier selection in purchase workflows

Views Modified

  • Product Template Form View
  • Product Template Tree View
  • Product Variant Form View

Translations

  • Spanish (es)
  • Euskera (eu)

Located in i18n/ directory.


Version: 18.0.1.0.0 Category: Purchase License: AGPL-3