pythonodooerp

What is the technical name of employer's name in Odoo?


So I'm trying to create an email that will be directly send to the owner of the email, so for example here, my subject here is {{object.employee_id.name}} and I don't know where I get this info.

What I want here is to attach the name of Bailey Boi on the content of the email. What I tried is I activate developer tool

enter image description here

enter image description here

enter image description here

since I'm still noob at Oddo, I have two questions.

1.) Where did I get the {{object.employee_id.name}}?

2.) Is there any guide on learning on how can I manipulate the data like the image above, we're using SaaS and I'm trying to learn the studio app

Additional Info:

enter image description here


Solution

  • I'll try to answer your questions.

    Note: I am currently using Odoo 15, and it seems you are on version 16, so you'll have to have me excused if some info does not apply to version 16.

    Where did I get the {{object.employee_id.name}}?

    Not quite sure what you are asking here, but for email template subjects you can put variables within double squiggly-brackets ({{}}). "object" refers to the specific record of the model (Pay Slip in your screenshot) the email is sent from. "employee_id" is a many2one field on the Pay Slip model, which is the record of "hr.employee?" (not quite sure what the model would be) that is linked to that record of Pay Slip. "name" is as you probably guessed the name of the employee_id (for many2one fields, you have access to all fields of that model, which you can see if you go into the model in "Models").

    To use variables in the contents of an email is quite different, Odoo email templates uses Q-Web templates, which you can read more about here. So if you want to just display the value of a field you would put <t t-out="object.employee_id.name"/> into the code of the email template. Here's an example.

    You should be able to access the code part of the email in the top-right corner of the text-box once you've pressed edit (this is how it is on version 15, though it could be different on version 16).