This question has been flagged
2 Replies
6894 Views

I'm trying to modify a label in a calendar view. This label uses to appear in every calendar view, just below the minicalendar on the right side of the screen. Obviously, the string of the label is different depending on the selected calendar view. In my case, I would like to change the label which appears in the calendar view of the section opportunities (crm). The label is Salesperson. I have located the file which contents the code of the calendar view, but this one is composed by only a few lines:

<!-- CRM Lead Calendar View -->
<record model="ir.ui.view" id="crm_case_calendar_view_leads">
    <field name="name">CRM - Leads Calendar</field>
    <field name="model">crm.lead</field>
    <field name="priority" eval="2"/>
    <field name="arch" type="xml">
        <calendar string="Leads Generation"
            date_start="date_action" color="user_id">
            <field name="name"/>
            <field name="partner_name"/>
        </calendar>
    </field>
</record>

And here there are not any Salesperson strings. Where is it?

Avatar
Discard
Best Answer

Hi,

The label is comes from the attribute "color" of the calendar tag. See the below

<calendar string="Leads Generation"  date_start="date_action" color="user_id">

In the crm.lead "user_id" is labelled with "Salesperson" thats why in calendar view it is appear.

If you want different label then just changed the field of the "color" attribute. It will changed label on calendar view.

I hope it is useful to you.

Avatar
Discard
Author

Thank you! But this case is not the same as other views, because I am not able to modify the string of the color field, how can I do this?

Hi, are you do not want to change the field "user_id" ?

if yes then you have two option to achieve your objective. 1) make one field which is fields.function and as like the user_id and set string as your desire and set that fields.function field into color="...." 2) Just inherit crm.lead model and give new defination of user_id field and give new string into .py file.

If No then just change the field name into "color" attribute of the calendar tag thats it. like color="xxxx".

Author

That's right. Thank you!

Best Answer

Isn't the salesperson the same as user_id field on crm leads? I don't know if you can change that easily, for I have not worked with javascript before.

Furthermore, does CRM not override the default calendar JS file from the web_calendar module? If so, you could check that file.

Avatar
Discard
Author

Yes, user_id means salesperson on crm leads and opportunities. Isn't there another way to change the label better than modifying js?