简体   繁体   English

如何在视图中显示月份? (Odoo11)

[英]how to display the month in from view ? (Odoo11)

please, how do I display the month in the form? 请问,如何在表格中显示月份? example: 07/04/2019 i want to change it in 07 april, 2019 Thank you in advance 例如:07/04/2019我想在2019年4月7日更改它,谢谢你提前

Try with following steps: 尝试以下步骤:

  • Go to Translations > Languages 转到翻译>语言
  • Open record with your current language. 用您当前的语言打开记录。
  • Edit date format with %d %A, %Y 使用%d%A,%Y编辑日期格式

@Navi asked how to do it in the code so here are 2 way to do it: @Navi询问如何在代码中执行此操作,因此这里有2种方法:

If you want to get this in the code, you can edit the file odoo/addons/base/data/res.lang.csv 如果你想在代码中得到这个,你可以编辑文件odoo/addons/base/data/res.lang.csv

You can also update it in the code with 您也可以使用代码更新它

self.env['res.lang']._lang_get(self.env.user.lang).date_format = '%d %A, %Y'

or 要么

<record id="base.lang_fr" model="res.lang">
    <field name="date_format">%d %A, %Y</field>
</record>

However you really shouldn't do it in the code. 但是你真的不应该在代码中这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM