Skip to content

this.orm is undefined in Chapter 14 Section 04 Dynamic Snippets (snippet.js) #3

Description

@bouktaibMohssin

First of all, thank you for this incredibly helpful book and for all the effort you’ve put into making complex concepts easier to understand. The content has been a tremendous resource for my work with Odoo, and I’ve learned so much along the way!

Issue: In Chapter 14, Section 04 (Dynamic Snippets), there is a small issue in the provided snippet.js code.

https://github.com/PacktPublishing/Odoo-17-Development-Cookbook-Fifth-Edition/blob/9717c757a5312c2206fb7d822ec48d3ba8feee40/Chapter14/04_dynamic_snippets/my_hostel/static/src/js/snippets.js#L15

The code attempts to use this.orm within the HostelSnippet widget’s start function. However the following error appears:

image

To Reproduce:

  1. Follow the steps in Chapter 14, Section 04 to implement the HostelSnippet widget.
  2. Add the code from snippet.js as written.
  3. When the widget loads in the browser, it throws the above error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions