Skip to Content
Menu
This question has been flagged
6 Replies
2940 Views

Hi,

I want to update qweb code by py file. is it possible?

The Requirement is, I am creating web page for diffenrt uses like example-

http://localhost:8069/page/manalishah343-gmail-com

http://localhost:8069/page/jiten-gmail-com

i am creating blank web pages when user is creating in odoo.all users have personal web page.

if 1)Jiten puts head line in web page "welcome to my page" on http://localhost:8069/page/jiten-gmail-com

2)manali puts head line in web page "Coming soon" on http://localhost:8069/page/manalishah343-gmail-com

all this should be done by coding in py file, not by in xml code ,becuase user can change his message in odoos form textbox any time,user will not edit his webpage directly from odoo website editor.

it is possible to update tags in qweb by python py file coding?



Avatar
Discard
hi,
   I need help.i dont work with much with controller.  manali.shah19 my skype id pls help me

On Sun, Mar 13, 2016 at 7:26 PM, Axel Mendoza <portaltemplate12973@mail.odoo.com> wrote:

A new answer on Updating Qwebs By Py file has been posted. Click here to access the post :

See post

--
Axel Mendoza

Sent by Odoo Inc. using Odoo

Author Best Answer

Hi Axel,

Thanks  for help,i did as par your suggesion  used slug for different conustants email address..controller listes to to template and it passed data  from model regarding slug email address of user.Thankyou :) your suggesstion works

Avatar
Discard
Best Answer

You could have template pages(in xml) that you could copy to create the new ones and use a model field for those pages that allow you to edit the message in the backend and in the website frontend use the value of the model field as output for a tag. The thing is that you don't need to build the page using code, you just need to evaluate the template in the rendering fase using different values for each user own data. You need to create a controller to retrieve the user data for the page as pass it to the rendering of the template 


Avatar
Discard
Author

Hi thanks Axel for ur answer, But the issue is i dont know what should be my controller route becuase it will be like http://localhost:8069/page/jiten-gmail-com ,it will change with user email address,how can i specify specific Web controll?

that's called slug url and odoo support it in the controller route definition

Author

can u please tell me, http://localhost:8069/page/jiten-gmail-com what will be my controller name in py file in this case email address will be always change,please suggest me,manali.shah19 my skype id