Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
915 Lượt xem

Hello community,


we are getting an error whenever we try to edit any item on any list/page within odoo studio.

This happens everywhere, does not matter if we try it in customer support, sales or any other module.

We are running Odoo 17.0+e-20250113 (Enterprise-Edition) on a self hosted linux environment.

Trying to create a new App on the Main Page does work, editing a report also works fine.

Steps to reproduce: 

Open for example a ticket -> Open Studio -> Click on any item.

Error Message:

OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
    Error: An error occured in the owl lifecycle (see this Error's "cause" property)
        at handleError (https://****/web/assets/f16c0b1/web.assets_web.min.js:916:101)
        at App.handleError (https://****/web/assets/f16c0b1/web.assets_web.min.js:1559:29)
        at ComponentNode.initiateRender (https://****/web/assets/f16c0b1/web.assets_web.min.js:1008:19)

Caused by: TypeError: Cannot read properties of undefined (reading 'length')
    at zip (https://****/web/assets/f16c0b1/web.assets_web.min.js:3878:144)
    at Object.loadDisplayNames (https://****/web/assets/f16c0b1/web.assets_web.min.js:2858:64)

Function throwing the error:

    __exports.zip = zip;
    function zip(array1, array2, fill=false) {
        const result = [];
        const getLength = fill ? Math.max : Math.min;
        for (let i = 0; i < getLength(array1.length, array2.length); i++) {
            result.push([array1[i], array2[i]]);
        }
        return result;


Any hint on how to troubleshoot or find the cause of this problem would be very much appriciated!


Thanks a lot!

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks a lot for that detailed answer!

I tried steps 1-3 without success, the error presists.

Something I have noticed: The error message changes when in debug mode:

Odoo error message:

UncaughtPromiseError > OwlError
Uncaught Promise > Invalid props for component 'MultiRecordSelector': 'resIds' is missing (should be a list of numbers), 'resModel' is missing (should be a string), 'update' is missing (should be a function)
OwlError: Invalid props for component 'MultiRecordSelector': 'resIds' is missing (should be a list of numbers), 'resModel' is missing (should be a string), 'update' is missing (should be a function)
    Error: Invalid props for component 'MultiRecordSelector': 'resIds' is missing (should be a list of numbers), 'resModel' is missing (should be a string), 'update' is missing (should be a function)
        at Object.validateProps (https://xxxx/web/assets/f16c0b1/web.assets_web.min.js:1143:67)
        at LimitGroupVisibility.template (eval at compile (https://xxxx/web/assets/f16c0b1/web.assets_web.min.js:1511:421), <anonymous>:12:13)
        at Fiber._render (https://xxxx/web/assets/f16c0b1/web.assets_web.min.js:940:96)
        at Fiber.render (https://xxxx/web/assets/f16c0b1/web.assets_web.min.js:939:6)
        at ComponentNode.initiateRender (https://xxxx/web/assets/f16c0b1/web.assets_web.min.js:1009:47)

Browser console error message:

OwlError: Invalid props for component 'MultiRecordSelector': 'resIds' is missing (should be a list of numbers), 'resModel' is missing (should be a string), 'update' is missing (should be a function)

    Error: Invalid props for component 'MultiRecordSelector': 'resIds' is missing (should be a list of numbers), 'resModel' is missing (should be a string), 'update' is missing (should be a function)

        at Object.validateProps (web.assets_web.min.js:1143:67)

        at LimitGroupVisibility.template (eval at compile (web.assets_web.min.js:1511:421), <anonymous>:12:13)

        at Fiber._render (web.assets_web.min.js:940:96)

        at Fiber.render (web.assets_web.min.js:939:6)

        at ComponentNode.initiateRender (web.assets_web.min.js:1009:47)

handleError @ web.assets_web.min.js:2397

I will grab the error logs of the server and post them tomorrow.

Câu trả lời hay nhất

Solution 1: Clear Cache and Regenerate Assets

The error points to web.assets_web.min.js, so let’s rule out corrupted or outdated JavaScript assets first.

  1. Stop your Odoo server: 
    sudo systemctl stop odoo
    (Adjust the service name if it’s different, e.g., odoo17.)
  2. Clear the cache:
    • Find your temp directory (check your odoo.conf for data_dir; default is often ~/.local/share/Odoo or /var/lib/odoo).
    • Delete the sessions and filestore contents: 
      rm -rf /path/to/data_dir/sessions/* rm -rf /path/to/data_dir/filestore/*
  3. Restart the server: 
    sudo systemctl start odoo
  4. Hard refresh in your browser:
    • Open Odoo, go to Studio, and press Ctrl+Shift+R (or Cmd+Shift+R on Mac) to reload without cache.
  5. Test editing an item in Studio. If it works, the issue was a stale asset.

Solution 2: Update Modules and Database

Your build (17.0+e-20250113) might have a glitch, or the database might be out of sync after an update.

  1. Backup your database first:
    • Use the Odoo database manager (https://yourdomain.com/web/database/manager) to create a backup.
  2. Update all modules:
    • Run this command in your Odoo directory: 
      ./odoo-bin -c /path/to/odoo.conf -u all -d your_database_name
      Replace /path/to/odoo.conf and your_database_name with your actual config file and DB name.
    • This updates all installed modules, including Studio, to match your codebase.
  3. Restart the server:
    

    sudo systemctl restart odoo
  4. Test Studio again. This can fix schema mismatches or broken dependencies.

Solution 3: Check and Fix Studio Customizations

The loadDisplayNames function failing suggests Studio is choking on a custom field or view.

  1. Open Studio in debug mode:
    • Append ?debug=1 to your URL (e.g., https://yourdomain.com/web?debug=1).
  2. Inspect the view:
    • Open a ticket (or any affected record), enter Studio, and look at the fields/widgets in the view you’re trying to edit.
  3. Remove recent customizations:
    • If you’ve added custom fields, filters, or widgets recently, delete them one by one (click the field in Studio -> "Remove from View" or delete via the model settings).
    • Save after each removal and test if the error disappears.
  4. If you identify a problematic field, recreate it manually or check its definition in the backend (via Settings -> Technical -> Fields).

Solution 4: Patch the Code (Temporary Fix)

If you’re desperate and comfortable with code, you can patch the zip function to handle undefined arrays gracefully. This is a workaround, not a permanent fix.

  1. Locate the file:
    • The error is in web/assets, but the source is likely in odoo/addons/web/static/src/. Search for function zip(array1, array2, fill=false) in your Odoo source code.
  2. Edit the function:
    • Original:
      javascript
      CollapseWrapCopy
      function zip(array1, array2, fill=false) { const result = []; const getLength = fill ? Math.max : Math.min; for (let i = 0; i < getLength(array1.length, array2.length); i++) { result.push([array1[i], array2[i]]); } return result; }
    • Modified:
      javascript
      CollapseWrapCopy
      function zip(array1, array2, fill=false) { const result = []; array1 = array1 || []; // Default to empty array if undefined array2 = array2 || []; // Default to empty array if undefined const getLength = fill ? Math.max : Math.min; for (let i = 0; i < getLength(array1.length, array2.length); i++) { result.push([array1[i], array2[i]]); } return result; }
  3. Restart Odoo and clear browser cache.
    • Test Studio. This prevents the crash but might hide a deeper data issue, so use it as a last resort.

Final Steps

  • Start with Solution 1 and 2—they’re the least invasive and most likely to fix it.
  • If those fail, try 3.
  • Use 5 only if you’re stuck and need a quick patch while investigating further.
  • After each step, test by opening a ticket -> Studio -> clicking an item.

If it’s still broken, grab the server logs (/var/log/odoo/odoo-server.log) and any extra console errors from the browser, then drop them here. I’ll dig deeper with you. You’ve got this—let’s squash that bug!

Ảnh đại diện
Huỷ bỏ
Tác giả

Hey Sreez please check my other comment when you find time.
I clicked the wrong comment button :)

Thanks a lot!!

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 24
2655
0
thg 9 21
2005
0
thg 11 24
1321
4
thg 8 24
1550
2
thg 2 23
1926