Skip to content

Conversation

@dhrs-odoo
Copy link
Contributor

Task-5125645

@robodoo
Copy link
Collaborator

robodoo commented Dec 15, 2025

Pull request status dashboard

@dhrs-odoo dhrs-odoo force-pushed the 19.0-update-headhunter-dhrs branch 22 times, most recently from 563e56d to 301a4d4 Compare December 22, 2025 09:38
Copy link
Contributor

@pgu-odoo pgu-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhrs-odoo I have added a few comments. But still its going on.

"res_model_id": env.ref("hr_recruitment.model_hr_applicant").id,
"res_id": record.pool_applicant_id.id if record.pool_applicant_id else record.id,
"user_id": record.user_id.id if record.user_id else record.create_uid.id,
"date_deadline": datetime.date.today(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"date_deadline": datetime.date.today(),

default value for date_deadline is context_today already.

Comment on lines 96 to 121
invoices = record.x_invoices
action = {
'res_model': 'account.move',
'type': 'ir.actions.act_window',
}
if len(invoices) == 1:
action.update({
'view_mode': 'form',
'res_id': invoices.id,
})
elif invoices:
action.update({
'view_mode': 'list,form',
'domain': [('id', 'in', invoices.ids)],
})
action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
invoices = record.x_invoices
action = {
'res_model': 'account.move',
'type': 'ir.actions.act_window',
}
if len(invoices) == 1:
action.update({
'view_mode': 'form',
'res_id': invoices.id,
})
elif invoices:
action.update({
'view_mode': 'list,form',
'domain': [('id', 'in', invoices.ids)],
})
action
invoices = record.x_invoices
action = {
'type': 'ir.actions.act_window',
'res_model': 'account.move',
}
if invoices:
action.update(
{'view_mode': 'form', 'res_id': invoices.id}
if len(invoices) == 1
else {'view_mode': 'list,form', 'domain': [('id', 'in', invoices.ids)]}
)
action

can be reduced to have single update method.

Comment on lines 134 to 140
action = {
'view_mode': 'form',
'type': 'ir.actions.act_window',
'res_model': 'sale.order',
'context': {
'default_x_job_id': record.id,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we think to have the xml code for ir act window and just pass the id over here? like -

<record id="action_sale_order_from_job" model="ir.actions.act_window"> <field name="name">Create Sale Order</field> <field name="res_model">sale.order</field> <field name="view_mode">form</field> <field name="context">{'default_x_job_id': active_id}</field> </record>

and something like -

<record id="ir_actions_server_create_sale_order_from_job" model="ir.actions.server"> <field name="name">Create sale order</field> <field name="model_id" ref="hr.model_hr_job"/> <field name="binding_model_id" ref="hr.model_hr_job"/> <field name="state">code</field> <field name="code"><![CDATA[ action = env.ref('headhunter.action_sale_order_from_job').read()[0] action['context'] = dict(action.get('context', {}), default_x_job_id=record.id) ]]></field> </record>

or if called from button only then -

<button name="%(action_sale_order_from_job)d" type="action" string="Create Sale Order"/>

everywhere. It will reduce our python code.

Comment on lines 162 to 169
if not (record.x_status_bar == 'open' and record.active and record.is_published):
for job in record.x_similar_job_ids:
if record.id in job.x_similar_job_ids.ids:
job['x_similar_job_ids'] = [(3, record.id)]
else:
for job in record.x_similar_job_ids:
if record.id not in job.x_similar_job_ids.ids:
job['x_similar_job_ids'] = [(4, record.id)]]]></field>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not (record.x_status_bar == 'open' and record.active and record.is_published):
for job in record.x_similar_job_ids:
if record.id in job.x_similar_job_ids.ids:
job['x_similar_job_ids'] = [(3, record.id)]
else:
for job in record.x_similar_job_ids:
if record.id not in job.x_similar_job_ids.ids:
job['x_similar_job_ids'] = [(4, record.id)]]]></field>
record_to_update = record.x_status_bar == 'open' and record.active and record.is_published
for j in record.x_similar_job_ids:
j.x_similar_job_ids = [(4, record.id)] if record_to_update and record.id not in j.x_similar_job_ids.ids \
else [(3, record.id)] if not record_to_update and record.id in j.x_similar_job_ids.ids else j.x_similar_job_ids

Comment on lines 177 to 180
for similar in record.x_similar_job_ids:
if similar.x_status_bar == 'open' and similar.active and similar.is_published:
if record.id not in similar.x_similar_job_ids.ids:
similar['x_similar_job_ids'] = [(4, record.id)]]]></field>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for similar in record.x_similar_job_ids:
if similar.x_status_bar == 'open' and similar.active and similar.is_published:
if record.id not in similar.x_similar_job_ids.ids:
similar['x_similar_job_ids'] = [(4, record.id)]]]></field>
for similar in record.x_similar_job_ids.filtered(
lambda j: j.x_status_bar == 'open' and j.active and j.is_published
and record not in j.x_similar_job_ids
):
similar.x_similar_job_ids = [(4, record.id)]></field>

Comment on lines 190 to 210
compose_form = env.ref('mail.email_compose_message_wizard_form')
job_partner = record.job_id.x_customer
ctx = {
'default_model': 'hr.applicant',
'default_res_ids': [record.id],
'default_template_id': record.stage_id.template_id.id,
'default_composition_mode': 'comment',
'default_attachment_ids': [(6, 0, record.x_is_shared_cv.ids)],
'force_email': True,
'x_from_cv_send': True,
}
if job_partner:
ctx['default_partner_ids'] = [(6, 0, [job_partner.id])]
action = {
'type': 'ir.actions.act_window',
'res_model': 'mail.compose.message',
'view_mode': 'form',
'views': [(compose_form.id, 'form')],
'target': 'new',
'context': ctx,
}]]></field>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
compose_form = env.ref('mail.email_compose_message_wizard_form')
job_partner = record.job_id.x_customer
ctx = {
'default_model': 'hr.applicant',
'default_res_ids': [record.id],
'default_template_id': record.stage_id.template_id.id,
'default_composition_mode': 'comment',
'default_attachment_ids': [(6, 0, record.x_is_shared_cv.ids)],
'force_email': True,
'x_from_cv_send': True,
}
if job_partner:
ctx['default_partner_ids'] = [(6, 0, [job_partner.id])]
action = {
'type': 'ir.actions.act_window',
'res_model': 'mail.compose.message',
'view_mode': 'form',
'views': [(compose_form.id, 'form')],
'target': 'new',
'context': ctx,
}]]></field>
ctx = {
'default_model': 'hr.applicant',
'default_res_ids': [record.id],
'default_template_id': record.stage_id.template_id.id,
'default_composition_mode': 'comment',
'default_attachment_ids': [(6, 0, record.x_is_shared_cv.ids)],
'force_email': True,
'x_from_cv_send': True,
}
if record.job_id.x_customer:
ctx['default_partner_ids'] = [(6, 0, [record.job_id.x_customer.id])]
action = {
'type': 'ir.actions.act_window',
'res_model': 'mail.compose.message',
'view_mode': 'form',
'views': [(env.ref('mail.email_compose_message_wizard_form').id, 'form')],
'target': 'new',
'context': ctx,
}]]></field>

@dhrs-odoo dhrs-odoo force-pushed the 19.0-update-headhunter-dhrs branch 5 times, most recently from 0597555 to c5ff7f7 Compare December 29, 2025 09:10
@dhrs-odoo dhrs-odoo force-pushed the 19.0-update-headhunter-dhrs branch from c5ff7f7 to ae11503 Compare January 5, 2026 12:01
@dhrs-odoo dhrs-odoo force-pushed the 19.0-update-headhunter-dhrs branch 4 times, most recently from 900e87d to 6f489de Compare January 27, 2026 07:21
@dhrs-odoo dhrs-odoo force-pushed the 19.0-update-headhunter-dhrs branch 2 times, most recently from f5bf6cd to a776b38 Compare January 27, 2026 09:27
@dhrs-odoo dhrs-odoo force-pushed the 19.0-update-headhunter-dhrs branch from a776b38 to 8a55925 Compare January 27, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants