I am need of changing the background color of the table of one2many field completely to white for a particular one2many field. Any ideas?
Asked
Active
Viewed 822 times
1 Answers
-1
As I have answered here, you will need to add css styles to the form
You must create the css file in this route:
/module_name/static/src/css/module_name.css
. Example of file:.odoo .other_class{ background-color: red !important; }
Create the file
/module_name/views/module_name.xml
with this content:<?xml version="1.0"?> <openerp> <data> <template id="assets_backend" name="module_name assets" inherit_id="web.assets_backend"> <xpath expr="." position="inside"> <link rel="stylesheet" href="/module_name/static/src/css/module_name.css"/> </xpath> </template> </data> </openerp>
Add the xml file to your
__manifest__.py
'data': [ 'views/module_name.xml', ],
Add the class to the elements in the view
<div class="classname"> <field name="field_name" class="other_class"/> </div>
Note: I am asuming you know how to use CSS styles. Keep in mind that !important
should be used sometimes as you are trying to override the Odoo framework styles.

ChesuCR
- 9,352
- 5
- 51
- 114
-
-
@navi yes, this will only affect the table with the class `other_class`. Maybe the css is not exactly what I have written, but the idea is clear. I do not know why somebody downvoted my answer haha – ChesuCR Feb 15 '19 at 08:01
-