Comments (4)
You forgot to start the services, the localization service loads the translations. You can take a look at createPublicRoot
in self_order_index.js
of the pos_self_order
module as an example, as the new pos self ordering app is an owl app served from a controller. But indeed this is not the appropriate repo for this question.
from owl.
we should have a howto on the official owl documentation for a setup for a controller in odoo with a minimal set of files, owl, templates properly setup, and translations as well
from owl.
task created id=3580007
from owl.
we should have a howto on the official owl documentation for a setup for a controller in odoo with a minimal set of files, owl, templates properly setup, and translations as well
That would be super helpful!
You forgot to start the services, the localization service loads the translations. You can take a look at createPublicRoot in self_order_index.js of the pos_self_order module as an example, as the new pos self ordering app is an owl app served from a controller. But indeed this is not the appropriate repo for this question.
Thanks for the quick reply @sdegueldre, sometimes it is difficult to pinpoint if its an issue on the owl side or Odoo side. I've added the startServices()
as per your recommendation:
if (document.querySelector('#some-div')) {
await whenReady();
const env = makeEnv();
await startServices(env);
mount(
ExampleComponent,
document.querySelector("#some-div"),
{
env, templates, translateFn: _t, dev: true }
);
}
However, I am now faced with all sorts of errors in the console (it even gets in a loop of errors):
Error: Cannot add 'EffectContainer' in the registry: it already exists
Error: Cannot add 'DialogContainer' in the registry: it already exists
Error: Cannot add '...' in the registry: it already exists
TypeError: Cannot redefine property: userContext
OwlError: Cannot make the given value reactive
TypeError: env.services.dialog.add is not a function
Error: UI service not initialized!
I tried to mount an App
instance instead of the component itself as per the example you suggested (POS self order), however that did not solve it:
import { Component, whenReady, App } from "@odoo/owl";
const app = new App(ExampleComponent, {
templates,
env,
dev: env.debug,
translateFn: _t,
translatableAttributes: [],
});
app.mount(document.querySelector("#some-id");
Perhaps you have any suggestion?
cc @ged-odoo
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.