CubexSolutions / cruze-custom

Custom Modules
0 stars 0 forks source link

Null Employee Code in Contracts #1

Open mrawi opened 9 years ago

mrawi commented 9 years ago

When creating a contract, I get this error:

2015-06-26 19:55:02,404 30527 ERROR hr openerp.sql_db: bad query: INSERT INTO "hr_schedule" ("id", "employee_id", "name", "date_end", "date_start", "company_id", "state", "template_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('hr_schedule_id_seq'), 3, 'أحمد خضر عثمان: 2015-06-22 Wk 26', '2015-07-05', '2015-06-22', 1, 'draft', 1, 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id
Traceback (most recent call last):
  File "/opt/cruze/openerp/sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "employee_code" violates not-null constraint
DETAIL:  Failing row contains (6, 2015-06-26 19:55:02.183542, 2015-07-05, 1, 3, 2015-06-26 19:55:02.183542, 1, 2015-06-22, null, 1, أحمد خضر عثمان: 2015-06-22 Wk 26, draft, 1, null, null).

2015-06-26 19:55:02,405 30527 ERROR hr openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/opt/cruze/openerp/http.py", line 517, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/cruze/openerp/http.py", line 538, in dispatch
    result = self._call_function(**self.params)
  File "/opt/cruze/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/cruze/openerp/service/model.py", line 149, in wrapper
    raise openerp.osv.orm.except_orm(_('Integrity Error'), msg)
except_orm: ('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 correctly set\n\n[object with reference: employee_code - employee.code]')
2015-06-26 19:55:02,407 30527 INFO hr werkzeug: 127.0.0.1 - - [26/Jun/2015 19:55:02] "POST /web/dataset/call_kw/hr.contract/create HTTP/1.0" 200 -
2015-06-26 19:55:05,316 30527 ERROR hr openerp.sql_db: bad query: INSERT INTO "hr_schedule" ("id", "employee_id", "name", "date_end", "date_start", "company_id", "state", "template_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('hr_schedule_id_seq'), 3, 'أحمد خضر عثمان: 2015-06-22 Wk 26', '2015-07-05', '2015-06-22', 1, 'draft', 1, 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id
Traceback (most recent call last):
  File "/opt/cruze/openerp/sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "employee_code" violates not-null constraint
DETAIL:  Failing row contains (7, 2015-06-26 19:55:05.095755, 2015-07-05, 1, 3, 2015-06-26 19:55:05.095755, 1, 2015-06-22, null, 1, أحمد خضر عثمان: 2015-06-22 Wk 26, draft, 1, null, null).

2015-06-26 19:55:05,317 30527 ERROR hr openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/opt/cruze/openerp/http.py", line 517, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/cruze/openerp/http.py", line 538, in dispatch
    result = self._call_function(**self.params)
  File "/opt/cruze/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/cruze/openerp/service/model.py", line 149, in wrapper
    raise openerp.osv.orm.except_orm(_('Integrity Error'), msg)
except_orm: ('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 correctly set\n\n[object with reference: employee_code - employee.code]')
mohamedmagdy commented 9 years ago

The bad news is that I have no answer, but the solution for this error is to create a new DB