Get the App
SLTechnology News&Howtos  ›  Development  › 

How to customize the page by odoo through actions.client

Shulou Source: shulou.com Published: 2022-06-01 03:26:53 10月02日 Update

In this article Xiaobian for you to introduce in detail "odoo how to customize the page through actions.client", the content is detailed, the steps are clear, the details are handled properly, I hope this "odoo how to customize the page through actions.client" article can help you solve your doubts, the following follows the editor's ideas slowly in depth, together to learn new knowledge.

I. reasons for use

Because the odoo built-in page can not be used in the project development process, we need to use the action ir.actions.client to develop the custom view and realize the custom xml view development.

Second, achieve the goal

III. Development process

1. Project directory: three files are mainly used here: web.js, web.xml, vehicle_police.xml and base_views.xml

2. A custom action is defined using the ir.actions.client action view in the vehicle_police.xml file.

Customize the page

Web.main

3 、 web.js

Odoo.define ('web',function (require) {

"usestrict"

Varcore=require ('web.core')

VarWidget=require ('web.Widget')

VarModel=require ('web.Model')

Varsession=require ('web.session')

VarPlannerCommon=require ('web.planner.common')

Varframework=require ('web.framework')

Varwebclient=require ('web.web_client')

VarPlannerDialog=PlannerCommon.PlannerDialog

VarQWeb=core.qweb

Var_t=core._t

VarDashboard=Widget.extend ({

Template:'web'

Init:function (parent,data) {

Returnthis._super.apply (this,arguments)

}

Start:function () {

Returntrue

}

})

Core.action_registry.add ('web.main',Dashboard)

Return {

Dashboard:Dashboard

}

})

4. Web.xml, here an iframe is used to nest a web page. I wanted to use html code, but since I haven't used it, I need to study how to use html to customize the page.

5. Base_views.xml file, which is loaded into odoo with and imported js.

6. Finally, the web.xml file is introduced into _ _ mainfest__.py.

'qweb': ['static/src/xml/web.xml']

After reading this, the article "how to customize the page through odoo through actions.client" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Pages files development actions articles views contents processes projects proper three code reasons ideas new knowledge more steps directories goals knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi vpn Microsoft Shulou Technology