mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
prepare #I6T53Q 【app_chatgpt】代码优化,gpt_id主要绑定在partner中,users中是related过去处理 置顶
This commit is contained in:
@@ -6,7 +6,8 @@ from odoo import fields, models
|
||||
class ResUsers(models.Model):
|
||||
_inherit = "res.users"
|
||||
|
||||
gpt_id = fields.Many2one('ai.robot', string='Bind to ChatGpt')
|
||||
# 改为在 partner中设置,用户处绑定
|
||||
gpt_id = fields.Many2one('ai.robot', string='Bind to ChatGpt', related='partner_id.gpt_id', inherited=True, readonly=False)
|
||||
gpt_policy = fields.Selection([
|
||||
('all', 'All Users'),
|
||||
('limit', 'Selected Users')
|
||||
|
||||
Reference in New Issue
Block a user