Merge lp:~openerp-dev/openerp-web/trunk-calendar-favorite-meeting-ptr into lp:~openerp-dev/openerp-web/trunk-calendar-favorite-meeting-psa

Proposed by Pariket Trivedi(OpenERP)
Status: Merged
Merged at revision: 3956
Proposed branch: lp:~openerp-dev/openerp-web/trunk-calendar-favorite-meeting-ptr
Merge into: lp:~openerp-dev/openerp-web/trunk-calendar-favorite-meeting-psa
Diff against target: 59 lines (+30/-10)
2 files modified
addons/web_calendar/static/src/js/web_calendar.js (+27/-7)
addons/web_calendar/static/src/xml/web_fullcalendar.xml (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-calendar-favorite-meeting-ptr
Reviewer Review Type Date Requested Status
Pariket Trivedi(OpenERP) Needs Resubmitting
Paramjit Singh Sahota(OpenERP) Needs Fixing
Review via email: mp+210605@code.launchpad.net

Description of the change

hello sir,

i hanve add new input text autocomplete use partner_id in calendar view.
and add new partner in Add Employee's Meeting in calendar.

thank you,
ptr

To post a comment you must log in.
Revision history for this message
Paramjit Singh Sahota(OpenERP) (psa-openerp) wrote :

Hello ptr,
1/. In your diff, on line no. 11 & 12, Why are you using the context in search when you are not getting the value in context??
2/. In your diff, on line no. 21 & 22, Why are you using the DOM object here??

review: Needs Fixing
3956. By Pariket Trivedi(OpenERP)

[IMP]: autocomplete input field change position in template.

3957. By Pariket Trivedi(OpenERP)

 [MEREG]: lp:~openerp-dev/openerp-web/trunk-calendar-favorite-meeting-psa.

Revision history for this message
Pariket Trivedi(OpenERP) (pariket.trivedi-openerp) :
review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web_calendar/static/src/js/web_calendar.js'
2--- addons/web_calendar/static/src/js/web_calendar.js 2014-03-13 11:36:34 +0000
3+++ addons/web_calendar/static/src/js/web_calendar.js 2014-03-13 11:40:52 +0000
4@@ -1363,13 +1363,33 @@
5 },
6 addUpdateButton: function() {
7 var self=this;
8- this.$('div.oe_calendar_all_responsibles').append(QWeb.render('CalendarView.sidebar.button_add_contact'));
9- this.$(".add_contacts_link_btn").on('click', function() {
10- self.rpc("/web/action/load", {
11- action_id: "calendar.action_calendar_contacts"
12- }).then( function(result) { return self.do_action(result); });
13- });
14-
15+ this.$('div.oe_calendar_all_responsibles').prepend(QWeb.render('CalendarView.sidebar.button_add_contact'));
16+ var name = new Array();
17+ var id = new Array();
18+ partner_obj = new instance.web.Model('res.partner')
19+ partner_obj.call("search", [[ ]]).then(function (record_ids) {
20+ partner_obj.call("read", [record_ids, ['name', 'user_ids']]).then(function (record_data) {
21+ record_data.map(function(i) {
22+ if (i.user_ids[0] != self.session.uid){
23+ name.push(i.name);
24+ id.push(i.id);
25+ }
26+ });
27+ $('input[name=add_partner]').autocomplete({source: name});
28+ });
29+ });
30+ this.$("#add_meeting").on('focusout', function(){
31+ partner_id = id[name.indexOf($("#add_meeting").val())];
32+ $("#add_meeting").val("");
33+ if (partner_id){
34+ new instance.web.Model("calendar.contacts").call('search', [[['partner_id', '=', partner_id]]]).then(function(calendar_data){
35+ if (calendar_data.length == 0){
36+ new instance.web.Model("calendar.contacts").call("create", [{'partner_id': partner_id}]).then(function (result){
37+ });
38+ }
39+ });
40+ }
41+ });
42 },
43 destroy_filter: function(e) {
44 var self= this;
45
46=== modified file 'addons/web_calendar/static/src/xml/web_fullcalendar.xml'
47--- addons/web_calendar/static/src/xml/web_fullcalendar.xml 2014-03-13 11:36:34 +0000
48+++ addons/web_calendar/static/src/xml/web_fullcalendar.xml 2014-03-13 11:40:52 +0000
49@@ -58,9 +58,9 @@
50 </div>
51
52 <div t-name="CalendarView.sidebar.button_add_contact" class="oe_calendar_buttons_add_contact">
53- <button class='oe_button oe_form_button oe_link add_contacts_link_btn' style='margin-top:10px'>
54- <span class='add_contacts_link'>See Employee's Meeting</span>
55- </button>
56+ <div class="form-group">
57+ <input id="add_meeting" type="text" name="add_partner" class="form-control" t-att-value="add_partner" placeholder="Add Employee's Meeting"/>
58+ </div>
59 </div>
60
61

Subscribers

People subscribed via source and target branches

to all changes: