跳至内容
菜单
此问题已终结
1 回复
1220 查看

Hello 

i have this view form  

  <record model="ir.ui.view" id="carpooling_form_view">
<field name="name">carpooling.carpooling.form</field>
<field name="model">carpooling.carpooling</field>
<field name="arch" type="xml">
<form string="Pooling">
<header>
<button class="btn-primary" name="bnt_find" string="Find" type="object"/>
<button class="btn-secondary" name="cancel_btn" string="Cancel pooling" type="object" />
<field name="state" widget="statusbar" />
</header>
<sheet>
<group>
<group>
<field name="name"/>
<field name="taken_seats"/>
<field name="departure_time"/>
</group>
<group>
<field name="departure_date"/>
<field name="note"/>
<field name="state"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

Is it normal that it is aligned to the left ? 

in all the tutorials that I have seen, it is centered, what's wrong or it is necessary to add extra classes.

形象
丢弃
最佳答案

Hi Yahia

your code looks fine

can you check if you have installed a module or theme that is overriding the css of odoo?

Daniel

形象
丢弃
编写者

I have installed MuK Backend Theme then uninstalled it.

did you regenerate the assets?
activate debug mode
debug menu -> regenerate assets

编写者

yes i do but , i still have the view aligned to the left, it seem that the right space is reserved for chatter, i tried on an other environment and a the right side i have a scroll bar (i am using Odoo 17 )
and other modules all have the chatter in the right

编写者

there is even a module to hide the chatter https://apps.odoo.com/apps/modules/16.0/hide_chatter

can you uninstall hide_chatter?
or at least run your code in a test envirement without 3rd party module? just to be sure that no extra module is causing the issue, becuase your Form declaration is correct

编写者

I tested with a new clean install it's the same thing, I think it's normal behavior, maybe given my 27 inch screen with QHD resolution they set a max width, when I reduce the size of the browser the window centers well.

on the other hand with version 15 of odoo it is centered despite the size or resolution of my screen


"I think it's normal behavior, maybe given my 27 inch screen with QHD resolution they set a max width, when I reduce the size of the browser the window centers well."=>
Does all odoo standard view looks not centered then or only your custom one
If so, I will advise you to create a ticket to odoo to fix that

编写者

almost all models have the chatter, but I finally found a view in the inventory ( Moves History) module which is aligned to the left as in my module

相关帖文 回复 查看 活动
1
9月 21
9074
1
1月 24
16692
0
3月 15
3022
1
3月 15
9620
1
5月 24
1208