Partners auto-created when you create a user should have customer=False and supplier=True
This commit is contained in:
committed by
Raphaël Valyi
parent
bd9979a87d
commit
dc287c243b
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import users
|
||||
from . import partner
|
||||
from . import company
|
||||
from . import mail
|
||||
|
||||
20
base_usability/users.py
Normal file
20
base_usability/users.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super(ResUsers, self).default_get(fields_list)
|
||||
# For a new partner auto-created when you create a new user, we prefer
|
||||
# customer=False and supplier=True by default
|
||||
res.update({
|
||||
'customer': False,
|
||||
'supplier': True,
|
||||
})
|
||||
return res
|
||||
Reference in New Issue
Block a user