This question has been flagged

Using OpenERP 7

  • Create a draft customer refund (or an invoice)
  • Add an invoice line
  • Leave empty the product column. Fill in the other fields
  • and Save the draft object

It should display an error message because of the missing product reference, but it does not and the draft Customer refund (or invoice) is saved anyway.

Then, if you want to edit / delete it, you get an integrity server error :

    OpenERP Server Error
Client Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/http.py", line 204, in dispatch
    response["result"] = method(self, **self.params)
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/controllers/main.py", line 1139, in exec_workflow
    return req.session.exec_workflow(model, id, signal)
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/session.py", line 147, in exec_workflow
    r = self.proxy('object').exec_workflow(self._db, self._uid, self._password, model, signal, id)
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/session.py", line 30, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/usr/lib/pymodules/python2.6/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 "/usr/lib/pymodules/python2.6/openerp/addons/web/session.py", line 89, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/lib/pymodules/python2.6/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.6/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 220, in exec_workflow
    res = self.exec_workflow_cr(cr, uid, obj, signal, *args)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 213, in exec_workflow_cr
    return object._workflow_signal(cr, uid, [res_id], signal)[res_id]
  File "/usr/lib/pymodules/python2.6/openerp/osv/orm.py", line 3926, in _workflow_signal
    result[res_id] = wf_service.trg_validate(uid, self._name, res_id, signal, cr)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/wkf_service.py", line 119, in trg_validate
    res2 = instance.validate(cr, id, ident, signal)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/instance.py", line 43, in validate
    workitem.process(cr, witem, ident, signal, force_running, stack=stack)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/workitem.py", line 52, in process
    result = _execute(cr, workitem, activity, ident, stack)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/workitem.py", line 106, in _execute
    returned_action = wkf_expr.execute(cr, ident, workitem, activity)
  File "/usr/lib/pymodules/python2.6/openerp/workflow/wkf_expr.py", line 67, in execute
    return _eval_expr(cr, ident, workitem, activity['action'])
  File "/usr/lib/pymodules/python2.6/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
    ret = eval(line, env, nocopy=True)
  File "/usr/lib/pymodules/python2.6/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/openerp/addons/account/account_invoice.py", line 1127, in action_cancel
    self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
  File "/opt/talika-erp/addons/account_invoice_ext/account_invoice_ext.py", line 23, in write
    self.button_reset_categories(cr, uid, ids)
  File "/opt/talika-erp/addons/account_invoice_ext/account_invoice_ext.py", line 17, in button_reset_categories
    for category in aic_obj.compute(cr, uid, id, context=ctx).values():
  File "/opt/talika-erp/addons/account_invoice_ext/account_invoice_ext.py", line 52, in compute
    template = self.pool.get('product.template').browse(cr, uid, product.product_tmpl_id.id, context=context)
  File "/usr/lib/pymodules/python2.6/openerp/osv/orm.py", line 484, in __getattr__
    return self[name]
  File "/usr/lib/pymodules/python2.6/openerp/osv/orm.py", line 399, in __getitem__
    field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
  File "/usr/lib/pymodules/python2.6/openerp/osv/orm.py", line 3604, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/usr/lib/pymodules/python2.6/openerp/osv/orm.py", line 3656, in _read_flat
    cr.execute(query, [tuple(sub_ids)] + rule_params)
  File "/usr/lib/pymodules/python2.6/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
ProgrammingError: operator does not exist: integer = boolean
LINE 1: ...d FROM "product_product" WHERE product_product.id IN (false)...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

Thanks for your help,

Avatar
Discard
Best Answer

I just tried this on today's build of the software - 20724.

A product is not required on an Invoice (you will see that this field is not blue) - so there is no error message built in to the software and one won't show (this can be added, or you can make the field required if you need to).

I was able to save and edit the draft refund invoice without any problems.

So - why can't you?

There is a custom module installed - talika-erp/addons/account_invoice_ext and the account_invoice_ext.py is throwing an error.

You can verify this is the problem by uninstalling this module and trying again.

Contact the author of the module, or investigate this yourself to get further.

Avatar
Discard