用于HR招聘应用程序的ODOO 11过滤器记录

时间:2018-07-01 13:10:08

标签: python odoo odoo-11

我是ODOO的新手。我正在努力发展我的知识。然后,我将个人项目命名为“我的招聘”。 我继承了模型“ hr.applicant”,并添加了新的字段名称“ x_place”。 模型“地方”有很多“ res.users”。

   class MYRecruitment(models.Model):
        x_place = fields.Many2one('my.recruitment.place', "Place")


        class MyRecruitmentPlace(models.Model):
            _name = "my.recruitment.place"
            _description = "Place of Recruitment"
            _sql_constraints = [('name_uniq', 'unique (name)', 'The name of the place of Recruitment must be unique!')]

            name = fields.Char("Place", required=True, translate=True)
            user_ids = fields.Many2many('res.users', string="Owners")
            sequence = fields.Integer("Sequence", default=1, help="Gives the sequence order when displaying a list of place.")  



<odoo>  
    <data>
    <record model="ir.ui.view" id="hr_kanban_view_applicant_my_extend">
        <field name="name">Hr Applicants kanban Extend</field>
        <field name="model">hr.applicant</field>
        <field name="inherit_id" ref="hr_recruitment.hr_kanban_view_applicant"/>
        <field name="arch" type="xml">
            <xpath expr="//kanban" position="attributes">
                <attribute name="quick_create">false</attribute>
                <attribute name="default_order">create_date desc</attribute>
            </xpath>
        </field>
    </record>
    </data> 
</odoo>


Place:
----------------------------------------
Place     User
---------------------------------------
Place01   user1,user2,user3
Place02   user2
Place03   user3
----------------------------------------


Applicant:
----------------------------------------
Name       Place 
----------------------------------------
App1       Place01
App2       Place01
App3       Place02
App4       Place03
-----------------------------------------

我希望odoo在以下情况下显示记录: 用户登录时

user1:   
    show  App1
user2:
    show  App1,App2, App3
user3:
     Show App1,App4

0 个答案:

没有答案