ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 1 reply, has 2 voices, and was last updated by Mike Kudelya Mike Kudelya 1 year, 3 months ago.

  • Creator
    Topic
  • #21616
    pjo
    pjo
    Participant

    I use this config:
    businessUnitId:
    label: Agence
    type: choice-business-unit
    data_name: accountOwner.owner
    options:
    #lazy: “@oro_organization.provider.filter.busines_unit_choice_tree->shouldBeLazy”
    data: “@?oro_organization.provider.filter.busines_unit_choice_tree->getList”

    accountOwner = account.owner
    But when I lunch the filter with value id 3, I have this request:

    WHERE
    o4_.business_unit_owner_id IN (
    SELECT
    o7_.id
    FROM
    oro_user o7_
    LEFT JOIN oro_user_business_unit o9_ ON o7_.id = o9_.user_id
    LEFT JOIN oro_business_unit o8_ ON o8_.id = o9_.business_unit_id
    WHERE
    o8_.id IN (3)
    )

    Business_unit_id is a relation with oro_business_unit table why a “where in” with oro_user ? I want all account with a user belong to agence id 3.

    Account.owner.owner.id = 3

    Thank you

    I’m sorry for my english.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #21618
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi,

    Let me explain why it happens.

    Account’s ownership is an User. User’s ownership is a Business Unit.
    To filter Accounts by Business Unit you needed create join between User and Business Unit.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.