← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 854659] Re: [project_timesheet_contract] should set default cost_based_on, prevents from loading "hr"

 

** Changed in: openobject-addons
   Importance: Undecided => Low

** Changed in: openobject-addons
       Status: New => Confirmed

** Changed in: openobject-addons
     Assignee: (unassigned) => Vishal Parmar(Open ERP) (vpa-openerp)

** Changed in: openobject-addons
       Status: Confirmed => In Progress

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/854659

Title:
  [project_timesheet_contract] should set default cost_based_on,
  prevents from loading "hr"

Status in OpenERP Addons (modules):
  In Progress

Bug description:
  When installing both hr and project_timesheet_contract on a fresh
  database, hr module errors out to install hr_data.

  The reason being is that "cost_based_on" is a mandatory field on an
  employee, which is added in "project_timesheet_contract".

  Possible solutions:
  1) Extend xml data in project_timesheet_contract to add "cost_based_on" for admin user
  2) Add default to "product" price for example.

  Tested on 6.0 latest revno, but seems to apply to trunk as well.

  [2011-09-20 12:55:45,335][project] ERROR:tools.convert.xml_import:Parse error in /home/user/src/openerp/6.0/project/bin/addons/hr/hr_data.xml:19: 
  <record id="employee" model="hr.employee">
              <field name="name">Administrator</field>
              <field name="user_id" ref="base.user_root"/>
          </record>
  Traceback (most recent call last):
    File "/home/user/src/openerp/6.0/project/bin/tools/convert.py", line 865, in parse
      self._tags[rec.tag](self.cr, rec, n)
    File "/home/user/src/openerp/6.0/project/bin/tools/convert.py", line 832, in _tag_record
      id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
    File "/home/user/src/openerp/6.0/project/bin/addons/base/ir/ir_model.py", line 691, in _update
      res_id = model_obj.create(cr, uid, values, context=context)
    File "/home/user/src/openerp/6.0/project/bin/addons/hr_evaluation/hr_evaluation.py", line 134, in create
      id = super(hr_employee, self).create(cr, uid, vals, context=context)
    File "/home/user/src/openerp/6.0/project/bin/osv/orm.py", line 3651, in create
      cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
    File "/home/user/src/openerp/6.0/project/bin/sql_db.py", line 78, in wrapper
      return f(self, *args, **kwargs)
    File "/home/user/src/openerp/6.0/project/bin/sql_db.py", line 131, in execute
      res = self._obj.execute(query, params)
  IntegrityError: null value in column "cost_based_on" violates not-null constraint

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/854659/+subscriptions


References