Hi
make server action update manually.
find attachments of that models:
you have already apply the "documents.mixin"
first step to get folder via _get_document_folder
second step check attachment is not available in folder:
third step If attachment not available in folder, get values "_get_document_vals"
& create the document
Or look below method
def _create_document(self, vals):
"""
Implemented by bridge modules that create new documents if attachments are linked to
their business models.
:param vals: the create/write dictionary of ir attachment
:return True if new documents are created
"""
# Special case for documents
if vals.get('res_model') == 'documents.document' and vals.get('res_id'):
document = self.env['documents.document'].search_fetch(
[('id', '=', vals['res_id'])], [])
if document and not document.attachment_id and document.type == 'binary':
document.attachment_id = self[0].id
return False
# Generic case for all other models
res_model = vals.get('res_model')
res_id = vals.get('res_id')
model = self.env.get(res_model)
if model is not None and res_id and issubclass(self.pool[res_model], self.pool['documents.mixin']):
vals_list = [
model.browse(res_id)._get_document_vals(attachment)
for attachment in self
if not attachment.res_field and model.browse(res_id)._check_create_documents()
]
vals_list = [vals for vals in vals_list if vals] # Remove empty values
self.env['documents.document'].create(vals_list)
return True
return False