Cannot read property 'conversion_rate' of undefined

Hi In the Products Module,

I am trying to hit 'More Products' under the SubProducts Subpanel but it just says 'Loading'. The error is the console is below.Anyone know why this is happening? Tks

logger.js:75 FATAL[2019-8-7 8:17:17]: Uncaught TypeError: Cannot read property 'conversion_rate' of undefined at http://localhost:8888/Moorepay/sugar/sidecar/minified/sidecar.min.js?v=6tsIpMrEo5vVwqHiy4LLWQ on line 1
write @ logger.js:75
currency.js:224 Uncaught TypeError: Cannot read property 'conversion_rate' of undefined
at Object.convertAmount (currency.js:224)
at Object.convertToBase (currency.js:235)
at SE.SidecarExpressionContext.<anonymous> (sugar_sidecar.min.js?v=6tsIpMrEo5vVwqHiy4LLWQ:2009)
at eval (eval at e.exports (addScript.js:9), <anonymous>:5:1507)
at Function.m.each.m.forEach (eval at e.exports (addScript.js:9), <anonymous>:5:2350)
at SE.SidecarExpressionContext.<anonymous> (sugar_sidecar.min.js?v=6tsIpMrEo5vVwqHiy4LLWQ:2006)
at eval (eval at e.exports (addScript.js:9), <anonymous>:5:1507)
at Function.m.each.m.forEach (eval at e.exports (addScript.js:9), <anonymous>:5:2350)
at SE.SidecarExpressionContext.updateRelatedCollectionValues (sugar_sidecar.min.js?v=6tsIpMrEo5vVwqHiy4LLWQ:2004)
at SUGAR.forms.Trigger.<anonymous> (sugar_sidecar.min.js?v=6tsIpMrEo5vVwqHiy4LLWQ:2070)

Parents Reply
  • I found it in the file sidecar/src/utils/currency.js, whoses methods convertAmount and convertToBase are invoked from updateRelatedCollectionValues, as per your initial question.

    I didn't see anything wrong in the files you shared, so I started digging on the stack trace and found out that.

    By identifying the records with empty currency_id (by executing those queries) you will be able to edit them, set a currency and then save them.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children