OD中的字段类型更改

2024-10-01 02:37:58 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨伙计们, 我想问个问题。在

基地里有一块场地是这样的:

_name = "stock.location"

_columns = 
{
  'complete_name': fields.function(_complete_name, type='char',string="Full Location Name", store={'stock.location': (_get_sublocations, ['name', 'location_id', 'active'], 10)}),
}

我想在我的向导中将完整的\u name字段类型更改为Char,并使用我自己的自定义模型命名为:“计算位置向导“,我该怎么做?在


Tags: columnsnamefieldsstringtypestockfunctionlocation
1条回答
网友
1楼 · 发布于 2024-10-01 02:37:58

如果使用旧api: 在

_inherit = "stock.location"

_columns = 
{
  # change the all data
  # change anything you want 
  'complete_name': fields.function(_new_method_, type='new_type',string="Full Location Name", store={'stock.location': (_get_sublocations, ['name', 'location_id', 'active'], 10)}),
}

如果可以使用新的api

^{pr2}$

相关问题 更多 >