问题
In Odoo 11 I want to store the attachment in a different database. So to achieve that I need to get the file once uploaded. So for that I have made my code like this
import logging
from odoo import fields
from odoo import models,api
import base64
_logger = logging.getLogger(__name__)
class AttachmentStorage(models.Model):
_name = "attachment.storage"
_inherit = 'ir.attachment'
@api.model
def _file_write(self, value, checksum):
bin_value = base64.b64decode(value)
printf(bin_value)
fname, full_path = self._get_path(bin_value, checksum)
printf(full_path)
But here when I am updating or adding any profile image of an employee(as I am using hr module) this doesn't showing any thing even I am doing printf.
So can someone tell me how to achieve this? I want to store all the attachments in the different db.
NOTE: I have installed Odoo using docker on my local system
来源:https://stackoverflow.com/questions/56544393/odoo-11-store-attachments-to-other-db