我对many2one关系有错误的回报,如何将值更改为其他字符串(例如:'-')
这是我的python代码
@api.multi
def cetak_manifest(self):
for records in self.peserta_line:
if records.mahram_id.name is None:
records.mahram_id.name = '-'
list_peserta = [
str(no),
str(records.title),
str(records.jenis_kelamin),
str(records.jamaah_id.name),
str(records.tempat_lahir),
str(records.tanggal_lahir),
str(records.passport_no),
str(records.date_issued),
str(records.date_expired),
str(records.imigrasi),
str(records.mahram_id.name),
str(records.umur),
str(records.ktp_no),
str(records.order_id.name),
str(records.room_type),
str(records.jamaah_id.street + ' ' + records.jamaah_id.street2 + ' ' + records.jamaah_id.city + ' ' + records.jamaah_id.zip + ' ' + records.jamaah_id.country_id.name)
]
我想更改的False many2one值就是这样
mahram_id = fields.Many2one('res.partner', string='Mahram')
它返回false,因为我没有填写该字段
我收到一条错误消息
ValueError:预期的单例:res.partner()
请帮助我解决这个问题