[FIX] mail: prevent wrong sql query in some cases
[FIX] mail: prevent wrong sql query in some cases

Sometimes, the variable partner_id is False (on first connections).  This leads to a
crash because partner_id is a boolean instead of an integer. This commits simply
sidestep the problem.

laslabs/odoo,storm-computers/odoo,laslabs/odoo,sysadminmatmoz/OCB,syci/OCB,hip-odoo/odoo,dfang/odoo,sysadminmatmoz/OCB,ygol/odoo,laslabs/odoo,ygol/odoo,sysadminmatmoz/OCB,Elico-Corp/odoo_OCB,dfang/odoo,dfang/odoo,optima-ict/odoo,Elico-Corp/odoo_OCB,dfang/odoo,stephen144/odoo,sysadminmatmoz/OCB,stephen144/odoo,ygol/odoo,laslabs/odoo,bplancher/odoo,microcom/odoo,ygol/odoo,stephen144/odoo,Elico-Corp/odoo_OCB,syci/OCB,Elico-Corp/odoo_OCB,Elico-Corp/odoo_OCB,storm-computers/odoo,stephen144/odoo,hip-odoo/odoo,optima-ict/odoo,syci/OCB,optima-ict/odoo,sysadminmatmoz/OCB,optima-ict/odoo,microcom/odoo,sysadminmatmoz/OCB,optima-ict/odoo,laslabs/odoo,bplancher/odoo,microcom/odoo,ygol/odoo,hip-odoo/odoo,storm-computers/odoo,stephen144/odoo,microcom/odoo,Elico-Corp/odoo_OCB,storm-computers/odoo,stephen144/odoo,hip-odoo/odoo,bplancher/odoo,hip-odoo/odoo,microcom/odoo,syci/OCB,laslabs/odoo,microcom/odoo,sysadminmatmoz/OCB,ygol/odoo,dfang/odoo,storm-computers/odoo,dfang/odoo,optima-ict/odoo,bplancher/odoo,ygol/odoo,storm-computers/odoo,bplancher/odoo,syci/OCB,hip-odoo/odoo,syci/OCB,bplancher/odoo