Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未更新ODOO 10相关字段_Odoo_Odoo 10 - Fatal编程技术网

未更新ODOO 10相关字段

未更新ODOO 10相关字段,odoo,odoo-10,Odoo,Odoo 10,此相关字段在odoo 9中工作正常,但在odoo 10中工作不正常。使用nomor\u hp\u id创建新记录时,customer\u id字段未更新 nomor\u hp\u id=fields.manyOne( string='Nomor hp', comodel_name='nomor.hp', ondelete='cascade', ) customer_id=fields.manyOne( string='Customer', 相关class='nomor\u hp\u id.客户\

此相关字段在
odoo 9
中工作正常,但在
odoo 10
中工作不正常。使用
nomor\u hp\u id
创建新记录时,
customer\u id
字段未更新

nomor\u hp\u id=fields.manyOne(
string='Nomor hp',
comodel_name='nomor.hp',
ondelete='cascade',
)
customer_id=fields.manyOne(
string='Customer',
相关class='nomor\u hp\u id.客户\u id',
ondelete='cascade',
store=True,
readonly=True,
)

尝试启动新数据库,但结果仍然没有更新。

这种方法对我来说很好

customer\u id=fields.manyOne(
string='Customer',
相关class='nomor\u hp\u id.客户\u id',
store=True,
)

您必须在
manyOne
字段中给出comodel名称,要么是正常的
manyOne
要么是相关的
manyOne
。请看下面的代码。你会得到答案的

nomor\u hp\u id=fields.manyOne(string='nomor hp',comodel\u name='nomor.hp',ondelete='cascade',)
customer\u id=fields.manyOne(string='customer',comodel\u name='res.partner',related='nomor\u hp\u id.customer\u id',ondelete='cascade',readonly=True,)
您必须定义哪个表的引用。此处
customer\u id
是“
res\u partner
”表或“
res.partner
”模型的参考字段