Skip to content

Marketplace Mapping Documentation

Overview

The Marketplace Mapping model (marketplace.mapping) defines account mapping rules for marketplace integrations. It maps Shopee channels to specific sales, returns, and promotion accounts for proper revenue recognition.


Model Information

Model Name: marketplace.mapping Display Name: Marketplace Mapping Key Fields: None (no unique constraint defined)

Features

  • ❌ Audit logging enabled (_audit_log)
  • ❌ Multi-company support (company_id)
  • ❌ Full-text content search (_content_search)
  • ✅ Channel-to-account mapping
  • ✅ Tax rate assignment

Key Fields Reference

Shopee Fields

Field Type Required Description
shopee_account_id Many2One Shopee account
shopee_channel_id Many2One Shopee channel

Sales Account Fields

Field Type Required Description
sale_account_id Many2One Sales revenue account
sale_tax_id Many2One Sales tax rate

Returns & Promotions Fields

Field Type Required Description
sale_return_account_id Many2One Sales returns account
sale_promotion_account_id Many2One Promotions account
sale_promotion_tax_id Many2One Promotion tax rate

Model Relationship Description
shopee.account Many2One Shopee seller account
shopee.channel Many2One Shopee sales channel
account.account Many2One GL accounts
account.tax.rate Many2One Tax rates

Common Use Cases

Use Case 1: Create Channel Mapping

# Map Shopee channel to accounts
mapping_id = get_model("marketplace.mapping").create({
    "shopee_account_id": shopee_acc_id,
    "shopee_channel_id": channel_id,
    "sale_account_id": sales_acc_id,
    "sale_tax_id": sales_tax_id,
    "sale_return_account_id": returns_acc_id,
    "sale_promotion_account_id": promo_acc_id,
})

Use Case 2: Get Mapping for Channel

# Find mapping for a specific channel
mappings = get_model("marketplace.mapping").search_browse([
    ["shopee_channel_id", "=", channel_id]
])

if mappings:
    mapping = mappings[0]
    print(f"Sales account: {mapping.sale_account_id.name}")
    print(f"Returns account: {mapping.sale_return_account_id.name}")

Version History

Last Updated: December 2024 Model Version: marketplace_mapping.py Framework: Netforce


This documentation is generated for developer onboarding and reference purposes.