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

Hello, I my problem is that the payroll journal bookings have only the reference but not the employee_id there in the column.

How can I add the employee_id to see from who is this booking. It's strange, because the reference it comes from the payroll Account.  

 This is my example, but it's not working:

from openerp.osv import fields, osv
 class account_move_line(osv.osv): 
_inherits = 'account.move.line' _columns = {
'employee_id': fields.related('payslip','employee_id',type="char",relation="hr.payslip",string="employee_id",store=True,readonly=True),
}

<?xml version="1.0" encoding="utf-8"?>

<openerp>
<data>
<record id="view_move_line_form" model="ir.ui.view">
<field name="name">account.move.line.form</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='ref']" position="after">
<field name="employee_id"/>
</xpath>
</field>
</record>
</data>
</openerp>

How to reference a field from a other object? I don't get it...

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 16
3363
0
thg 10 15
3195
2
thg 11 21
5634
0
thg 11 17
2931
1
thg 7 17
3330