[Vtigercrm-commits] [vtiger development] #5449: vtlib: two fields of uitype=10 break reports
vtiger development
vtiger-tickets at trac.vtiger.com
Sun Apr 28 15:27:25 UTC 2013
#5449: vtlib: two fields of uitype=10 break reports
----------------------------+-----------------------
Reporter: joebordes | Owner: sripriya
Type: Need More Info | Status: closed
Priority: unassigned | Milestone: 5.3.0
Component: vtigercrm | Version: 5.2.1
Severity: Critical | Resolution: fixed
Keywords: |
----------------------------+-----------------------
Comment (by alanlord):
I'm still seeing this error in 5.4.0
I have a custom module called "Contracts". It has 2 UIType 10 fields to
Contacts, one UIType 10 to Organisations and one more to Vendors.
When I make a report on Organisations and select it's related module
Contracts, then the report fails:
{{{
Report generation failed
Not unique table/alias: 'vtiger_contactdetailsRelLSContracts'
}}}
The query that is being generated looks like this:
{{{
select DISTINCT vtiger_account.accountname AS 'Accounts_Account_Name',
(CASE WHEN vtiger_account.parentid NOT LIKE '' THEN (CASE WHEN
vtiger_accountAccounts.accountname NOT LIKE '' THEN
vtiger_accountAccounts.accountname ELSE '' END) ELSE '' END) AS
Accounts_Member_Of, vtiger_account.mpanmprn AS 'Accounts_LBL_LSMPAN_MPRN',
libertus_lscontracts.contractno AS 'LSContracts_LBL_LSCONTRACT_NUM', (CASE
WHEN libertus_lscontracts.relvendorid NOT LIKE '' THEN (CASE WHEN
vtiger_vendorRelLSContracts.vendorname NOT LIKE '' THEN
vtiger_vendorRelLSContracts.vendorname ELSE '' END) ELSE '' END) AS
LSContracts_LBL_LSSUPPLIER, libertus_lscontracts.nosites AS
'LSContracts_LBL_LSNUM_OF_SITES', libertus_lscontracts.enddate AS
'LSContracts_LBL_LSCONTRACT_END_DATE', libertus_lscontracts.totaleac AS
'LSContracts_LBL_LSTOTAL_EAC', vtiger_crmentity.crmid AS "LBL_ACTION" from
vtiger_account inner join vtiger_crmentity on
vtiger_crmentity.crmid=vtiger_account.accountid inner join
vtiger_accountbillads on
vtiger_account.accountid=vtiger_accountbillads.accountaddressid inner join
vtiger_accountshipads on
vtiger_account.accountid=vtiger_accountshipads.accountaddressid inner join
vtiger_accountscf on vtiger_account.accountid =
vtiger_accountscf.accountid left join vtiger_groups as
vtiger_groupsAccounts on vtiger_groupsAccounts.groupid =
vtiger_crmentity.smownerid left join vtiger_account as
vtiger_accountAccounts on vtiger_accountAccounts.accountid =
vtiger_account.parentid left join vtiger_users as vtiger_usersAccounts on
vtiger_usersAccounts.id = vtiger_crmentity.smownerid left join
vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid left
join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid left
join vtiger_users as vtiger_lastModifiedByAccounts on
vtiger_lastModifiedByAccounts.id = vtiger_crmentity.modifiedby left join
(select libertus_lscontracts.* from libertus_lscontracts inner join
vtiger_crmentity on
vtiger_crmentity.crmid=libertus_lscontracts.lscontractsid and
vtiger_crmentity.deleted=0) as libertus_lscontracts on
libertus_lscontracts.relaccountid=vtiger_account.accountid left join
vtiger_crmentity as vtiger_crmentityLSContracts on
vtiger_crmentityLSContracts.crmid = libertus_lscontracts.lscontractsid AND
vtiger_crmentityLSContracts.deleted=0 left join libertus_lscontractscf as
libertus_lscontractscf on
libertus_lscontractscf.lscontractsid=libertus_lscontracts.lscontractsid
left join vtiger_groups as vtiger_groupsLSContracts on
vtiger_groupsLSContracts.groupid = vtiger_crmentityLSContracts.smownerid
left join vtiger_users as vtiger_usersLSContracts on
vtiger_usersLSContracts.id = vtiger_crmentityLSContracts.smownerid left
join vtiger_users as vtiger_lastModifiedByLSContracts on
vtiger_lastModifiedByLSContracts.id =
vtiger_crmentityLSContracts.modifiedby left join vtiger_crmentity as
vtiger_crmentityRelLSContracts0 on vtiger_crmentityRelLSContracts0.crmid =
libertus_lscontracts.relvendorid and
vtiger_crmentityRelLSContracts0.deleted=0 left join vtiger_vendor as
vtiger_vendorRelLSContracts on vtiger_vendorRelLSContracts.vendorid =
vtiger_crmentityRelLSContracts0.crmid left join vtiger_crmentity as
vtiger_crmentityRelLSContracts1 on vtiger_crmentityRelLSContracts1.crmid =
libertus_lscontracts.relcontactid1 and
vtiger_crmentityRelLSContracts1.deleted=0 left join vtiger_contactdetails
as vtiger_contactdetailsRelLSContracts on
vtiger_contactdetailsRelLSContracts.contactid =
vtiger_crmentityRelLSContracts1.crmid left join vtiger_crmentity as
vtiger_crmentityRelLSContracts2 on vtiger_crmentityRelLSContracts2.crmid =
libertus_lscontracts.relcontactid2 and
vtiger_crmentityRelLSContracts2.deleted=0 left join vtiger_contactdetails
as vtiger_contactdetailsRelLSContracts on
vtiger_contactdetailsRelLSContracts.contactid =
vtiger_crmentityRelLSContracts2.crmid left join vtiger_crmentity as
vtiger_crmentityRelLSContracts3 on vtiger_crmentityRelLSContracts3.crmid =
libertus_lscontracts.relaccountid and
vtiger_crmentityRelLSContracts3.deleted=0 left join vtiger_account as
vtiger_accountRelLSContracts on vtiger_accountRelLSContracts.accountid =
vtiger_crmentityRelLSContracts3.crmid WHERE vtiger_account.accountid > 0
AND vtiger_crmentity.deleted=0
}}}
I also get a report failure when reporting on Vendors too - same error:
{{{
Report generation failed
Not unique table/alias: 'vtiger_contactdetailsRelLSContracts'
}}}
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/5449#comment:19>
vtiger development <http://trac.vtiger.com/>
vtiger CRM
More information about the vtigercrm-commits
mailing list