콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
6520 화면

I have an override of the class ../openerp/addons/base/ir/ir_attachment.py.

I need the id value of the instance in my method overrided _get_path().

My override file contents :

from openerp.osv import osv
import logging
_logger = logging.getLogger(__name__)

class PT_ir_attachment(osv.osv):
    _inherit = 'ir.attachment'
    _name = 'ir.attachment'

    def _get_path(self, cr, uid, bin_data):
        fmonth = "avril-2015"
        fname = 'osot.png'
        fpath = 'dsd'
        test = self._full_path(cr, uid, fname)
        context = {}

       ids = ???? (how could I get instance ID here)

        for attach in self.browse(cr, uid, ids, context=context):
            if attach.store_fname:
                result[attach.id] = self._file_read(cr, uid, attach.store_fname, bin_size)
            else:
                result[attach.id] = attach.db_datas


        _logger.error(self)
        _logger.error(fmonth)
        _logger.error(fname)
        _logger.error(fpath)
        _logger.error(test)
        _logger.error(context)
        _logger.error(uid)
        _logger.error(ids)
        return fname, fpath

 

Somebody could help please?

 

아바타
취소
관련 게시물 답글 화면 활동
2
7월 20
6233
1
10월 23
2811
1
11월 17
7726
3
7월 25
2330
3
5월 25
4075