Skip to content

Intent: conditional dependsOn source selection + header-mediated line defaults #6358

Description

@delchev

Motivation

dependsOn copies a fixed source field when a related record is picked (price from the chosen product). Two recurring business shapes cannot be expressed:

  1. Conditional source selection: a partner carries a price-level classifier (wholesale/retail); the line price should copy from the product's wholesalePrice OR retailPrice depending on the partner's classifier. Today only one fixed source field is possible.
  2. Header-mediated defaults: a document line should default a value from the DOCUMENT's related record - e.g. a per-line discount defaulting from the header partner's standard discount. dependsOn can only reference relations of the line entity itself.

Proposal (discussion-first)

  • dependsOn: { relation: Product, valueFrom: { by: <path-to-classifier>, cases: { 1: wholesalePrice, 2: retailPrice } } } - a resolved source picked by a classifier value; or a more general expression hook.
  • Allow relation: to navigate one hop through a to-one of the same document (relation: Document.Partner, valueFrom: discount).

Both are UI + generated-write-path concerns (the same places dependsOn lives today); no schema impact.

Why upstream

Price levels and partner terms are universal ERP furniture; without this, price lists stay display-only in any intent-built application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions