Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3083 มุมมอง

Hello, I'm on Odoo v8,

I've done a module, it inherit from stock.move, I try to overload action_assign.

Here I've put a breakpoint (pdb) to see my values. When I try to get the product of a move, i got this error :

AttributeError: 'stock.move' object has no attribute '_ids'

My code :

# -*- coding: utf-8 -*-
from openerp.osv import osv, fields, expression

class stock_move(osv.osv):
_inherit = "stock.move"

def action_assign(self, cr, uid, ids, context):
import pdb
pdb.set_trace()

#récupérer le produit
product_id = self.product_id

What's wrong ?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

This is the old API, so you have to access to the recordset with 

move = self.browse(cr, uid, ids, context)

Or access directly to the attribute 

default_location = self.browse(cr, uid, ids, context).product_id.default_location
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 17
7483
0
ธ.ค. 15
3373
0
มี.ค. 15
4126
0
มี.ค. 25
1561
0
ม.ค. 25
3707