Code Monkey home page Code Monkey logo

Comments (8)

intero-chz avatar intero-chz commented on July 16, 2024

@dreispt I'm pinging you, because i don't know who is responsible for the hr repo.

I would create a pull request, but the question is: what solution should be chosen. I've mentioned two solutions, but maybe there are some interesting other ones?

from hr.

dreispt avatar dreispt commented on July 16, 2024

I see, the module makes the parter_name field mandatory.
IMO the sensitive thing to do is to add a default value to partner_name.
Since the Application title, name is mandatory, I would suggest for partner_nameto use it's value as a default.
Do you think you can make a PR for this?

from hr.

intero-chz avatar intero-chz commented on July 16, 2024

partner_name is already set by the origin message_new (by email from value). Are default values working for related fields at all?

from hr.

dreispt avatar dreispt commented on July 16, 2024

You're not using any default values then.
partner_name is a related field, and it gets it's value written on the Partner name.
It doesn't make sense that you get an error.
Can you give a link to the message_new() code you refer to?

from hr.

intero-chz avatar intero-chz commented on July 16, 2024

https://github.com/odoo/odoo/blob/8.0/addons/hr_recruitment/hr_recruitment.py#L386

from hr.

dreispt avatar dreispt commented on July 16, 2024

AFAICS the message_newis writing both on name and partner_name.
You shouldn't have any error then. 😕
Do you have a traceback of the error you can share?

from hr.

dreispt avatar dreispt commented on July 16, 2024

Ping!

from hr.

intero-chz avatar intero-chz commented on July 16, 2024

Pong (sorry, was on vacation):

Traceback (most recent call last):
File "workspace/odoo/addons/fetchmail/fetchmail.py", line 215, in fetch_mail
context=context)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/addons/mail/mail_thread.py", line 1204, in message_process
thread_id = self.message_route_process(cr, uid, msg_txt, msg, routes, context=context)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/addons/mail/mail_thread.py", line 1124, in message_route_process
thread_id = model_pool.message_new(cr, user_id, message_dict, custom_values, context=nosub_ctx)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/addons/hr_recruitment/hr_recruitment.py", line 405, in message_new
return super(hr_applicant, self).message_new(cr, uid, msg, custom_values=defaults, context=context)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/addons/mail/mail_thread.py", line 1240, in message_new
res_id = model_pool.create(cr, uid, data, context=context)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/addons/hr_recruitment/hr_recruitment.py", line 419, in create
obj_id = super(hr_applicant, self).create(cr, uid, vals, context=context)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/addons/mail/mail_thread.py", line 381, in create
thread_id = super(mail_thread, self).create(cr, uid, values, context=context)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/openerp/api.py", line 345, in old_api
result = method(recs, _args, *_kwargs)
File "workspace/odoo/openerp/models.py", line 4092, in create
record = self.browse(self._create(old_vals))
File "workspace/odoo/openerp/api.py", line 248, in wrapper
return new_api(self, _args, *_kwargs)
File "workspace/odoo/openerp/api.py", line 481, in new_api
result = method(self._model, cr, uid, _args, *_kwargs)
File "workspace/odoo/openerp/models.py", line 4148, in _create
record_id = self.pool[table].create(cr, user, tocreate[table], context=context)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/openerp/api.py", line 345, in old_api
result = method(recs, _args, *_kwargs)
File "workspace/odoo/openerp/addons/base/res/res_partner.py", line 573, in create
partner = super(res_partner, self).create(vals)
File "workspace/odoo/openerp/api.py", line 248, in wrapper
return new_api(self, _args, *_kwargs)
File "workspace/odoo/openerp/api.py", line 481, in new_api
result = method(self._model, cr, uid, _args, *_kwargs)
File "workspace/odoo/addons/mail/mail_thread.py", line 381, in create
thread_id = super(mail_thread, self).create(cr, uid, values, context=context)
File "workspace/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "workspace/odoo/openerp/api.py", line 345, in old_api
result = method(recs, _args, *_kwargs)
File "workspace/odoo/openerp/models.py", line 4092, in create
record = self.browse(self._create(old_vals))
File "workspace/odoo/openerp/api.py", line 248, in wrapper
return new_api(self, _args, *_kwargs)
File "workspace/odoo/openerp/api.py", line 481, in new_api
result = method(self._model, cr, uid, _args, *_kwargs)
File "workspace/odoo/openerp/models.py", line 4230, in _create
tuple([u[2] for u in updates if len(u) > 2])
File "workspace/odoo/openerp/sql_db.py", line 158, in wrapper
return f(self, _args, *_kwargs)
File "workspace/odoo/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
IntegrityError: null value in column "name" violates not-null constraint

from hr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.