Odoo Help


Problem in bill of material

on 8/28/13, 5:38 AM 1,058 views

i have a problem in my bill of material ,the problem in if i select the product in BOM it shouldn't save without product lines but it's not please help me very urgent ,here my code

def create(self,cr,uid,vals,context=None): print vals,"hklhnhkjnknknkj" if 'bom_lines' in vals: if vals['bom_lines'] == []: raise osv.except_osv(_('Error!'), _("Cannot find a bill of material for this product.")) return super(mrp_bom, self).create(cr, uid, vals, context=context) def write(self,cr,uid,ids,vals,context=None): for mrp in self.browse(cr,uid,ids): print mrp #~ if line== []: #~ raise osv.except_osv(_('Error!'), _("Cannot find a bill of material for this product.")) return super(mrp_bom, self).write(cr, uid, id, vals, context=context

ERRORS: this is my errors:

OpenERP Server Error

Client Traceback (most recent call last): File "/opt/openerp/server/openerp/addons/web/http.py", line 204, in dispatch response["result"] = method(self, *self.params) File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1128, in call_kw return self._call_kw(req, model, method, args, kwargs) File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1120, in _call_kw return getattr(req.session.model(model), method)(args, **kwargs) File "/opt/openerp/server/openerp/addons/web/session.py", line 42, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/opt/openerp/server/openerp/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args) File "/opt/openerp/server/openerp/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/opt/openerp/server/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/opt/openerp/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/opt/openerp/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/opt/openerp/server/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/opt/openerp/server/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, args, *kwargs) File "/opt/openerp/server/openerp/osv/osv.py", line 197, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/opt/openerp/server/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/opt/openerp/server/openerp/addons/mrp/mrp.py", line 277, in write return super(mrp_bom, self).write(cr, uid, id, vals, context=context) File "/opt/openerp/server/openerp/addons/mail/mail_thread.py", line 275, in write result = super(mail_thread, self).write(cr, uid, ids, values, context=context) File "/opt/openerp/server/openerp/osv/orm.py", line 4148, in write for sub_ids in cr.split_for_in_conditions(ids): File "/opt/openerp/server/openerp/sql_db.py", line 258, in split_for_in_conditions return tools.misc.split_every(self.IN_MAX, set(ids)) TypeError: 'builtin_function_or_method' object is not iterable

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 8/28/13, 5:38 AM
Seen: 1058 times
Last updated: 3/16/15, 8:10 AM