Subject: [FIX] Add constraint to check employee can take one card
Author: iboussetta
Committer: iboussetta

Date Level Type Message
2019-03-15 13:25:50 INFO runbot init Init build environment
2019-03-15 13:26:01 INFO runbot test_all Start test all modules
2019-03-15 13:27:03 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.base.tests.test_translate tested in 8.25s, 25627 queries
2019-03-15 13:27:08 INFO server odoo.modules.loading:234 load_module_graph 1 modules loaded in 56.33s, 48222 queries
2019-03-15 13:27:30 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.base_import.tests.test_base_import tested in 9.65s, 232 queries
2019-03-15 13:28:03 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.mail.tests.test_mail_features tested in 5.15s, 4126 queries
2019-03-15 13:28:40 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.calendar.tests.test_calendar tested in 8.05s, 5816 queries
2019-03-15 13:28:53 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.event.tests.test_event_flow tested in 5.63s, 4300 queries
2019-03-15 13:30:02 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.product.tests.test_variants tested in 8.18s, 7979 queries
2019-03-15 13:31:15 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.crm.tests.test_crm_lead tested in 9.02s, 6724 queries
2019-03-15 13:31:25 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.crm.tests.test_lead2opportunity tested in 9.44s, 6741 queries
2019-03-15 13:31:55 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.hr_holidays.tests.test_holidays_flow tested in 11.86s, 5544 queries
2019-03-15 13:32:44 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.project.tests.test_access_rights tested in 7.26s, 5163 queries
2019-03-15 13:34:13 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.hr_payroll.tests.test_payslip_flow tested in 6.03s, 1120 queries
2019-03-15 13:34:47 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.survey.tests.test_survey tested in 14.85s, 11745 queries
2019-03-15 13:35:47 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.purchase_request.tests.test_purchase_flow tested in 9.71s, 3386 queries
2019-03-15 13:36:17 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.website_forum.tests.test_forum tested in 6.11s, 4667 queries
2019-03-15 13:37:03 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.hr_attendance_extend.tests.test_authorization_flow tested in 5.80s, 1302 queries
2019-03-15 13:37:31 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.hr_deputation.tests.test_deputation_flow tested in 11.99s, 4024 queries
2019-03-15 13:38:01 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.hr_holidays_extend.tests.test_holidays_flow tested in 14.47s, 6961 queries
2019-03-15 13:38:40 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.hr_training.tests.test_training_flow tested in 10.33s, 4683 queries
2019-03-15 13:39:10 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.project_maintenance.tests.test_project_maintenance_flow tested in 10.97s, 6309 queries
2019-03-15 13:41:36 INFO server odoo.modules.loading:234 load_module_graph 169 modules loaded in 864.49s, 172469 queries
2019-03-15 13:41:56 INFO server odoo.modules.loading:234 load_module_graph 173 modules loaded in 19.78s, 11 queries
2019-03-15 13:42:06 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.base.tests.test_reports tested in 9.04s, 1049 queries
2019-03-15 13:42:18 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.account.tests.test_account_invoice_rounding tested in 5.67s, 4178 queries
2019-03-15 13:42:42 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.account.tests.test_payment tested in 18.57s, 14519 queries
2019-03-15 13:43:31 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.account.tests.test_reconciliation tested in 47.58s, 37543 queries
2019-03-15 13:43:42 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.account.tests.test_tax tested in 7.57s, 5464 queries
2019-03-15 13:43:46 INFO server odoo.addons.website.tests.test_crawl:73 test_10_crawl_public public crawled 1 urls in 4.30s 410 queries, 4.305s 410.00q per request,
2019-03-15 13:44:20 INFO server odoo.addons.website.tests.test_crawl:83 test_20_crawl_demo demo crawled 60 urls in 33.76s 24091 queries, 0.563s 401.52q per request
2019-03-15 13:44:56 INFO server odoo.addons.website.tests.test_crawl:93 test_30_crawl_admin admin crawled 76 urls in 35.79s 27495 queries, 0.471s 361.78q per request
2019-03-15 13:44:56 INFO server odoo.modules.module:515 run_unit_tests odoo.addons.website.tests.test_crawl tested in 73.91s, 52018 queries
2019-03-15 13:45:01 INFO runbot run Start running build 09198-1274-29c011
2019-03-15 13:45:03 INFO server odoo.modules.loading:234 load_module_graph 1 modules loaded in 0.29s, 0 queries
2019-03-15 13:45:04 INFO server odoo.modules.loading:234 load_module_graph 173 modules loaded in 1.16s, 0 queries
2019-03-15 13:58:55 INFO server odoo.modules.loading:234 load_module_graph 1 modules loaded in 0.01s, 0 queries
2019-03-15 13:58:56 INFO server odoo.modules.loading:234 load_module_graph 173 modules loaded in 0.19s, 0 queries
2019-03-15 13:58:58 WARNING server odoo.modules.loading:506 reset_modules_state Transient module states were reset
2019-03-15 13:58:58 ERROR server odoo.modules.registry:90 new
Failed to load registry
Traceback (most recent call last):
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 654, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1488, in _update
    record = record.create(values)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/models/hr_employee_card.py", line 47, in create
    res = super(HrEmployeeCard, self).create(vals)
  File "/opt/odoo/odoo11/addons/mail/models/mail_thread.py", line 236, in create
    thread = super(MailThread, self).create(values)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/popup_reminder/models/popup_reminder.py", line 32, in create
    record_id = create_original(self, vals)
  File "/opt/odoo/odoo11/odoo/models.py", line 3372, in create
    record = self.browse(self._create(old_vals))
  File "/opt/odoo/odoo11/odoo/models.py", line 3525, in _create
    self._validate_fields(vals)
  File "/opt/odoo/odoo11/odoo/models.py", line 1036, in _validate_fields
    check(self)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/models/hr_employee_card.py", line 41, in _check_constraints
    raise ValidationError(_("لا يمكن الحصول على أكثر من بطاقة."))
odoo.exceptions.ValidationError: ('لا يمكن الحصول على أكثر من بطاقة.', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo11/odoo/modules/registry.py", line 85, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 380, in load_modules
    loaded_modules, update_module, models_to_check)
  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 274, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 184, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='demo')
  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 95, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 791, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 852, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 751, in parse
    exc_info[2]
  File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 654, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1488, in _update
    record = record.create(values)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/models/hr_employee_card.py", line 47, in create
    res = super(HrEmployeeCard, self).create(vals)
  File "/opt/odoo/odoo11/addons/mail/models/mail_thread.py", line 236, in create
    thread = super(MailThread, self).create(values)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/popup_reminder/models/popup_reminder.py", line 32, in create
    record_id = create_original(self, vals)
  File "/opt/odoo/odoo11/odoo/models.py", line 3372, in create
    record = self.browse(self._create(old_vals))
  File "/opt/odoo/odoo11/odoo/models.py", line 3525, in _create
    self._validate_fields(vals)
  File "/opt/odoo/odoo11/odoo/models.py", line 1036, in _validate_fields
    check(self)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/models/hr_employee_card.py", line 41, in _check_constraints
    raise ValidationError(_("لا يمكن الحصول على أكثر من بطاقة."))
odoo.tools.convert.ParseError: "لا يمكن الحصول على أكثر من بطاقة.
None" while parsing /mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/data/hr_employee_card_demo.xml:5, near
<record id="hr_employee_card_1" model="hr.employee.card">
        <field name="employee_id" ref="hr_base.hr_employee"/>
        <field name="start_date">2017-08-11</field>
        <field name="end_date">2019-08-11</field>
        <field name="state">done</field>
    </record>
2019-03-15 13:58:58 ERROR server odoo.http:654 _handle_exception
Exception during JSON request handling.
Traceback (most recent call last):
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 654, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1488, in _update
    record = record.create(values)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/models/hr_employee_card.py", line 47, in create
    res = super(HrEmployeeCard, self).create(vals)
  File "/opt/odoo/odoo11/addons/mail/models/mail_thread.py", line 236, in create
    thread = super(MailThread, self).create(values)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/popup_reminder/models/popup_reminder.py", line 32, in create
    record_id = create_original(self, vals)
  File "/opt/odoo/odoo11/odoo/models.py", line 3372, in create
    record = self.browse(self._create(old_vals))
  File "/opt/odoo/odoo11/odoo/models.py", line 3525, in _create
    self._validate_fields(vals)
  File "/opt/odoo/odoo11/odoo/models.py", line 1036, in _validate_fields
    check(self)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/models/hr_employee_card.py", line 41, in _check_constraints
    raise ValidationError(_("لا يمكن الحصول على أكثر من بطاقة."))
odoo.exceptions.ValidationError: ('لا يمكن الحصول على أكثر من بطاقة.', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo11/odoo/http.py", line 650, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo11/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/opt/odoo/odoo11/odoo/http.py", line 692, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo11/odoo/http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo11/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo11/odoo/http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo11/odoo/http.py", line 936, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo11/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo11/addons/web/controllers/main.py", line 938, in call_button
    action = self._call_kw(model, method, args, {})
  File "/opt/odoo/odoo11/addons/web/controllers/main.py", line 926, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo11/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/odoo11/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-42>", line 2, in button_immediate_install
  File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 71, in check_and_log
    return method(self, *args, **kwargs)
  File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 449, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 542, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/opt/odoo/odoo11/odoo/modules/registry.py", line 85, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 380, in load_modules
    loaded_modules, update_module, models_to_check)
  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 274, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 184, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='demo')
  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 95, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 791, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 852, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 751, in parse
    exc_info[2]
  File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 654, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1488, in _update
    record = record.create(values)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/models/hr_employee_card.py", line 47, in create
    res = super(HrEmployeeCard, self).create(vals)
  File "/opt/odoo/odoo11/addons/mail/models/mail_thread.py", line 236, in create
    thread = super(MailThread, self).create(values)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/popup_reminder/models/popup_reminder.py", line 32, in create
    record_id = create_original(self, vals)
  File "/opt/odoo/odoo11/odoo/models.py", line 3372, in create
    record = self.browse(self._create(old_vals))
  File "/opt/odoo/odoo11/odoo/models.py", line 3525, in _create
    self._validate_fields(vals)
  File "/opt/odoo/odoo11/odoo/models.py", line 1036, in _validate_fields
    check(self)
  File "/mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/models/hr_employee_card.py", line 41, in _check_constraints
    raise ValidationError(_("لا يمكن الحصول على أكثر من بطاقة."))
odoo.tools.convert.ParseError: "لا يمكن الحصول على أكثر من بطاقة.
None" while parsing /mnt/vdb/odoo/addons_runbot/runbot/static/build/09198-1274-29c011/addons/hr_employee_card/data/hr_employee_card_demo.xml:5, near
<record id="hr_employee_card_1" model="hr.employee.card">
        <field name="employee_id" ref="hr_base.hr_employee"/>
        <field name="start_date">2017-08-11</field>
        <field name="end_date">2019-08-11</field>
        <field name="state">done</field>
    </record>
2019-03-15 13:58:58 INFO server odoo.modules.loading:234 load_module_graph 1 modules loaded in 0.02s, 0 queries
2019-03-15 13:58:58 INFO server odoo.modules.loading:234 load_module_graph 173 modules loaded in 0.25s, 0 queries
2019-03-15 19:51:58 INFO runbot _ask_kill Killing build 09198-1274-29c011, requested by Administrator (user #1)
2019-03-15 19:54:02 INFO runbot kill Kill build 09198-1274-29c011