Memory erron in openerp 6.1 - odoo

When physical inventory is been set to make the stock moves to zero value, it runs for a long time and throws an error like memory error.
Nearly 2000 products are in stock location we need to make the real stock zero.
ERROR:
File "/home/administrator/workspace/server/openerp/osv/osv.py", line 121, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/administrator/workspace/server/openerp/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/administrator/workspace/server/openerp/osv/osv.py", line 164, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/administrator/workspace/addons/stock/stock.py", line 2665, in action_done
move_obj.action_done(cr, uid, inventory_move_ids, context=context)
File "/home/administrator/workspace/addons/stock/stock.py", line 2253, in action_done
self._create_product_valuation_moves(cr, uid, move, context=context)
File "/home/administrator/workspace/addons/stock/stock.py", line 2187, in _create_product_valuation_moves
if move.product_id.valuation == 'real_time': # FIXME: product valuation should perhaps be a property?
File "/home/administrator/workspace/server/openerp/osv/orm.py", line 476, in __getattr__
return self[name]
File "/home/administrator/workspace/server/openerp/osv/orm.py", line 391, in __getitem__
field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
File "/home/administrator/workspace/server/openerp/osv/orm.py", line 3416, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/administrator/workspace/server/openerp/osv/orm.py", line 3476, in _read_flat
res.extend(cr.dictfetchall())
File "/usr/lib/python2.7/dist-packages/psycopg2/psycopg1.py", line 91, in dictfetchall
rows = _2cursor.fetchall(self)
MemoryError

Related

Bug in Odoo gamification addon

When I create a goal definition with:
computation mode : (Automatic: sum on a field,
Model : Sale Order Line,
Field to Sum : SubTotal)
When I add this goal definition to a challenge and try to start it, I get this traceback:
Client Traceback (most recent call last):
File "/home/openerp/server/openerp/addons/web/http.py", line 204, in dispatch
response["result"] = method(self, **self.params)
File "/home/openerp/server/openerp/addons/web/controllers/main.py", line 1132, in call_button
action = self._call_kw(req, model, method, args, {})
File "/home/openerp/server/openerp/addons/web/controllers/main.py", line 1120, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/home/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 "/home/openerp/server/openerp/addons/web/session.py", line 30, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/home/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 "/home/openerp/server/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/home/openerp/server/openerp/netsvc.py", line 296, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/home/openerp/server/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/home/openerp/server/openerp/osv/osv.py", line 190, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/openerp/server/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/openerp/server/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/openerp/server/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/openerp/server/openerp/addons/gamification/plan.py", line 342, in action_start
return self.generate_goals_from_plan(cr, uid, ids, context=context)
File "/home/openerp/server/openerp/addons/gamification/plan.py", line 439, in generate_goals_from_plan
goal_obj.update(cr, uid, [new_goal_id], context=context)
File "/home/openerp/server/openerp/addons/gamification/goal.py", line 278, in update
new_value = res and res[0][field_name] or 0.0
KeyError: u'price_subtotal'
this is a video that shows the scenario that I did: http://youtu.be/b546xTc1ArY

duplicate sale order NoneType ERROR

when i duplicate a sale order, show this error:
AttributeError: 'NoneType' object has no attribute 'search'
before this action works fine, but I don't know why this problem appears now.
here the detail of the error:
Server Traceback (most recent call last):
File "/openerp/sitios/onak/odoo-7.0/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/openerp/sitios/onak/odoo-7.0/openerp/netsvc.py", line 300, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/openerp/sitios/onak/odoo-7.0/openerp/service/web_services.py", line 632, in dispatch
res = fn(db, uid, *params)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/osv.py", line 190, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/openerp/sitios/onak/odoo-7.0/addons/sale_stock/sale_stock.py", line 49, in copy
return super(sale_order, self).copy(cr, uid, id, default, context=context)
File "/openerp/community/addons/nuevo/sale_payment_method/sale.py", line 93, in copy
default, context=context)
File "/openerp/community/addons/nuevo/sale_exceptions/sale.py", line 262, in copy
cr, uid, id, default=default, context=context)
File "/openerp/sitios/onak/odoo-7.0/addons/sale/sale.py", line 80, in copy
return super(sale_order, self).copy(cr, uid, id, default, context=context)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/orm.py", line 5171, in copy
data = self.copy_data(cr, uid, id, default, context)
File "/openerp/community/addons/nuevo/magentoerpconnect/sale.py", line 163, in copy_data
context=context)
File "/openerp/sitios/onak/odoo-7.0/addons/mail/mail_thread.py", line 331, in copy_data
return super(mail_thread, self).copy_data(cr, uid, id, default=default, context=context)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/orm.py", line 5083, in copy_data
lines = [other.copy_data(cr, uid, line_id, context=context) for line_id in sorted(data[f])]
File "/openerp/community/addons/nuevo/magentoerpconnect/sale.py", line 301, in copy_data
context=context)
File "/openerp/sitios/onak/odoo-7.0/addons/sale/sale.py", line 868, in copy_data
return super(sale_order_line, self).copy_data(cr, uid, id, default, context=context)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/orm.py", line 5068, in copy_data
data = self.read(cr, uid, [id], fields_to_copy.keys(), context=context)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/orm.py", line 3707, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/orm.py", line 3830, in _read_flat
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
File "/openerp/sitios/onak/odoo-7.0/openerp/osv/fields.py", line 542, in get
ids2 = obj.pool.get(self._obj).search(cr, user, domain + [(self._fields_id, 'in', ids)], limit=self._limit, context=context)
AttributeError: 'NoneType' object has no attribute 'search'
somebody may help me please..
regards,

Error Generation While upgrading the OpenERP Module

Error is generated while i am upgrading my module in OpenERP
res_model not found error
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 993, in load
menu_root_ids = self.get_user_roots(req)
File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 979, in get_user_roots
return Menus.search(menu_domain, 0, False, False, req.context) 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 190, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/opt/openerp/server/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/opt/openerp/server/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/openerp/server/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/openerp/server/openerp/addons/mail/mail_group_menu.py", line 44, in search
ids = super(ir_ui_menu, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=False)
File "/opt/openerp/server/openerp/addons/base/ir/ir_ui_menu.py", line 127, in search
result = self._filter_visible_menus(cr, uid, ids, context=context)
File "/opt/openerp/server/openerp/addons/base/ir/ir_ui_menu.py", line 103, in _filter_visible_menus
if not menu.child_id:
File "/opt/openerp/server/openerp/osv/orm.py", line 497, in __getattr__
return self[name]
File "/opt/openerp/server/openerp/osv/orm.py", line 405, in __getitem__
field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
File "/opt/openerp/server/openerp/osv/orm.py", line 3621, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/opt/openerp/server/openerp/osv/orm.py", line 3742, in _read_flat
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
File "/opt/openerp/server/openerp/osv/fields.py", line 538, in get
ids2 = obj.pool.get(self._obj).search(cr, user, domain + [(self._fields_id, 'in', ids)], limit=self._limit, context=context)
File "/opt/openerp/server/openerp/addons/mail/mail_group_menu.py", line 44, in search
ids = super(ir_ui_menu, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=False)
File "/opt/openerp/server/openerp/addons/base/ir/ir_ui_menu.py", line 127, in search
result = self._filter_visible_menus(cr, uid, ids, context=context)
File "/opt/openerp/server/openerp/addons/base/ir/ir_ui_menu.py", line 103, in _filter_visible_menus
if not menu.child_id:
File "/opt/openerp/server/openerp/osv/orm.py", line 499, in __getattr__
raise AttributeError(e)
AttributeError: 'Field res_model not found in browse_record(ir.actions.act_window, 494)'
This is rather ambiguous question.
What version of openERP is in problem here?
In OE7, only ir_act_window has res_model, I don't even see model that you provided (ir.actions.act_window). Same in OE8.
If you could specify what is going, is this your module/extension? It would help a lot.
In my case, I have deleted a xml file for which menu item is created.As i have deleted the file,the menu item is searching for it and it is throwing the error.So finally i resolved the issue by deleting the Menu item.

Odoo 8 error when trying to open customer

I am using Odoo 8 on Ubuntu.
I have problem opening some customers (some are OK). When I try to open it for editing I get Odoo Server Error...IndexError: list index out of range.
Any idea what could cause this problem ? I tried to search for similar problems but I have not found any solution. So when I want to edit the client I have to create new one, I also tried to merge them after creating new one but the error reappears again.
thank you and here is complete traceback:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/openerp/http.py", line 300, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/odoo/openerp/http.py", line 796, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/openerp/http.py", line 396, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 949, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 932, in _call_kw
records = getattr(request.session.model(model), method)(*args, **kwargs)
File "/opt/odoo/odoo/openerp/http.py", line 900, in proxy
result = meth(cr, request.uid, *args, **kw)
File "/opt/odoo/odoo/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3109, in read
result = BaseModel.read(records, fields, load=load)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3141, in read
self._read_from_database(stored)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3305, in _read_from_database
res2 = self._columns[f].get(cr, self._model, ids, f, user, context=context, values=result)
File "/opt/odoo/odoo/openerp/osv/fields.py", line 1361, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/opt/odoo/odoo/addons/account/partner.py", line 246, in _invoice_total
result[partner.id] = sum(inv.user_currency_price_total for inv in invoices)
File "/opt/odoo/odoo/addons/account/partner.py", line 246, in <genexpr>
result[partner.id] = sum(inv.user_currency_price_total for inv in invoices)
File "/opt/odoo/odoo/openerp/fields.py", line 760, in __get__
self.determine_value(record)
File "/opt/odoo/odoo/openerp/fields.py", line 853, in determine_value
record._prefetch_field(self)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3196, in _prefetch_field
result = records.read(list(fnames), load='_classic_write')
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3141, in read
self._read_from_database(stored)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3292, in _read_from_database
res2 = self._columns[fs[0]].get(cr, self._model, ids, fs, user, context=context, values=result)
File "/opt/odoo/odoo/openerp/osv/fields.py", line 1361, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/opt/odoo/odoo/addons/account/report/account_invoice_report.py", line 40, in _compute_amounts_in_user_currency
currency_rate_id = currency_rate_obj.search(cr, uid, [('rate', '=', 1)], limit=1, context=context)[0]
IndexError: list index out of range
in the searching of currency_rate_id, the search function is getting an empty list and you are trying to select the first element from the empty list which causes the error
The solution is to add an exchange rate for the currency.
1 - Settings->Companies
2 - Edit your commpany
3 - Modify the Currency update configuration
4 - Add values for "Currencies to update" tab
Image 1
Image 2
Image 3

How to create a many2one field in OpenERP 7

There are no docs for OpenERP 7 for this: I am trying to create a field with many2one relation from the webclient. I did the following:
1st step created a model and assigned some fields to it
2nd I created a field and mapped the model from the field and when I append that field in view I have been getting this error
Client Traceback (most recent call last):
File "/opt/openerp/web/addons/web/http.py", line 195, in dispatch
response["result"] = method(self, **self.params)
File "/opt/openerp/web/addons/web/controllers/main.py", line 1085, in call_kw
return self._call_kw(req, model, method, args, kwargs)
File "/opt/openerp/web/addons/web/controllers/main.py", line 1077, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/opt/openerp/web/addons/web/session.py", line 40, in proxy
result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
File "/opt/openerp/web/addons/web/session.py", line 28, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/opt/openerp/web/addons/web/session.py", line 101, in send
raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)
Server Traceback (most recent call last):
File "/opt/openerp/web/addons/web/session.py", line 87, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/opt/openerp/server/openerp/netsvc.py", line 361, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/server/openerp/service/web_services.py", line 601, in dispatch
res = fn(db, uid, *params)
File "/opt/openerp/server/openerp/osv/osv.py", line 167, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/opt/openerp/server/openerp/osv/osv.py", line 121, in wrapper
return f(self, dbname, *args, **kwargs)
File "/opt/openerp/server/openerp/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/openerp/server/openerp/osv/osv.py", line 164, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/openerp/server/openerp/osv/orm.py", line 2389, in name_search
return self._name_search(cr, user, name, args, operator, context, limit)
File "/opt/openerp/server/openerp/osv/orm.py", line 2420, in _name_search
ids = self._search(cr, user, args, limit=limit, context=context, access_rights_uid=access_rights_uid)
File "/opt/openerp/server/openerp/osv/orm.py", line 4773, in _search
query = self._where_calc(cr, user, args, context=context)
File "/opt/openerp/server/openerp/osv/orm.py", line 4622, in _where_calc
e = expression.expression(cr, user, domain, self, context)
File "/opt/openerp/server/openerp/osv/expression.py", line 371, in __init__
self.parse(cr, uid, distribute_not(normalize(exp)), table, context)
File "/opt/openerp/server/openerp/osv/expression.py", line 468, in parse
raise ValueError("Invalid field %r in domain expression %r" % (left, exp))
ValueError: Invalid field 'x_totalexp' in domain expression ['&', '&', ('x_totalexp', '=', 0), ['id', 'not in', []], ('name', 'ilike', 's')]
Is this a bug or i am doing it wrong
Its working now. I also faced the same problem but after "bzr pull", problem get solved.
Just update your 7.0 addons, web & server.