Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I usually have no problems at all with inheritance but I can't inherit the popup dialog which is on the calendar view.
The code is in the module calender, which you can find here: https://github.com/odoo/odoo/blob/8.0/addons/web_calendar/static/src/xml/web_fullcalendar.xml#L57-70
It has the following code:
<div t-name="CalendarView.quick_create" class="oe_calendar_quick_create openerp"> <div class="form-group"> <label for='name' class='control-label'>Event summary:</label> <input name='name' class="form-control"/> </div> <t t-if="widget._buttons"> <div class="oe_calendar_quick_create_buttons"> <button class="openerp oe_button oe_highlight oe_calendar_quick_create_add ">Create event</button> <button class="oe_button oe_form_button oe_link oe_calendar_quick_create_edit" ><span>Edit Event <![CDATA]></span></button> </div> </t> </div>
A simple question: what is the correct way to inherit this? it has no template id and/or name so how can I inherit that div t-name and add a field after this line with xpath?
<input name='name' class="form-control"/>
The solution is to create a (new) XML file under /static/src/xml and to include this file in your __openerp__.py. For inheriting this view you need to work with <templates> in place of <openerp><data>.
With a t-extend you can extend the view. For example for the calendar popup:
<?xml version="1.0" encoding="utf-8"?> <templates> <tr t-extend="CalendarView.quick_create"> <t t-jquery=".form-group" t-operation="after"> <div class="form-group"> <h3>Example - put fields here </h3> </div> </t> </tr> </templates>
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 7/23/15, 4:30 AM|
|Seen: 2176 times|
|Last updated: 9/12/16, 5:24 AM|