我有一个 one2many 计算字段,我还希望用户能够向其中添加新的记录行。我向它添加了一个反向字段,但它唯一要做的就是允许修改已经存在的记录
@api.one
def accumulate_files(self):
documents = self.env['document.customer']
document_gotten = documents.search([('name','=', self.name)])
for docs in document_gotten:
self.res_line_ids |= docs.customer_line_ids
@api.one
def edit_accumulate_files(self):
documents = self.env['document.customer']
for lines in documents.customer_line_ids:
lines.write(self.res_line_ids)