Skip to Content
Menu
This question has been flagged
2 Replies
9687 Views

Hi all,

I would like to upgrade my custom modules to v15, but can't seem to find the core changes between the two versions.

One example being that assets like scripts, css, ... cannot be included by xml anymore, but must be included in the manifest file.

Is there a summary of those changes?
if yes, please link it here, it will be very much appreciated!

Thanks in advance!

Avatar
Discard
Best Answer

Hi,

Some of the changes in odoo 15 is,

  • t-raw QWeb directives are replaced by t-out/t-esc ones, with the optional Python tool markupsafe.Markup for escaping HTML content in server side. HTML fields apply directly the markup when used on QWeb. See https://github.com/odoo/odoo/commit/01875541b1a8131cbhttps://github.com/odoo/odoo/pull/70004 and https://github.com/odoo/odoo/pull/70004 for more details.

  • The access to ir.model* objects has been removed, so you need to use sudo, or use the existing methods for getting usual data. See https://github.com/odoo/odoo/pull/69120 for more info.

  • Jinja syntax in mail templates has been replaced by 2 languages:

    • Qweb for the body of the mail template.
    • inline_template, which is similar to Jinja, but with expressions enclosed by {{ and }} instead of ${ and }. It's used in fields like subject, email_from, email_to, etc.

    More info and examples of replacing at https://github.com/odoo/odoo/pull/77074

  • If you migrate some .js file to an ES module (they start with /** @odoo-module **/), rename the file to finish with .esm.js (rename also the assets) to enable ESLint compatibility.

  • Assets are now directly declared in the manifest. You should move .js and .scss links from templates to __manifest__.py file. They should be placed under "assets" key with the following structure:

    "assets": {
       "web.assets_backend": ["path to .js or css, like /module_name/static/src/...",...],
       "web.assets_qweb": ["path to .xml, like /module_name/static/src/...",...],
       "...": [...],
    },
    

    Notice that there is no more "qweb" key in __manifest__.py. Instead of it, you must link all qweb .xml in web.assets_qweb bundle, as shown above.

    The path to the files is now relative to the root folder, not the module folder.

    Illustrative example: https://github.com/OCA/credit-control/pull/154/commits/c2349c52dc5385f46c94bfa8fc0db2381b251fc8

    You can use globs as well for not having to declare each individual file.

  • Replace SavepointCase by TransactionCase in tests, as they are now the same. The old one still exists as an alias, but a warning will arise, and next version will remove such alias. More info at https://github.com/odoo/odoo/pull/62031

  • If you write a hook or any code that requires to create a new environment, there's no need of using the with Environment.manage(): context statement anymore.


Link:  https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-15.0


Thanks

Avatar
Discard
Best Answer

Hello Glenn, you know, I do also did some research on this, and this is something I do always lack at the official documentation. There should be Chapter -> "Upgrading custom module", but still it is just a dream.

From my side - generally there is a good documentation of new functionality over here:
https://www.odoo.com/documentation/15.0/developer.html

But as usual, no pointing out the differences scoped in one place. But, there is a hope.
I have found recently this site (codingdodo.com):
https://codingdodo.com/tag/odoo-15/

There are so far 3 Odoo 15 posts.. But very very well explained.. The most "step by step" explanation I have found so far in the net. There is probably also a post you would find very very helpful.

Hope this will help you.

Avatar
Discard
Related Posts Replies Views Activity
0
Nov 24
460
2
Feb 24
1650
3
Dec 17
6228
0
Sep 24
772
1
Feb 22
4381