Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2900 Tampilan

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 ?

Avatar
Buang
Penulis Jawaban Terbai

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
Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mei 17
7300
0
Des 15
3239
0
Mar 15
3972
0
Mar 25
1288
0
Jan 25
3391