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

OpenERP Server Error After Installing Delivery Costs in Odoo 8

By
Tim
on 11/10/14, 4:26 PM 2,362 views

Hello,


After installing the Delviery Costs Module when i try to confirm a sales or purcahse order i get the following error:

Odoo

OpenERP Server Error

Traceback (most recent call last): File "/opt/odoo/odoo-server/openerp/http.py", line 500, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo-server/openerp/http.py", line 517, in dispatch result = self._call_function(**self.params) File "/opt/odoo/odoo-server/openerp/http.py", line 283, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/http.py", line 280, in checked_call return self.endpoint(*a, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 733, in __call__ return self.method(*args, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 376, in response_wrap response = f(*args, **kw) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 952, in call_button action = self._call_kw(model, method, args, {}) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 940, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/portal_sale/portal_sale.py", line 67, in action_button_confirm return super(sale_order, self).action_button_confirm(cr, uid, ids, context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/sale/sale.py", line 598, in action_button_confirm self.signal_workflow(cr, uid, ids, 'order_confirm') File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 3482, in signal_workflow result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr) File "/opt/odoo/odoo-server/openerp/workflow/__init__.py", line 85, in trg_validate return WorkflowService.new(cr, uid, res_type, res_id).validate(signal) File "/opt/odoo/odoo-server/openerp/workflow/service.py", line 91, in validate res2 = wi.validate(signal) File "/opt/odoo/odoo-server/openerp/workflow/instance.py", line 75, in validate wi.process(signal=signal, force_running=force_running, stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 120, in process ok = self._split_test(activity['split_mode'], signal, stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 248, in _split_test self._join_test(t[0], t[1], stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 257, in _join_test WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 95, in create workflow_item.process(stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 120, in process ok = self._split_test(activity['split_mode'], signal, stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 248, in _split_test self._join_test(t[0], t[1], stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 257, in _join_test WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 95, in create workflow_item.process(stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 120, in process ok = self._split_test(activity['split_mode'], signal, stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 248, in _split_test self._join_test(t[0], t[1], stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 257, in _join_test WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 95, in create workflow_item.process(stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 116, in process if not self._execute(activity, stack): File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 162, in _execute returned_action = self.wkf_expr_execute(activity) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 313, in wkf_expr_execute return self.wkf_expr_eval_expr(activity['action']) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 291, in wkf_expr_eval_expr result = eval(line, env, nocopy=True) File "/opt/odoo/odoo-server/openerp/tools/safe_eval.py", line 313, in safe_eval return eval(c, globals_dict, locals_dict) File "", line 1, in <module> File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/api.py", line 552, in new_api result = method(self._model, cr, uid, self.ids, *args, **kwargs) File "/opt/odoo/odoo-server/addons/sale/sale.py", line 723, in action_ship_create procurement_obj.run(cr, uid, proc_ids, context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/stock/procurement.py", line 210, in run res = super(procurement_order, self).run(cr, uid, new_ids, autocommit=autocommit, context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/procurement/procurement.py", line 207, in run res = self._run(cr, uid, procurement, context=context or {}) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/purchase/purchase.py", line 1185, in _run return super(procurement_order, self)._run(cr, uid, procurement, context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/stock/procurement.py", line 204, in _run move_obj.create(cr, SUPERUSER_ID, move_dict, context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/api.py", line 332, in old_api result = method(recs, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 3949, in create vals = self._add_missing_default_values(vals) File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/api.py", line 464, in new_api result = method(self._model, cr, uid, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 1829, in _add_missing_default_values defaults = self.default_get(cr, uid, list(missing_defaults), context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/api.py", line 332, in old_api result = method(recs, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 1356, in default_get defaults[name] = field.default(self) File "/opt/odoo/odoo-server/openerp/fields.py", line 379, in <lambda> func(recs), recs, validate=False, File "/opt/odoo/odoo-server/openerp/fields.py", line 375, in <lambda> func = lambda recs: value(recs._model, recs._cr, recs._uid, recs._context) File "/opt/odoo/odoo-server/addons/delivery/stock.py", line 178, in <lambda> 'weight_uom_id': lambda self, cr, uid, c: self._get_default_uom(cr, uid, c), File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/delivery/stock.py", line 175, in _get_default_uom return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0] ValueError: "list index out of range" while evaluating u'action_ship_create()'

 

Thanks in advance for the Help!

 

0
shashank verma
On 11/11/14, 6:06 AM

Hello TIm,

.self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0]

this error occurs when system trying to access values from empty list like [].
In your case your product couldnt able to find its unit of measure. I feel you might have customised your modules which producing this error coz on my system it works fine.

Solution:
    Install latest addons from http://nightly.odoo.com/
            OR
    Do exception handling of your customised script
            OR
    change following code:
       old
    self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0]

        new
    self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])
        

 

 

Hello Shashank, The only thing i did was i wanted the gross and net weight of a product to be in lbs so i made it as the reference weight. And it started to give me this error. Also when i tired to set it back to KG, nothing changed. Did i do something incorrect?

Tim
on 11/11/14, 2:39 PM
0
Nayan Jain
On 1/6/15, 6:16 AM

Hello Tim,

When you confirm sales order, the weight of entrie pakage to be delivered is calculated. This requires atleast one unit of measure(UOM) sould have Its product category to be Weight.

Define a new UOM, assign its Category to be Weight and Factor 1.0. It should work. 

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: 11/10/14, 4:26 PM
Seen: 2362 times
Last updated: 3/16/15, 8:10 AM