Home > English, OSS Solutions, Tech Crunch > OpenERP – Timesheet module – Hours encoding error

OpenERP – Timesheet module – Hours encoding error

When trying to encode new hours in one’s timesheet in OpenERP, the following error might appear:

ERROR:  null value in column “journal_id” violates not-null constraint

insert into “account_analytic_line” (id,perm_id,”user_id”,”account_id”,”general_account_id”,”product_uom_id”,”journal_id”,”name”,”to_invoice”,”amount”,”unit_amount”,”date”,”product_id”,create_uid,create_date) values (4,NULL,’4′,’6′,’634′,’4′,NULL,’Analysis of AIM development project’,NULL,-40.000000,2.000000,’2008-08-14′,’1′,4,now())

The error code is not clear, but the problem in this case comes from the fact that you don’t have (or you didn’t select) an “Invoicing” item. An invoicing is the type of invoicing (if you use a special discount for a special type of client for example). If you don’t know or you don’t have any “special” kind of invoicing, just enter something like “normal invoicing”.

I had initially started to look for the interface definition in the timesheet module to try and find a missing field (adding a “Journal” field or something to avoid the “NULL” value), but just filling an invoice type is much faster. Anyway, just in case, I think the following lines are of interest in the interface definition…

./hr_timesheet_invoice/hr_timesheet_invoice.py:73:class account_analytic_line(osv.osv):
./hr_timesheet_invoice/hr_timesheet_invoice.py:82:        return super(account_analytic_line,self).unlink(cursor, user, ids,
./hr_timesheet_invoice/hr_timesheet_invoice.py:87:        return super(account_analytic_line,self).write(cr, uid, ids, vals,
./hr_timesheet_invoice/hr_timesheet_invoice.py:105:        return super(account_analytic_line, self).copy(cursor, user, obj_id,

  1. August 17, 2008 at 6:17 pm


    If you want, you can add this bug in the LaunchPad’s bugtracker


    Best Regards,

    Stephane Wirtel

  2. ywarnier
    August 19, 2008 at 6:17 pm
  3. omadegbo
    January 5, 2012 at 2:24 pm

    Am having similar problem when I try to approve expense invoice

  4. omadegbo
    January 5, 2012 at 2:32 pm

    How did you resolve it please?

    • Yannick Warnier
      January 6, 2012 at 3:59 am

      Hi Omadegbo, sorry, that was a very long time ago, I didn’t even remember this post. I would have thought that would have been fixed in OpenERP by now…

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: