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.

1

Integrity error while installing hr_timesheet module

By
Jasim
on 5/16/13, 10:04 AM 3,936 views

Hi, When i try to install hr_timesheet module, on OE 7, latest edition (tried with many versions from April onwards ) I am getting an error

Integrity Error

The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set

[object with reference: name - name]

The log @ openerp shows like this

2013-05-16 17:13:12,190 15857 ERROR zsenda openerp.netsvc: Integrity Error
The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still refer                                                                                        ence it
- creation/update: a mandatory field is not correctly set

[object with reference: name - name]
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_r                                                                                        pc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626,                                                                                         in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 188, in execute_k                                                                                        w
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 172, in wrapper
    netsvc.abort_response(1, _('Integrity Error'), 'warning', msg)
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 71, in abort_respo                                                                                        nse
    raise openerp.osv.osv.except_osv(description, details)
except_osv: ('Integrity Error', 'The operation cannot be completed, probably due                                                                                         to the following:\n- deletion: you may be trying to delete a record while other                                                                                         records still reference it\n- creation/update: a mandatory field is not correct                                                                                        ly set\n\n[object with reference: name - name]')
2013-05-16 17:13:12,191 15857 INFO zsenda werkzeug: 192.168.1.190 - - [16/May/20                                                                                        13 17:13:12] "POST /web/dataset/call_button HTTP/1.1" 200 -

The error is not raising when I create a new database and install the hr_timesheet at first. I have tried all these

a. Update the addon codes and upgraded modules which is required for hr_timesheet b. Deleted hr_timesheet (after some sql hacks) and replaced with latest repository module and tried to install it again.

DELETE FROM ir_model_constraint WHERE module = 216;
DELETE FROM ir_model_relation WHERE module = 216;
ALTER TABLE hr_employee DROP COLUMN uom_id, DROP COLUMN journal_id, DROP COLUMN product_id;
DROP TABLE IF EXISTS hr_analytic_timesheet CASCADE;
ALTER TABLE account_analytic_account DROP COLUMN use_timesheets;
DROP TABLE IF EXISTS hr_analytical_timesheet_employee CASCADE;
DROP TABLE IF EXISTS hr_analytical_timesheet_users CASCADE;
DROP TABLE IF EXISTS hr_sign_out_project CASCADE;
DROP TABLE IF EXISTS hr_sign_in_project CASCADE;

c. Backing up of database and restored as new database and tried to install the module again. It also have the same effect (integrity error)

The modules I have installed so far

process
account_cancel
account_voucher
purchase
web_view_editor
hr_payroll
base_import
stock
account_payment
l10n_in_hr_payroll
web_kanban
hr
account_asset
account_accountant
procurement
base_action_rule
web_graph
board
product
base_status
web_diagram
hr_attendance
web_gantt
sale_stock
account_followup
hr_expense
warning
web_tests
web_calendar
web
project
account_chart
sale_crm
hr_payroll_account
account
base_setup
auth_signup
l10n_in
edi
crm
hr_evaluation
decimal_precision
web_shortcuts
sale
analytic
hr_holidays
share
survey
base
mail
email_template
fetchmail
hr_contract
base_calendar
resource
0
Jasim
On 5/17/13, 8:33 AM

To jsut hack it out, just open hr_timesheet_data.xml and comment out like this

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="1">
      <!---
        <record id="analytic_journal" model="account.analytic.journal">
            <field name="code">TS</field>
            <field name="name">Timesheet Journal</field>
            <field name="type">general</field>
        </record>

        <record id="hr.employee" model="hr.employee">
            <field name="journal_id" ref="analytic_journal"/>
        </record>
      -->
    </data>
</openerp>

Then installation of module will be done smoothly.

Later, Goto Accounting >> Analytic Accounting > Analytic Journals Create a new Analytic Accounting Journal with Journal Name "Timesheet Journal" ,Journal Code "TS", and Type "General"

Later Goto "Human Resources" > "Employees" Take each employee and goto "HR Settings" and put Analytic Journal to "Timesheet Journal" and make sure the product should be selected which you are timely billing like "Time based Software Development / Service"

This looks like a work around. I have the same problem, and I wonder if the root cause is a bug in the software or a problem with my database

Santiago
on 5/20/13, 2:46 PM
0
Pedro Arroyo
On 7/2/13, 3:08 PM

borro el empleado administrador? al parecer necesita un registro en la tabla hr_employee con id 1. Intente ingresarlo en la tabla hr_employee con id 1 y el campo active en false.

saludos.

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

2 follower(s)

Stats

Asked: 5/16/13, 10:04 AM
Seen: 3936 times
Last updated: 2/8/16, 9:23 AM