Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
8349 Zobrazení

I already created the xml and css file, I added the xml in the manifest then inside the xml I inherit my css file. 


My question is, what will be the css file look like?

In my template file, I have the style tag and inside of it are my custom designs but I want to transfer it to the static folder, to make my template file look clean and also follow the odoo arrangement.


<style type="text/css">
thead{
font-size:15px;
border-bottom: 2px solid black;
}

tbody{
font-size:10px;
border-collapse: collapse;
}

.total-row{
font-weight: bold;
font-size:10px;
}

.header{
margin-top:30px;

}

.table-shrinkage{
width:100%;
overflow-x:auto;
}

.text-upper-text-head {
text-align:left;
}

.text-lower-text-head{
text-align:left;

}

.table-header{
border-style:solid;
}

td{
border-bottom: 1px solid black;
}

</style>


How can I transfer it to the static folder ? What will be inside the css file look like, do I have to just copy the style above?

Avatar
Zrušit
Nejlepší odpověď

Please read the following tutorial from Yenthe: https://www.odoo.yenthevg.com/adding-static-resources-css-and-javascript-to-odoo/

Please be aware that by using fixed measures (such as px) you may overrule the default responsive styles based on media queries.

Avatar
Zrušit
Autor

Dear Ermin,

I followed the steps from the site and I tried to add a border in my table inside the template but it applies to all then I tried to put a class name in my table and used that name in my css but don't have any effects

My answer showed you how to properly static resources to Odoo, but if your CSS is wrong, then it is not an Odoo topic anymore :-(

Nejlepší odpověď

You can take a look at the default module (web) from odoo about the file placing convention.

I guess webclient_templeate.xml and the manifest of the web module are what you needed.

Avatar
Zrušit
Autor

Dear Wayne,

I open the module and followed what it is inside the web module to my module then it doesn't take any effects,

Do you include inherit_id in your template tag? Do you add them to the web.assets by xpath?

i.e., <template id="your_style_sheet" inherit_id="web.assets_backend">

<xpath expr="." position="inside"> <link ...> ...

Related Posts Odpovědi Zobrazení Aktivita
2
bře 15
3663
1
lis 22
4365
0
led 25
1005
2
pro 24
2351
1
dub 23
10425