odoo / owl

OWL: A web framework for structured, dynamic and maintainable applications
https://odoo.github.io/owl/
Other
1.11k stars 334 forks source link

How to Use Form View, Tree View or Field Inside a Component? #1529

Closed hglong16 closed 9 months ago

hglong16 commented 9 months ago

I am developing an app based on Odoo and need to create quite a lot of UI from scratch, and I am using Owl to implement it. There are parts where I need to utilize almost an entire form view within a section of the app. However, I can't find any documentation on simple ways to achieve this.

When using Owl DevTools, I see units from Field -> View -> Record. They all share one prop: "records." How can I create an accurate "records" prop?

sdegueldre commented 9 months ago

Hello, this seems to be a question about how to use Owl inside of Odoo and is not in the scope of the Owl project per se. The Owl issues are for problems encountered with Owl itself, its documentation or its devtools, so this isn't the right place to discuss this. You could instead open an issue against the Odoo documentation project: https://github.com/odoo/documentation

A good starting point for understanding how to work with views would be the Odoo JS framework tutorial in the documentation: https://www.odoo.com/documentation/master/developer/tutorials/master_odoo_web_framework.html

As far as using views and fields outside of the web client, this is a pretty advanced and relatively rare use case, so it's not very high in our list of priorities to document how to do this, these components make a lot of assumptions about their environments (presence of the action service, non-public user that can make RPCs, etc), and even inside of Odoo, when we want to use views in places other than the webclient, we often end up bringing the entire web client anyway. You could find one example where we do this in the odoo code base in the project app, where they embed a web client on the portal to display a kanban view, there is another example in the mrp_subcontracting module.