Comments (8)
Hello, the issue is that you're not starting the services so useService cannot possibly work. Try following this guide which I recently wrote: https://www.odoo.com/documentation/master/developer/howtos/standalone_owl_application.html
I'm going to close this issue as it is not related to Owl itself but how to use Owl within Odoo. If it is a bug or feature request it should be an issue on the Odoo repo, if it's an issue with using using the code or the tutorial it should be an issue on the documentation repo
from owl.
@sdegueldre You were right, I used mountComponent
instead of mount
to start the servers and the problem was solved.
thanks for your reply
Good luck
from owl.
Hi @sdegueldre , thanks for your tips.
I'm using your proposal with mountComponent yet as I follow you tuto on Odoo doc it looks like mountComponent should be part of @web/env
AFAICS, there is no such method in @web/env , only in owl ...
Ah my bad, available in 17.0 not in v16.
Maybe using startWebClient in @web/start could be a good choice ?
from owl.
@sdegueldre You were right, I used
mountComponent
instead ofmount
to start the servers and the problem was solved.thanks for your reply
Good luck
Could you share your solution ?
from owl.
hum, looks like it works for a owl applicaton.
What is the process to hook a component into a portal website page for example.
I've succeed in mouting the component but wahrerver the method, impossible to have services. UseService failed either with the v16 or v17 flavor with mountComponent.
Is it necessary to use OwlCompatibility because website still designed in old framework ?
Regards
from owl.
If you want to be able to use useService
your app's environment needs to contain the started services. In 17.0+ you can use mountComponent
which does that for you automatically, but in lower versions you'll have to create your env yourself and start the services in that environment. You'll also need to make sure that the code for the services that you want to use and their dependencies are loaded in the correct assets bundle (assets_frontend for portal). I wouldn't recommend using startWebClient
directly, as it does a few things that are specific to the actual webclient, but your starting code should do most of what startWebClient
does.
In the website and portal, we already start the services and they can only be started once, so you'll have to reuse that env. I've replied to you on another issue about how to achieve this.
from owl.
Hi gays i have question, i need to patch some code to Order class that located in pos/app/store/models
when i inherit setup function and i need to use orm services it show error
from owl.
hi @HamidAbdalla123 , this issue is closed.
Moreover you didn't provides enough details so we can't identify if its an owl or Odoo issue.
Please open a proper issue.
from owl.
Related Issues (20)
- Documentation for slot params shows bad example HOT 1
- Component gets improperly patched
- Don't allow invalid modifiers on events
- t-ref is no longer supported on components. Consider exposing only the public part of the component's API through a callback prop. HOT 3
- useService("user") doesn't work with public component HOT 6
- Question: Mounting component with javascript HOT 2
- [crash] slot content re-renders when it should be destroyed HOT 5
- [perf] props (reactive object) should not be observed outside of rendering HOT 3
- How to do routing in owl js version 2.2.10 because router import gives undefined HOT 2
- Please explain how to do routing in owl js HOT 1
- make array work with t-att-class
- clean up variable scoping semantics
- Default content in t-esc is not translated
- Lot of vulnerabilies when follow quick start HOT 3
- useComponent crashes if called outside of setup
- Normalize line endings in files generated by the release script
- Options in component "SelectMenu" overflow HOT 3
- Search in component "SelectMenu" doesn't work properly HOT 4
- Blocking UI doesn't effect on popups HOT 1
- New props in a component that propagate to all extensions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from owl.