Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

two class has same field name ('name') ,when i inherit these two class into new class it show error

By
shaneebkhan
on 7/15/15, 7:34 AM 397 views

two class has same field name  ('name')

when i  inherit  these two class into new class it show

if field_name and field_name not in self._fields:

TypeError: unhashable type: 'list'

is there any way to solve?

 

can you put your code here ? It is easy to resolve.

Emipro Technologies Pvt. Ltd.
on 7/15/15, 7:44 AM

Why dont you change one of them

Drees Far
on 7/15/15, 7:58 AM
1

Solanki Shamji

--Solanki Shamji--
1293
| 5 2 6
Baroda, India
--Solanki Shamji--

Hello!

Solanki Shamji
On 7/16/15, 2:30 AM

Hello,

_name is used to define object like account.invoice, sale.order, purchase.order, res.users.

You have to define  name field in your columns, If  you don't define name field in column than  need to define field in _rec_name.

For more info please refer the below link.

http://dirtyhandsphp.blogspot.in/2014/09/odooopenerp-recname-and-nameget.html

Thanks.

 

0
shaneebkhan
On 7/16/15, 12:34 AM


class StockMove(osv.osv):

_name = 'mrp.stockmove'

_inherit = ['stock.move', 'ir.attachment']

_columns = {

'production_id': fields.many2one('mrp.production', 'Production Order for Produced Products', select=True, copy=False),

'raw_material_production_id': fields.many2one('mrp.production', 'Production Order for Raw Materials', select=True),

'consumed_for': fields.many2one('mrp.stockmove', 'Consumed for', help='Technical field used to make the traceability of produced products'),

}

def check_tracking(self, cr, uid, move, lot_id, context=None):

 .....................................

.............................


In these two inherited class has 'name' field 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/15/15, 7:34 AM
Seen: 397 times
Last updated: 7/16/15, 2:30 AM