我如何在Odoo 9中的一个fileld上显示两个不同表格中的两个不同字段?

时间:2016-05-10 18:10:05

标签: python odoo-9

这是一个棘手的问题!!

我的例子" mail" :我有两种类型的邮件.. "收到邮件" "已发邮件" ,所以我创建了两个表并且工作了完美.. 现在我想创建第三个表名称" General mail"其中包括来自"接收邮件" "已发布邮件" 的字段组... 我的代码是:

接收邮件

class IncomingMail(audit.MailModel):
    _name = 'incoming.mail'
    _inherits = _inherits = {'general.mail.adm': 'mail_id'}

    name = fields.Char(string="Number Mail",
                       help="contient code courr", readonly=True,
                       requred=True, index=True,
                       )
    senders = fields.Char(string="The Senders", required=True,
                          help="contains name of mail senders")
    reception_date = fields.Date(string="Reception Date",
                        help="contains date arrival of incoming mail")
    mail_subject = fields.Char(string="Mail Subject",
                               help="contains the subject of messaging")

    doc_ref = fields.Char(string="Document Reference",
                          help="contains Reference doc")
    doc_date = fields.Date(string="Document Date",
                           help="contains date of Document")

已发出邮件

class IssuedMail(audit.MailModel):
    _name = 'issued.mail'
    _inherits = {'general.mail.adm': 'mail_id'}

    name = fields.Char(string="Number Mail",
                       help="contient code courr", readonly=True,
                       requred=True, index=True)

    receivers = fields.Char(string="The Receivers", required=True,
                            help="contains name of mail receivers")
    sending_date = fields.Date(string="Sending Date",
                               help="contains Sending Date of issued mail")
    mail_subject = fields.Char(string="Mail Subject",
                               help="contains the subject of messaging")
    doc_ref = fields.Char(string="Document Reference",
                          help="contains reference doc")
    doc_date = fields.Date(string="Document Date",
                           help="contains date of Document")

General Mail 必须喜欢这个

class MailAdm(audit.JusticeModel):
    _name = 'general.mail.adm'
    _description = 'contient le courrier'
    _inherit = ['mail.thread', 'ir.needaction_mixin']

    # num_courr
    #

    name = fields.Char(string="Serial Number",
                       help="contient code courr", readonly=True,
                       requred=True, index=True,)

    senders_receivers = fields.Char(string="Senders/Receivers", required=True,
                          help="contains name of mail senders")

    reception_send_date = fields.Date(string="Reception/Send Date",
                            help="contains date arrival of incoming mail")

    mail_subject = fields.Char(string="Mail Subject",
                               help="contains the subject of messaging")
    doc_ref = fields.Char(string="Document Reference",
                          help="contains Reference doc")
    doc_date = fields.Date(string="Document Date",
                           help="contains date of Document")

结果如下:

接收邮件 incoming mail

已发出邮件

issued mail

一般邮件 [显示行但没有数据!] [3]

[当我选择它向我显示的任何行] [4]

任何想法!有人可以帮我一点吗?

0 个答案:

没有答案