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
  • НаукаНаука

Комментарии • 92

  • @enricosaccheggiani3192
    @enricosaccheggiani3192 4 года назад

    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

  • @alejandrobrun
    @alejandrobrun 4 года назад +2

    Excelente tutorial. Gracias por compartir su conocimiento

    • @OdooMates
      @OdooMates  4 года назад +1

      Thanks. Please refer the channel and videos to your friends :)

  • @syamaas9621
    @syamaas9621 3 года назад +1

    Thank you... I can create template easily

  • @programmingtopics
    @programmingtopics 4 месяца назад

    Very much thanks!

  • @NMNaufaldo
    @NMNaufaldo 2 года назад

    I'm wondering if we can render js framework (react or vue). If we can do that, it will be amazing

    • @OdooMates
      @OdooMates  2 года назад

      www.odoo.com/documentation/15.0/developer/reference/frontend/owl_components.html

  • @lenninlawliett
    @lenninlawliett 2 года назад +1

    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)

    • @OdooMates
      @OdooMates  2 года назад

      is the entered time frame correct ? 11:32

  • @gunahawk6893
    @gunahawk6893 3 года назад +1

    excellent

  • @smartdentalvn7606
    @smartdentalvn7606 Год назад

    very great video. can you make a quick video about getting information from webhook (ex. facebook) via controller?

  • @user-kv5qk4vr6b
    @user-kv5qk4vr6b 8 месяцев назад

    Where is the text block in the Odoo website coded in the website module?

  • @andyanjordan507
    @andyanjordan507 3 года назад +1

    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 ?

    • @OdooMates
      @OdooMates  3 года назад

      can i see the error message you get

  • @zelalembiru3298
    @zelalembiru3298 3 года назад +1

    @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

    • @OdooMates
      @OdooMates  3 года назад

      you mean, how to host odoo website in odoo server or?

    • @zelalembiru3298
      @zelalembiru3298 3 года назад +1

      @@OdooMates thanks for your replay, am saying about the smart button "on website" which is used for publishing or unpublish the content

    • @OdooMates
      @OdooMates  3 года назад

      @@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

    • @zelalembiru3298
      @zelalembiru3298 3 года назад

      @@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

  • @NMNaufaldo
    @NMNaufaldo 2 года назад +1

    If you get `External ID not found in the system: website.layout` error, you need to install website module first

    • @OdooMates
      @OdooMates  2 года назад

      yes, forget to specify this, better we set website module as a dependent module of our module

  • @tronganhnguyenthanh1157
    @tronganhnguyenthanh1157 3 года назад +1

    Hi. I have a question for you: Where is the website.layout located ?

  • @tronganhnguyenthanh1157
    @tronganhnguyenthanh1157 3 года назад +1

    Can you show me the way to fix the error External ID not found in the system: website.layout, please?

    • @OdooMates
      @OdooMates  3 года назад

      Can you upgrade website module and see

  • @gunahawk6893
    @gunahawk6893 3 года назад

    can u do a comparison video od 12,13,14,15 and its changes

    • @OdooMates
      @OdooMates  2 года назад

      all the versions ? from v12, the coding are almost same only with minor changes here and there

  • @oulaikenny2494
    @oulaikenny2494 4 года назад +1

    that's great,but how to call controller action in view?

    • @OdooMates
      @OdooMates  4 года назад +1

      By default its seems not possible, haven't checked its possibilities yet

  • @ibrahimkhan-vc9mp
    @ibrahimkhan-vc9mp 3 года назад +1

    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)"

  • @jatinkant1711
    @jatinkant1711 Год назад +1

    how can we use custom controller to Create Lead from external application with Odoo APIs

    • @OdooMates
      @OdooMates  Год назад

      an example is shown in this video: ruclips.net/video/wGvuRbCyytk/видео.html

  • @jairuscalvin9769
    @jairuscalvin9769 8 месяцев назад

    Thanks sir, it's so helpful for me. But How to render template view like this

  • @chaotixsniper
    @chaotixsniper 2 года назад +1

    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

    • @OdooMates
      @OdooMates  2 года назад

      is it resolved ?

    • @chaotixsniper
      @chaotixsniper 2 года назад +1

      @@OdooMates yes, i had to inherit the website module

    • @OdooMates
      @OdooMates  2 года назад

      So you missed to add it in the depends right....

    • @chaotixsniper
      @chaotixsniper 2 года назад

      I added _inherit:"website.layout" in the python file

  • @gunahawk6893
    @gunahawk6893 3 года назад +1

    hi can you put separate playlist for this webcontroller please

    • @OdooMates
      @OdooMates  3 года назад

      brother, see: ruclips.net/video/8uYxWRlxL_U/видео.html

    • @gunahawk6893
      @gunahawk6893 3 года назад

      @@OdooMates thanks

  • @ashokmythi
    @ashokmythi 2 года назад +1

    hi nice explanation. May i know how to create a new view type in odoo 10?

    • @OdooMates
      @OdooMates  2 года назад

      will this module help as a reference? apps.odoo.com/apps/modules/10.0/web_timeline/

  • @quyofitxo7991
    @quyofitxo7991 Год назад

    how to set parameter ppg=xxx for page?

  • @relaxbox1575
    @relaxbox1575 3 года назад +1

    hi!
    i would like to ask, how i host my website for public?

    • @OdooMates
      @OdooMates  3 года назад

      just we need to install the odoo in some servers(which can be accessed by public) and set a domain name for it.

  • @ammaralmoalmi3769
    @ammaralmoalmi3769 2 года назад +1

    I just want to tell you that your videos are supper useful , thank you. However, the voice is so low or maybe the quality

    • @OdooMates
      @OdooMates  2 года назад

      Yes we do understand the issue and in the latest videos we have tried our best to keep the voice quality better

    • @ammaralmoalmi3769
      @ammaralmoalmi3769 2 года назад +1

      @@OdooMates Thank you so much, please continue your videos, they are supper useful. Thank you again

    • @OdooMates
      @OdooMates  2 года назад

      @@ammaralmoalmi3769 thanks for the support and feedback

  • @ShideShugo
    @ShideShugo 4 года назад

    Stop the Pycharm instance of Odoo in order to update from console command

    • @OdooMates
      @OdooMates  2 года назад

      myself get familiar in using the pycharm

  • @ammaralmoalmi3769
    @ammaralmoalmi3769 2 года назад +1

    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

    • @OdooMates
      @OdooMates  2 года назад

      what issue you face in achieving this ?

    • @ammaralmoalmi3769
      @ammaralmoalmi3769 2 года назад +1

      @@OdooMates I have already found some of your videos and I have already achieved it , thank you so much.

    • @OdooMates
      @OdooMates  2 года назад

      @@ammaralmoalmi3769 glad to hear it

  • @charoliyamujahid526
    @charoliyamujahid526 4 года назад

    Please Make vedio theme tutorial

  • @S1eth
    @S1eth Год назад +2

    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'

    • @OdooMates
      @OdooMates  Год назад +1

      is this resolved ?

    • @S1eth
      @S1eth Год назад

      @@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.

  • @ucMinh-tt4pz
    @ucMinh-tt4pz Год назад +1

    in request.env[].search, how can i filter only active id of record i was created ?

    • @OdooMates
      @OdooMates  Год назад

      in the domain, you can add necessary condtions like, request.env['res.partner'].search([('create_uid, '=', MY_ID)])

  • @sasindrans6059
    @sasindrans6059 Год назад

    How to create edit form to edit created record using controller

  • @nikitaagrawal1260
    @nikitaagrawal1260 2 года назад

    Sir can you please make more videos on odoo website module...like how to show model records in website

    • @OdooMates
      @OdooMates  2 года назад +1

      Sure, we will keep in mind and try to add in upcoming days

    • @nikitaagrawal1260
      @nikitaagrawal1260 2 года назад

      @@OdooMates thank u

    • @OdooMates
      @OdooMates  2 года назад +1

      Welcome

  • @tiennamduong7856
    @tiennamduong7856 3 года назад +1

    excuse me. how to show "find in path" window???

    • @OdooMates
      @OdooMates  3 года назад

      did you installed pycharm ?

  • @tronganhnguyenthanh1157
    @tronganhnguyenthanh1157 3 года назад +1

    I already upgrade my modules but it doesn't work

    • @OdooMates
      @OdooMates  3 года назад

      then can you duplicate the db and try upgrading the base module itself and see

  • @umerfarooq4026
    @umerfarooq4026 3 года назад +1

    Thankz and can you give me one more favour by giving the link of repo

    • @OdooMates
      @OdooMates  3 года назад

      sure: github.com/odoomates/Development-Tutorials

    • @umerfarooq4026
      @umerfarooq4026 3 года назад

      @@OdooMates kindly make videos on gateway integration and third party etc.

    • @umerfarooq4026
      @umerfarooq4026 3 года назад +1

      @@OdooMates thankz

  • @beautysinha6758
    @beautysinha6758 4 года назад

    how to store session in controller?

    • @OdooMates
      @OdooMates  4 года назад

      Using request.session you can store in session

    • @beautysinha6758
      @beautysinha6758 4 года назад

      @@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

  • @vaishusiva7063
    @vaishusiva7063 4 года назад +2

    please check the audio its too low

    • @OdooMates
      @OdooMates  4 года назад +1

      Sorry for it, hope you can adjust it by your system volume

  • @thanshidhap.p4743
    @thanshidhap.p4743 3 года назад +1

    Do you know, How to create a user in controllers?

    • @OdooMates
      @OdooMates  3 года назад +1

      By calling create method of res.users model

    • @thanshidhap.p4743
      @thanshidhap.p4743 3 года назад +1

      @@OdooMates Thanks for your reply. But I didn't get that. I am learning about controllers. Is there any link regarding that?

    • @OdooMates
      @OdooMates  3 года назад +1

      We have a playlist named Odoo website tutorials, in that there is video about controllers

    • @thanshidhap.p4743
      @thanshidhap.p4743 3 года назад +1

      @@OdooMates I checked that also.

    • @OdooMates
      @OdooMates  3 года назад

      @@thanshidhap.p4743 then ...