在odoo(python)中继承时如何更改日期格式?

How to change date format when inherit in odoo (python)?

首先,我有一个模型继承到模型 purschase.order。我想在继承模型

中将日期时间从 purchase.order 更改为日期格式

this field from purchase.order :

date_order = fields.Datetime('Order Deadline', required=True, states=READONLY_STATES, index=True, copy=False, default=fields.Datetime.now,\
    help="Depicts the date where the Quotation should be validated and converted into a purchase order.")

请帮助我,谢谢你的时间。

您可以添加这个字段

date_order = fields.Date(required=True, default=fields.Date.today,\
    help="Depicts the date where the Quotation should be validated and converted into a purchase order.")

到您继承的模型,然后用这个

替换树和表单视图中的 date_order