Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to add a column in payroll Journal??

By
wizardz
on 12/2/15, 5:23 AM 539 views

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/2/15, 5:23 AM
Seen: 539 times
Last updated: 12/2/15, 10:12 AM