# -*- coding: utf-8 -*-
##############################################################################
#
#    Odoo, Open Source Management Solution
#    Copyright (C) 2016 Prime Consulting SA, Cape Verde (<http://prime.cv>).
#
##############################################################################

from odoo import models, fields, api

class Users(models.Model):
    _inherit = "res.users"

    @api.model
    def create(self, vals):
        """Set Customer, Supplier to False on Partners created from Users
        """
        res = super(Users, self).create(vals)
        if res and res.partner_id:
            res.partner_id.write({'customer': False, 'supplier': False})
        return res