How To Write Controllers And Render WebPage Using Controllers in Odoo
HTML-код
- Опубликовано: 14 ноя 2019
- How to write controllers in Odoo and Render a web page using the Controller in Odoo. Create controllers in Odoo. Create a new template and render the template/web page using the controller. Fetch the data from database tables and display it in webpage using the controllers.
Email: odoomates@gmail.com Наука
I'd like to know in which cases it is more useful to prepare a controller instead of putting a simple menu option.
thanks for a eventually answer
Excelente tutorial. Gracias por compartir su conocimiento
Thanks. Please refer the channel and videos to your friends :)
Thank you... I can create template easily
Welcome :)
Very much thanks!
You're welcome!
I'm wondering if we can render js framework (react or vue). If we can do that, it will be amazing
www.odoo.com/documentation/15.0/developer/reference/frontend/owl_components.html
HELP! Is it necessary to do this step 11:32 to obtain the list of data on the page?
(I didn't understand that part very well, I don't speak English)
is the entered time frame correct ? 11:32
excellent
thanks
very great video. can you make a quick video about getting information from webhook (ex. facebook) via controller?
Where is the text block in the Odoo website coded in the website module?
hey what a nice video , I have a question i tried to use other file rather than tempaltes.xml with exactly same code you have on your video but it show me some error , but it work if i use the template.xml , how we use other xml file for render webpage using controller ?
can i see the error message you get
@odoo mates you are doing great tutorials. I wanna ask you something can you demonstrate how the publish to the website is working please kindly looking you
you mean, how to host odoo website in odoo server or?
@@OdooMates thanks for your replay, am saying about the smart button "on website" which is used for publishing or unpublish the content
@@zelalembiru3298 the smart buttons is available for the web pages right ? if this is not set to True, public users will not be able to see this page
@@OdooMates once again I would like to say thank you for the reply and attention, but am saying that can you demonstrate how it is working on the backend, if i need to add this smart button how can i did it?I know what it is working on the front side
If you get `External ID not found in the system: website.layout` error, you need to install website module first
yes, forget to specify this, better we set website module as a dependent module of our module
Hi. I have a question for you: Where is the website.layout located ?
in website module
Can you show me the way to fix the error External ID not found in the system: website.layout, please?
Can you upgrade website module and see
can u do a comparison video od 12,13,14,15 and its changes
all the versions ? from v12, the coding are almost same only with minor changes here and there
that's great,but how to call controller action in view?
By default its seems not possible, haven't checked its possibilities yet
i want to show image field in website how i can do this..my image field is "image = fields.Binary(string='Image', max_width=5, max_height=5)"
Just try to write it in record
how can we use custom controller to Create Lead from external application with Odoo APIs
an example is shown in this video: ruclips.net/video/wGvuRbCyytk/видео.html
Thanks sir, it's so helpful for me. But How to render template view like this
i get this error :
Error message:
load could not load template
ValueError: View 'website.layout' in website 1 not found
Template: 2131
The error occurred while rendering the template 2131
is it resolved ?
@@OdooMates yes, i had to inherit the website module
So you missed to add it in the depends right....
I added _inherit:"website.layout" in the python file
hi can you put separate playlist for this webcontroller please
brother, see: ruclips.net/video/8uYxWRlxL_U/видео.html
@@OdooMates thanks
hi nice explanation. May i know how to create a new view type in odoo 10?
will this module help as a reference? apps.odoo.com/apps/modules/10.0/web_timeline/
how to set parameter ppg=xxx for page?
hi!
i would like to ask, how i host my website for public?
just we need to install the odoo in some servers(which can be accessed by public) and set a domain name for it.
I just want to tell you that your videos are supper useful , thank you. However, the voice is so low or maybe the quality
Yes we do understand the issue and in the latest videos we have tried our best to keep the voice quality better
@@OdooMates Thank you so much, please continue your videos, they are supper useful. Thank you again
@@ammaralmoalmi3769 thanks for the support and feedback
Stop the Pycharm instance of Odoo in order to update from console command
myself get familiar in using the pycharm
I want to make a controller which should some field for my customer to fill in and confirm, then it creates a record in the backend
what issue you face in achieving this ?
@@OdooMates I have already found some of your videos and I have already achieved it , thank you so much.
@@ammaralmoalmi3769 glad to hear it
Please Make vedio theme tutorial
I am on Odoo 16.
After adding the "controllers" folder with __init__.py and main.py, and imported controllers into the main __init__.py, I got an error.
I tried to undo all the steps, deleting "controllers" and the new line in __init__py, but the error persisted.
Running odoo booted me to the database selector, and upon choosing "odoo16-dev", I got an error.
I created a new database, and it works again. But how do I fix my old database?
The error:
2023-05-31 06:23:26,865 4076 ERROR odoo16-dev odoo.modules.registry: Failed to load registry
2023-05-31 06:23:26,867 4076 ERROR odoo16-dev odoo.http: Exception during request handling.
Traceback (most recent call last):
File "C:\Projects\Odoo16-Dev\odoo\odoo\modules
egistry.py", line 64, in __new__
return cls.registries[db_name]
File "", line 2, in __getitem__
File "C:\Projects\Odoo16-Dev\odoo\odoo\tools\func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "C:\Projects\Odoo16-Dev\odoo\odoo\tools\lru.py", line 34, in __getitem__
a = self.d[obj]
KeyError: 'odoo16-dev'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Projects\Odoo16-Dev\odoo\odoo\http.py", line 1987, in __call__
response = request._serve_db()
File "C:\Projects\Odoo16-Dev\odoo\odoo\http.py", line 1562, in _serve_db
self.registry = Registry(self.db).check_signaling()
File "C:\Projects\Odoo16-Dev\odoo\odoo\modules
egistry.py", line 66, in __new__
return cls.new(db_name)
File "", line 2, in new
File "C:\Projects\Odoo16-Dev\odoo\odoo\tools\func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "C:\Projects\Odoo16-Dev\odoo\odoo\modules
egistry.py", line 90, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "C:\Projects\Odoo16-Dev\odoo\odoo\modules\loading.py", line 485, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "C:\Projects\Odoo16-Dev\odoo\odoo\modules\loading.py", line 373, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "C:\Projects\Odoo16-Dev\odoo\odoo\modules\loading.py", line 303, in load_module_graph
module.write({'state': 'installed', 'latest_version': ver})
File "C:\Projects\Odoo16-Dev\odoo\addons\website\models\ir_module_module.py", line 78, in write
if request and request.db and request.context.get('apply_new_theme'):
File "C:\Projects\Odoo16-Dev\venv\lib\site-packages\werkzeug\local.py", line 348, in __getattr__
return getattr(self._get_current_object(), name)
File "C:\Projects\Odoo16-Dev\odoo\odoo\http.py", line 1215, in context
return self.env.context
AttributeError: 'NoneType' object has no attribute 'context'
is this resolved ?
@@OdooMates the old database is still unusable, and I continued the tutorials on a new database. I did not attempt to brick my new database again.
in request.env[].search, how can i filter only active id of record i was created ?
in the domain, you can add necessary condtions like, request.env['res.partner'].search([('create_uid, '=', MY_ID)])
How to create edit form to edit created record using controller
Sir can you please make more videos on odoo website module...like how to show model records in website
Sure, we will keep in mind and try to add in upcoming days
@@OdooMates thank u
Welcome
excuse me. how to show "find in path" window???
did you installed pycharm ?
I already upgrade my modules but it doesn't work
then can you duplicate the db and try upgrading the base module itself and see
Thankz and can you give me one more favour by giving the link of repo
sure: github.com/odoomates/Development-Tutorials
@@OdooMates kindly make videos on gateway integration and third party etc.
@@OdooMates thankz
how to store session in controller?
Using request.session you can store in session
@@OdooMates one more question..
I am getting values from controller.
How to place values in XML file.
I had write t-esc= "values"
But I am not getting anything
please check the audio its too low
Sorry for it, hope you can adjust it by your system volume
Do you know, How to create a user in controllers?
By calling create method of res.users model
@@OdooMates Thanks for your reply. But I didn't get that. I am learning about controllers. Is there any link regarding that?
We have a playlist named Odoo website tutorials, in that there is video about controllers
@@OdooMates I checked that also.
@@thanshidhap.p4743 then ...