109 lines
5.3 KiB
Python
109 lines
5.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo import models, fields, api
|
|
|
|
|
|
class TxDigitalServiceProvider(models.Model):
|
|
_name = 'tx.digital.service.provider'
|
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
|
_description = '数字化服务商'
|
|
_order = "id desc"
|
|
|
|
def _domain_nature_ids(self):
|
|
parent_id = self.env["tx.data.dict"].search([("code", "=", "ys_business_nature_type")], limit=1)
|
|
return [
|
|
("parent_id", "=", parent_id.id),
|
|
("category", "=", "value")]
|
|
|
|
def _domain_industry_ids(self):
|
|
parent_id = self.env["tx.data.dict"].search([("code", "=", "ys_belong_industry_type")], limit=1)
|
|
return [("parent_id", "=", parent_id.id),
|
|
("category", "=", "value")]
|
|
|
|
icon = fields.Image(string="图标", tracking=True)
|
|
img = fields.Image(string="头像", tracking=True)
|
|
name = fields.Char(string='名称', tracking=True)
|
|
company_name = fields.Char(string="公司名称", tracking=True)
|
|
brief_introduction = fields.Html(string="简介", tracking=True)
|
|
content = fields.Html(string="内容", tracking=True)
|
|
|
|
nature_ids = fields.Many2many("tx.data.dict", "tx_provider_nature_ref", "provider_id", "nature_id", string="企业性质",
|
|
domain=lambda self: self._domain_nature_ids(), tracking=True)
|
|
industry_ids = fields.Many2many("tx.data.dict", "tx_provider_industry_ref", "provider_id", "industry_id", string="所属行业",
|
|
domain=lambda self: self._domain_industry_ids(), tracking=True)
|
|
remarks = fields.Text(string="备注")
|
|
|
|
|
|
class TxDigitalAlly(models.Model):
|
|
_name = 'tx.digital.ally'
|
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
|
_description = '数字化盟友'
|
|
_order = "id desc"
|
|
|
|
def _domain_industry_ids(self):
|
|
parent_id = self.env["tx.data.dict"].search([("code", "=", "ys_technical_type")], limit=1)
|
|
return [("parent_id", "=", parent_id.id),
|
|
("category", "=", "value")]
|
|
|
|
def _domain_is_industry_ids(self):
|
|
parent_id = self.env["tx.data.dict"].search([("code", "=", "ys_belong_industry_type")], limit=1)
|
|
return [("parent_id", "=", parent_id.id),
|
|
("category", "=", "value")]
|
|
|
|
def _domain_technical_ids(self):
|
|
parent_id = self.env["tx.data.dict"].search([("code", "=", "ys_technical_type")], limit=1)
|
|
return [("parent_id", "=", parent_id.id),
|
|
("category", "=", "value")]
|
|
|
|
img = fields.Image(string="头像", tracking=True)
|
|
name = fields.Char(string='名称', tracking=True)
|
|
company_name = fields.Char(string="公司名称", tracking=True)
|
|
brief_introduction = fields.Html(string="简介", tracking=True)
|
|
content = fields.Html(string="内容", tracking=True)
|
|
|
|
industry_ids = fields.Many2many("tx.data.dict", "tx_ally_industry_ref", "ally_id", "industry_id", string="产品应用行业",
|
|
domain=lambda self: self._domain_industry_ids(), tracking=True)
|
|
is_industry_ids = fields.Many2many("tx.data.dict", "tx_ally_is_industry_ref", "ally_id", "is_industry_id",
|
|
string="所属行业", domain=lambda self: self._domain_is_industry_ids(), tracking=True)
|
|
technical_ids = fields.Many2many("tx.data.dict", "tx_ally_technical_ref", "ally_id", "technical_id",
|
|
string="技术领域", domain=lambda self: self._domain_technical_ids(), tracking=True)
|
|
|
|
remarks = fields.Text(string="备注")
|
|
|
|
|
|
class TxXinchuangOpen(models.Model):
|
|
_name = 'tx.xinchuang.open'
|
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
|
_description = '信创开源'
|
|
_order = "id desc"
|
|
|
|
def _domain_industry_ids(self):
|
|
parent_id = self.env["tx.data.dict"].search([("code", "=", "ys_products_industry_type")], limit=1)
|
|
return [("parent_id", "=", parent_id.id),
|
|
("category", "=", "value")]
|
|
|
|
def _domain_is_industry_ids(self):
|
|
parent_id = self.env["tx.data.dict"].search([("code", "=", "ys_belong_industry_type")], limit=1)
|
|
return [("parent_id", "=", parent_id.id),
|
|
("category", "=", "value")]
|
|
|
|
def _domain_technical_ids(self):
|
|
parent_id = self.env["tx.data.dict"].search([("code", "=", "ys_technical_type")], limit=1)
|
|
return [("parent_id", "=", parent_id.id),
|
|
("category", "=", "value")]
|
|
|
|
img = fields.Image(string="头像", tracking=True)
|
|
name = fields.Char(string='名称', tracking=True)
|
|
company_name = fields.Char(string="公司名称", tracking=True)
|
|
brief_introduction = fields.Html(string="简介", tracking=True)
|
|
content = fields.Html(string="内容", tracking=True)
|
|
|
|
industry_ids = fields.Many2many("tx.data.dict", "tx_open_industry_ref", "open_id", "industry_id", string="产品应用行业",
|
|
tracking=True)
|
|
is_industry_ids = fields.Many2many("tx.data.dict", "tx_open_is_industry_ref", "open_id", "is_industry_id",
|
|
string="所属行业", domain=lambda self: self._domain_is_industry_ids(), tracking=True)
|
|
technical_ids = fields.Many2many("tx.data.dict", "tx_open_technical_ref", "open_id", "technical_id",
|
|
string="技术领域", domain=lambda self: self._domain_technical_ids(), tracking=True)
|
|
|
|
remarks = fields.Text(string="备注", tracking=True)
|