Error while creating invoices - odoo

An attempt to create invoices in bulk fails with the error as below :
Integrity error:-
The operation can not be completed, probably due to following you may be trying to delete a record while other records still reference it.
-creation/updation :a mandatory field is not set
object with reference :Sales order -sale.order
What am I missing?
4-24 05:41:32,637 4190 ERROR odoo_production_6 openerp.addons.base.ir.ir_cron: Call of self.pool.get('product.from_button').price_import_file(cr, uid, *()) failed in Job 29
Traceback (most recent call last):
File "/mnt/odoo/openerp/addons/base/ir/ir_cron.py", line 138, in _callback
getattr(model, method_name)(cr, uid, *args)
File "/mnt/odoo/openerp/api.py", line 237, in wrapper
return old_api(self, *args, **kwargs)
TypeError: price_import_file() takes at least 4 arguments (3 given)
2015-04-24 05:41:52,947 4190 ERROR odoo_production_6 openerp.sql_db: bad query: INSERT INTO "account_move" ("id", "name", "company_id", "journal_id", "state", "period_id", "narration", "date", "ref", "to_check", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('account_move_id_seq'), '/', 1, 2, 'draft', 5, '', '2015-04-19', 'SO99761', false, 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id
Traceback (most recent call last):
File "/mnt/odoo/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
TransactionRollbackError: could not serialize access due to concurrent update
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"."res_users" x WHERE "id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x"
2015-04-24 05:41:52,948 4190 ERROR odoo_production_6 openerp.addons.base.ir.ir_cron: Call of self.pool.get('warehouse.picklist').create_invoices(cr, uid, *(['R105743853', 'R113227005', 'R146600137', 'R188375618', 'R220118225', 'R351012872', 'R420506806', 'R421507556', 'R426354681', 'R434108532', 'R441768276', 'R502478873', 'R571730346', 'R605517828', 'R630802333', 'R635404642', 'R654263524', 'R664533651', 'R685142753', 'R724478234', 'R761380645', 'R775785828', 'R776745047', 'R786383714', 'R820154123', 'R825637222', 'R826210504', 'R857286181', 'R858340517', 'R868485853'],)) failed in Job 31
Traceback (most recent call last):
File "/mnt/odoo/openerp/addons/base/ir/ir_cron.py", line 138, in _callback
getattr(model, method_name)(cr, uid, *args)
File "/mnt/odoo/openerp/api.py", line 237, in wrapper
return old_api(self, *args, **kwargs)
File "/mnt/odoo/voylla_modules/outbound/outbound.py", line 215, in create_invoices
invoice_confirm_obj.invoice_confirm_1(cr, uid, invoice_ids, context)
File "/mnt/odoo/openerp/api.py", line 237, in wrapper

Please check your code, you probably made some field required on sale.order or account.invoice. And you should have overridden the method for creating invoice.

Related

External ID not found

Odoo Server Error
Traceback (most recent call last):
File "/home/odoo/src/odoo/14.0/odoo/tools/cache.py", line 85, in lookup
r = d[key]
File "/home/odoo/src/odoo/14.0/odoo/tools/func.py", line 71, in wrapper
return func(self, *args, **kwargs)
File "/home/odoo/src/odoo/14.0/odoo/tools/lru.py", line 34, in getitem
a = self.d[obj]
KeyError: ('ir.model.data', <function IrModelData.xmlid_lookup at 0x7f5794273a60>, 'account.account_invoices_without_payment')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/odoo/src/odoo/14.0/addons/web/controllers/main.py", line 2121, in report_download
response = self.report_routes(reportname, docids=docids, converter=converter, context=context)
File "/home/odoo/src/odoo/14.0/odoo/http.py", line 532, in response_wrap
response = f(*args, **kw)
File "/home/odoo/src/odoo/14.0/addons/web/controllers/main.py", line 2056, in report_routes
pdf = report.with_context(context)._render_qweb_pdf(docids, data=data)[0]
File "/home/odoo/src/odoo/14.0/addons/account/models/ir_actions_report.py", line 41, in _render_qweb_pdf
invoice_reports = (self.env.ref('account.account_invoices_without_payment'), self.env.ref('account.account_invoices'))
File "/home/odoo/src/odoo/14.0/odoo/api.py", line 511, in ref
return self['ir.model.data'].xmlid_to_object(xml_id, raise_if_not_found=raise_if_not_found)
File "/home/odoo/src/odoo/14.0/odoo/addons/base/models/ir_model.py", line 1944, in xmlid_to_object
t = self.xmlid_to_res_model_res_id(xmlid, raise_if_not_found)
File "/home/odoo/src/odoo/14.0/odoo/addons/base/models/ir_model.py", line 1928, in xmlid_to_res_model_res_id
return self.xmlid_lookup(xmlid)[1:3]
File "", line 2, in xmlid_lookup
File "/home/odoo/src/odoo/14.0/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/home/odoo/src/odoo/14.0/odoo/addons/base/models/ir_model.py", line 1921, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system:
account.account_invoices_without_payment
The error occurs when I tried to print an invoice. It happens even if I choose an empty print template. Any help?Thanks.
In my opinion, you should be check table ir_model_data with name=account.account_invoices_without_payment. If you can find, you must update module account. If you can't find, you can be insert new record table ir_model_data with name and res_id = id view account_invoices_without_payment in ir_ui_view.
May be help you.
Please upgrade the module account and make sure that the db using correctly. You can give db-filter to choose the db correctly
After checking in the settings-> external id. I find that somehow this external id got deleted for unknown reason. I opened an new database and compared and find that this is the case then I create a new eternal id according to the new db's value.

Using TIA to pull FX rates from BBG?

I'm trying to use the TIA module to pull EURUSD forward rates from the BBG API? How does one go about doing this?
I tried using the BbgDataManager() to specify a specific forward rate but don't seem to be having any success. The code I tried is below.
df = mgr['EURUSD Curncy','FWD_CURVE']
df
MultiSidAccessor(EURUSD Curncy,FWD_CURVE)
df.FWD_CURVE
Produces the following error message:
File "", line 1
df.EURUSD Curncy
^
SyntaxError: invalid syntax
df.FWD_CURVE
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\datamgr.py", line 85, in getattribute
return self.get_attributes(item, **self.overrides)
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\datamgr.py", line 90, in get_attributes
frame = self.mgr.get_attributes(self.sids, flds, **overrides)
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\datamgr.py", line 148, in get_attributes
return self.terminal.get_reference_data(sids, flds, **overrides).as_frame()
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\v3api.py", line 745, in get_reference_data
return self.execute(req)
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\v3api.py", line 729, in execute
request.has_exception and request.raise_exception()
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\v3api.py", line 215, in raise_exception
raise Exception('SecurityError: %s' % ','.join(msgs))
Exception: SecurityError: (FWD_CURVE, BAD_SEC, Unknown/Invalid Security [nid:2972] )
Similarly, using the mgr with a query similar to the way you would pull this in Excel using BFxForward produces errors..
eurusd_sids = mgr["eurusd curncy","9/12/2019","midoutright"]\
eurusd_sids.PX_LAST
produces this error message:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\datamgr.py", line 85, in getattribute
return self.get_attributes(item, **self.overrides)
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\datamgr.py", line 90, in get_attributes
frame = self.mgr.get_attributes(self.sids, flds, **overrides)
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\datamgr.py", line 148, in get_attributes
return self.terminal.get_reference_data(sids, flds, **overrides).as_frame()
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\v3api.py", line 745, in get_reference_data
return self.execute(req)
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\v3api.py", line 729, in execute
request.has_exception and request.raise_exception()
File "C:\Users\anthony.yeh\PycharmProjects\blpapi\venv\lib\site-packages\tia\bbg\v3api.py", line 215, in raise_exception
raise Exception('SecurityError: %s' % ','.join(msgs))
Exception: SecurityError: (9/12/2019, BAD_SEC, Unknown/Invalid Security [nid:2972] ),(midoutright, BAD_SEC, Unknown/Invalid Security [nid:2972] )
You may try with "EURUSD BGN Curncy"

What does "Received a NULL pointer" mean by?

I attempted to execute gdal_array.SaveArray, while the error prompted as follows:
Traceback (most recent call last):
File "D:/Python34/Mycase/gdalarray_use.py", line 5, in
gdal_array.SaveArray(band1,"D:/PyGDAL_Case/dem_cjz.tif",format="GTiff")
File "D:\Python34\lib\site-packages\osgeo\gdal_array.py", line 240, in SaveArray
return driver.CreateCopy( filename, OpenArray(src_array,prototype) )
File "D:\Python34\lib\site-packages\osgeo\gdal.py", line 1478, in CreateCopy
return _gdal.Driver_CreateCopy(self, *args, **kwargs)
ValueError: Received a NULL pointer.
The issue seems to be related to _gdal.Driver_CreateCopy,right? And I don't konw what is the meaning of "Received a Null pointer".
What measures should I take to tackle this problem?

Unknown report type: webkit Error when printing report?

I been with the following error for the past few days and I can't get a clue how to proceed.
The full error is:
2015-01-26 17:29:25,162 21218 ERROR myodoo openerp.service.report: Exception: Unknown report type: webkit
Traceback (most recent call last):
File "/opt/odoo/openerp/service/report.py", line 93, in go
result, format = openerp.report.render_report(cr, uid, ids, object, datas, context)
File "/opt/odoo/openerp/report/__init__.py", line 40, in render_report
return registry['ir.actions.report.xml'].render_report(cr, uid, ids, name, data, context)
File "/opt/odoo/openerp/api.py", line 237, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/openerp/addons/base/ir/ir_actions.py", line 155, in render_report
return new_report.create(cr, uid, res_ids, data, context)
File "/opt/odoo/openerp/report/report_sxw.py", line 391, in create
raise NotImplementedError(_('Unknown report type: %s') % report_type)
NotImplementedError: Unknown report type: webkit
2015-01-26 17:29:25,397 21218 ERROR myodoo openerp.addons.web.controllers.main: An exception occured during an http request
Traceback (most recent call last):
File "/opt/odoo/addons/web/controllers/main.py", line 69, in wrap
return f(*args, **kwargs)
File "/opt/odoo/addons/web/controllers/main.py", line 1576, in index
request.session.db, request.session.uid, request.session.password, report_id)
File "/opt/odoo/openerp/http.py", line 807, in proxy_method
result = dispatch_rpc(self.service_name, method, args)
File "/opt/odoo/openerp/http.py", line 100, in dispatch_rpc
result = dispatch(method, params)
File "/opt/odoo/openerp/service/report.py", line 34, in dispatch
res = fn(db, uid, *params)
File "/opt/odoo/openerp/service/report.py", line 141, in exp_report_get
return _check_report(report_id)
File "/opt/odoo/openerp/service/report.py", line 119, in _check_report
raise openerp.osv.orm.except_orm(exc.message, exc.traceback)
except_orm: (u'Unknown report type: webkit', (<type 'exceptions.NotImplementedError'>, NotImplementedError(u'Unknown report type: webkit',), <traceback object at 0x7fa2f9af8dd0>))
I been developing on my module so I thought it was something I touched, but even when I install previous working versions of the module I still get the same error.
That makes me feel that there might be a change in the system but I checked if wkhtmltopdf is working and everything seems normal.
Any clue on where to look will be really appreciated.
Thanks!
It can be that you don't have the Webkit report engine installed.
Check if the report_webkit module is installed.

Openerp Login Error

I've been getting this error and can't view the user's list and projects/task or even login using the user's login information.
Can anyone help me..
Thank you.
OpenERP Server Error
Client Traceback (most recent call last):
File "/opt/openerp/server/openerp/addons/web/http.py", line 195, in dispatch
response["result"] = method(self, **self.params)
File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1012, in search_read
return self.do_search_read(req, model, fields, offset, limit, domain, sort)
File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1047, in do_search_read
records = Model.read(ids, fields or False, req.context)
File "/opt/openerp/server/openerp/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/server/openerp/addons/web/session.py", line 28, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/opt/openerp/server/openerp/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/server/openerp/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/addons/base/res/res_users.py", line 796, in read
res = super(users_view, self).read(cr, uid, ids, fields, context=context, load=load)
File "/opt/openerp/server/openerp/addons/base/res/res_users.py", line 272, in read
result = super(res_users, self).read(cr, uid, ids, fields=fields, context=context, load=load)
File "/opt/openerp/server/openerp/osv/orm.py", line 3575, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/opt/openerp/server/openerp/osv/orm.py", line 3660, in _read_flat
record.update(res3[record[col]])
KeyError: 3
Error shows that record for id 3 is not exist in database.
When you try to read the data from database its delete the record which you are trying to read.
Please reconnect and try to open project/task.
It's difficult to find the error with only that information, but I had several times a Key Error due to a problem updating the openerp server, and after updating again all, the problem dissapeared.
Try to update the module base from the user interface, and if that doesn't work, try to restart and update all the openerp server from the console.
Take a backup of database ,delete the current database and create a new one, later you can import all your data.
if there is any functional field, please check it. This kind of key error will raise in functional fields while returning the values in a desired format.