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

ProgrammingError: operator does not exist: integer = boolean

By
Aijay Ogbugha
on 7/3/13, 9:51 AM 725 views

Thank you guys for your help with my previous questions. I've been able to pass that stage. Now am getting another this "programming error" : ProgrammingError: operator does not exist: integer = boolean LINE 1: ...,res_users.id FROM "res_users" WHERE res_users.id IN (false)... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

The form I created is supposed to be approved at two levels. Below is my method:

   def create_store_voucher_approvals(self,cr,uid, ids, context=None):
        store_voucher = self.browse(cr, uid, ids, context=context)
        department = store_voucher[0].department_id
        manager_id = department.manager_id.id
        manager_user_id = department.manager_id.user_id.id
        store_voucher_id = [ids[0]]
        store_voucher_approval_obj = self.pool.get('store.voucher.approval')

        store_voucher_approvals = store_voucher_approval_obj.search(cr, uid, [('store_voucher_id','=',store_voucher_id)])


    if not store_voucher_approvals:
        cr.execute("DELETE FROM store_voucher_approval WHERE store_voucher_id=%s", store_voucher_id)
        store_voucher_approval_obj.create(cr, uid, {
                                                     'state': 'in_progress',
                                                     'employee_id': manager_id,
                                                     'store_voucher_id': store_voucher_id[0],
                                                     'role': department.manager_id.job_id.name,
                                                     'can_approve': True
                                                    })
        store = store_voucher[0]                                            
        self.message_subscribe_users(cr, SUPERUSER_ID, [store.id] , user_ids=[manager_user_id], context=context)
        manager_id = self.pool.get('store.voucher.manager').search(cr, uid, [])
        store_voucher_managers= self.pool.get('store.voucher.manager').browse(cr, uid,manager_id)
        for store_voucher_manager in store_voucher_managers:
            manager_id = store_voucher_manager.employee_id.id
            manager_user_id = store_voucher_manager.employee_id.user_id.id
            store_voucher_approval_obj.create(cr, uid, {
                                                     'state': 'in_progress',
                                                     'employee_id': manager_id,
                                                     'store_voucher_id': store_voucher_id[0],
                                                     'role': store_voucher_manager.role
                                                    })

        self.message_subscribe_users(cr, SUPERUSER_ID, [store.id] , user_ids=[manager_user_id], context=context)
    return True

Please does anyone know why am getting this error? And how can I solve it?? thank you

0

Ghanshyam Prajapati

--Ghanshyam Prajapati--
1377
| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 7/3/13, 10:05 AM

Hi Jay, Trace your code using,

print "manager_user_id",manager_user_id

then check what you find in terminal,

I am sure while you fetching manager_user_id , you will got false at that time. try to set user_id in your department's manager's id.

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

0 follower(s)

Stats

Asked: 7/3/13, 9:51 AM
Seen: 725 times
Last updated: 3/16/15, 8:10 AM