Odoo Help


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.


What does this error mean? TypeError: must be string, not bool

on 10/16/14, 2:27 AM 2,475 views

I'm changing the date of my data but when i'd tried to save this an error appeared. any help please.

File "/opt/openerp/server-7/openerp/addons/web/session.py", line 90, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/opt/openerp/server-7/openerp/netsvc.py", line 293, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/opt/openerp/server-7/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, *params) File "/opt/openerp/server-7/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, *args, **kw or {}) File "/opt/openerp/server-7/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, *args, **kwargs) File "/opt/openerp/server-7/openerp/osv/osv.py", line 197, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "/opt/openerp/server-7/openerp/addons/audittrail/audittrail.py", line 514, in execute_cr return fct_src(cr, uid, model, method, *args, **kw) File "/opt/openerp/server-7/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/opt/openerp/server-7/openerp/addons/mrp_operations/mrp_operations.py", line 156, in write prod_obj.write(cr, uid, [prod.production_id.id], {'date_start':dstart}, context=context, mini=False) File "/opt/openerp/server-7/openerp/addons/mrp_operations/mrp_operations.py", line 358, in write self._compute_planned_workcenter(cr, uid, ids, context=context, mini=mini) File "/opt/openerp/server-7/openerp/addons/mrp_operations/mrp_operations.py", line 294, in _compute_planned_workcenter

dt_end = datetime.strptime(wc.date_planned_end, '%Y-%m-%d %H:%M:%S')

TypeError: must be string, not bool

Piyush Suva
On 10/16/14, 2:54 AM

May be date_planned_end coantain False Value 

So just check first value of date_planned_end using print statement.

If there is posibility of False value of date_planned_end

use this code:

dt_end = False

if wc.date_planned_end:

    dt_end = datetime.strptime(wc.date_planned_end, '%Y-%m-%d %H:%M:%S')

thanks Piyush

on 10/16/14, 3:17 AM
Gaurav Marsoniya
On 10/16/14, 2:53 AM

Hi Lee

You tried to change date_planned_end date formate but  i guess date_planned_end field is empty in your database so in this case openerp framework return @false boolean value plz debug ur code and find out way wc.date_planned return false value


thanks Gaurav

on 10/16/14, 3:18 AM

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)


Asked: 10/16/14, 2:27 AM
Seen: 2475 times
Last updated: 3/16/15, 8:10 AM