跳至內容
選單
此問題已被標幟
3803 瀏覽次數

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...

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
7月 16
3330
0
10月 15
3183
2
11月 21
5616
0
11月 17
2920
1
7月 17
3325