Skip to Content
Menu
This question has been flagged

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

Avatar
Discard
Related Posts Replies Views Activity
0
Jul 16
2580
0
Oct 15
2535
2
Nov 21
4253
0
Nov 17
2001
1
Jul 17
2308