Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
8209 Lượt xem

Hello,

 

I need a graph in the "hr.employee" model, on a one2many field (contract_ids). I need to print the "date_start" and the "wage" for each employee in a graph of the "hr.employee" view, but this attributes are in the "hr.contract" model. I can access to this attributes by the field "contract_ids", but i don't know how to add this graph to my hr.model!

 

For example, this is what i try in XML :

<record model="ir.ui.view" id="hr_employee_view_graph">
    <field name="name">hr.employee.graph</field>
    <field name="model">hr.employee</field>
    <field name="type">graph</field>
    <field name="arch" type="xml">
        <field name="contract_ids">
            <graph string="Actuals wages" type="area">
                <field name="date_start"/>
                <field name="wage"/>
            </graph>
        </field>
    </field>
</record>

I really don't know how to print in a graph some information from a one2many field in a model ... Did you have any idea please?

 

Best regards,

Corentin Dijoux

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

you should add mode="graph" in one2many field

(E.g)

<field name="contract_ids" mode="graph">
            <graph string="Actuals wages" type="area">
                <field name="date_start"/>
                <field name="wage"/>
            </graph>
        </field>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

have u got any solution regarding the above

 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
6
thg 8 20
9129
0
thg 10 18
4013
1
thg 11 17
14882
0
thg 4 25
4784
1
thg 4 22
5325