From 7488a675b4d9a8e99cf2b9b25c194e114babcafb Mon Sep 17 00:00:00 2001 From: "Ravish Murari (OpenERP)" Date: Mon, 23 Jul 2012 16:56:17 +0530 Subject: [PATCH 01/84] [FIX] removed rest of the base_group_extended group from addons lp bug: https://launchpad.net/bugs/1027875 fixed bzr revid: rmu@tinyerp.com-20120723112617-h7um6wkj22martms --- addons/account/account_view.xml | 2 +- addons/crm_fundraising/crm_fundraising_view.xml | 2 +- addons/point_of_sale/point_of_sale_view.xml | 2 +- addons/purchase/report/purchase_report_view.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 1e1f7b91851..e117d31212a 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2593,7 +2593,7 @@ action = pool.get('res.config').next(cr, uid, [], context)
diff --git a/addons/crm_fundraising/crm_fundraising_view.xml b/addons/crm_fundraising/crm_fundraising_view.xml index 9e67a4001a7..961ba2d6d3e 100644 --- a/addons/crm_fundraising/crm_fundraising_view.xml +++ b/addons/crm_fundraising/crm_fundraising_view.xml @@ -66,7 +66,7 @@ + + + + + + +
  • @@ -155,6 +174,7 @@
  • +
  • Reply
  • + - diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index d1fb3f8a395..ab8f2dabd5a 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -554,7 +554,7 @@ class stock_warehouse_orderpoint(osv.osv): 'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True), 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, ondelete="cascade"), 'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="cascade"), - 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]), + 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','!=','service')]), 'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True), 'product_min_qty': fields.float('Minimum Quantity', required=True, help="When the virtual stock goes below the Min Quantity specified for this field, OpenERP generates "\ diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 6927bf68c25..7584f239f34 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -106,6 +106,7 @@
    +
    @@ -880,12 +881,12 @@ - + - + @@ -970,7 +971,7 @@ stock.picking.out.tree - stock.picking + stock.picking.out @@ -1000,7 +1001,7 @@ - + or From abf3d2bd53c3bdc8e0c8191ab3b1c78c0c36d34b Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Sep 2012 16:47:40 +0200 Subject: [PATCH 62/84] [IMP] product explanation about the business flow bzr revid: fp@tinyerp.com-20120917144740-2hsb04t8dpzxzuue --- addons/mail/data/mail_group_data.xml | 2 +- addons/mrp/mrp_view.xml | 11 +++++++++-- addons/product/product_view.xml | 24 ++++++++++++++++++++++-- addons/project_mrp/project_mrp_view.xml | 11 +++++++++-- addons/purchase/purchase_view.xml | 14 ++++++++++++++ 5 files changed, 55 insertions(+), 7 deletions(-) diff --git a/addons/mail/data/mail_group_data.xml b/addons/mail/data/mail_group_data.xml index 53720926a5c..11d0ee7d04b 100644 --- a/addons/mail/data/mail_group_data.xml +++ b/addons/mail/data/mail_group_data.xml @@ -7,7 +7,7 @@ Discussion about best sales practices and deals.
    - All Employees + Whole Company Discussion about best sales practices and deals. diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index ec66b5692c0..d05893cf778 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -956,9 +956,16 @@ product.product - - + + False + +

    + When you sell this product, OpenERP will trigger a manufacturing + order using the bill of materials assigned to this product. + The delivery order will be ready once the production is done. +

    +
    diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 13474351744..d04e6f17fe8 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -106,11 +106,31 @@ + - - + +

    + When you sell this service, nothing special will be trigered + to deliver the customer. +

    +

    + When you sell this product, OpenERP will use the available inventory + for the delivery order. +
    + If there are not enough quantities available, the delivery order + will wait for new products. You should create others rules + (orderpoints, manual purchase orders) to fulfill the inventory. +

    +

    + When you sell this product, a delivery order will be created. + OpenERP will consider that the required quantities are always + available as it's a consumable (the stock on hand may become negative). +

    +
    + +
    diff --git a/addons/project_mrp/project_mrp_view.xml b/addons/project_mrp/project_mrp_view.xml index ca1e1f893e7..51de9dd5cf3 100644 --- a/addons/project_mrp/project_mrp_view.xml +++ b/addons/project_mrp/project_mrp_view.xml @@ -36,9 +36,16 @@ product.product - - + + False + +

    + When you sell this service to a customer, a task will be + created to follow up the job to do. This task will appear + in the project related to the contract of the sale order. +

    +
    diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 53f27245e7e..796fd1351a9 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -572,6 +572,20 @@
    + +

    + When you sell this service to a customer, a draft purchase order + will be created in order to subcontract the job + to + . +

    +

    + When you sell this product, OpenERP will trigger a draft + purchase order to buy the required quantities to the supplier. + The delivery order will be ready after having received the + products. +

    +
    From 091b2d4892444b291d48a3c48e014f05543961d2 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 17 Sep 2012 16:53:45 +0200 Subject: [PATCH 63/84] [FIX] typo bzr revid: abo@openerp.com-20120917145345-atyfzfq6juls0siu --- addons/event/event_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index e2ff2e67e87..0bf0e9e743b 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -166,7 +166,7 @@ - - - - - - -
  • @@ -161,12 +142,10 @@
  • -
  • + +
  • Reply
  • Reply
  • -
  • 1 Attachment @@ -200,4 +179,17 @@ + +
  • + + votes + + +
  • + From 09ab484e0b2a7316e3480d3b20a2d484702036ca Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 18 Sep 2012 14:43:32 +0200 Subject: [PATCH 74/84] [IMP] refactoring in m2o for future development bzr revid: nicolas.vanhoren@openerp.com-20120918124332-mj764gxrk2ssjzjd --- addons/web/static/src/js/view_form.js | 67 +++++++++++++++------------ 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 8c8e08dbfdd..d5eaf21c5e2 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2753,11 +2753,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc this.render_editable(); this.render_value(); }, - render_editable: function() { - var self = this; - this.$input = this.$el.find("input"); - - self.$input.tipsy({ + init_error_displayer: function() { + this.$input.tipsy({ title: function() { return QWeb.render('Tipsy.alert', { message: "No element was selected, you should create or select one from the dropdown list." @@ -2770,9 +2767,21 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc opacity: 1, offset: 4, }); + }, + hide_error_displayer: function() { + this.$input.tipsy("hide"); + }, + show_error_displayer: function() { + this.$input.tipsy("show"); + }, + render_editable: function() { + var self = this; + this.$input = this.$el.find("input"); + + this.init_error_displayer(); self.$input.on('focus', function() { - self.$input.tipsy("hide"); + self.hide_error_displayer(); }); this.$drop_down = this.$el.find(".oe_m2o_drop_down_button"); @@ -2826,10 +2835,10 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc } } }); - self.tip_def = $.Deferred(); - self.untip_def = $.Deferred(); - var tip_delay = 200; - var tip_duration = 15000; + self.ed_def = $.Deferred(); + self.uned_def = $.Deferred(); + var ed_delay = 200; + var ed_duration = 15000; var anyoneLoosesFocus = function() { var used = false; if (self.floating) { @@ -2849,25 +2858,25 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc } self.floating = false; } - if (used && self.get("value") === false && ! self.no_tipsy) { - self.tip_def.reject(); - self.untip_def.reject(); - self.tip_def = $.Deferred(); - self.tip_def.then(function() { - self.$input.tipsy("show"); + if (used && self.get("value") === false && ! self.no_ed) { + self.ed_def.reject(); + self.uned_def.reject(); + self.ed_def = $.Deferred(); + self.ed_def.then(function() { + self.show_error_displayer(); }); setTimeout(function() { - self.tip_def.resolve(); - self.untip_def.reject(); - self.untip_def = $.Deferred(); - self.untip_def.then(function() { - self.$input.tipsy("hide"); + self.ed_def.resolve(); + self.uned_def.reject(); + self.uned_def = $.Deferred(); + self.uned_def.then(function() { + self.hide_error_displayer(); }); - setTimeout(function() {self.untip_def.resolve();}, tip_duration); - }, tip_delay); + setTimeout(function() {self.uned_def.resolve();}, ed_duration); + }, ed_delay); } else { - self.no_tipsy = false; - self.tip_def.reject(); + self.no_ed = false; + self.ed_def.reject(); } }; var ignore_blur = false; @@ -3007,13 +3016,13 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc this.$input.focus(); }, _quick_create: function() { - this.no_tipsy = true; - this.tip_def.reject(); + this.no_ed = true; + this.ed_def.reject(); return instance.web.form.CompletionFieldMixin._quick_create.apply(this, arguments); }, _search_create_popup: function() { - this.no_tipsy = true; - this.tip_def.reject(); + this.no_ed = true; + this.ed_def.reject(); return instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments); }, }); From 4b896c36af9f94f66e998331c7504d7fdcd41b8c Mon Sep 17 00:00:00 2001 From: Odowan Kenobi Date: Tue, 18 Sep 2012 15:04:36 +0200 Subject: [PATCH 75/84] [REF] allow to intercept the signals sent to workflows (through buttons) in objects. This is done by adding a function named _workflow_signal() in orm that can be inherited in dedicated objects. Courtesy from Olivier Dony bzr revid: qdp-launchpad@openerp.com-20120918130436-ll7potrsya23lc36 --- openerp/osv/orm.py | 6 ++++++ openerp/osv/osv.py | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 48689c3c26e..3eafd247f59 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -3792,6 +3792,12 @@ class BaseModel(object): for res_id in ids: getattr(wf_service, trigger)(uid, self._name, res_id, cr) + def _workflow_signal(self, cr, uid, ids, signal, context=None): + """Send given workflow signal""" + wf_service = netsvc.LocalService("workflow") + for res_id in ids: + wf_service.trg_validate(uid, self._name, res_id, signal, cr) + def unlink(self, cr, uid, ids, context=None): """ Delete records with given ids diff --git a/openerp/osv/osv.py b/openerp/osv/osv.py index 877e804314c..94f179c7897 100644 --- a/openerp/osv/osv.py +++ b/openerp/osv/osv.py @@ -184,16 +184,18 @@ class object_proxy(object): cr.close() return res - def exec_workflow_cr(self, cr, uid, obj, method, *args): - wf_service = netsvc.LocalService("workflow") - return wf_service.trg_validate(uid, obj, args[0], method, cr) + def exec_workflow_cr(self, cr, uid, obj, signal, *args): + object = pooler.get_pool(cr.dbname).get(obj) + if not object: + raise except_osv('Object Error', 'Object %s doesn\'t exist' % str(obj)) + return object._workflow_signal(cr, uid, [args[0]], signal) @check - def exec_workflow(self, db, uid, obj, method, *args): + def exec_workflow(self, db, uid, obj, signal, *args): cr = pooler.get_db(db).cursor() try: try: - res = self.exec_workflow_cr(cr, uid, obj, method, *args) + res = self.exec_workflow_cr(cr, uid, obj, signal, *args) cr.commit() except Exception: cr.rollback() From 2c09f43b7efe7d7696d87029b1107ce563c4dfc3 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 18 Sep 2012 16:31:01 +0200 Subject: [PATCH 76/84] [IMP] Added helper for buttons in dialogs bzr revid: nicolas.vanhoren@openerp.com-20120918143101-wbdyaou23l8wx9zd --- addons/web/static/src/js/chrome.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 3114aaf315f..d5b45a87bf5 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -79,6 +79,9 @@ instance.web.Dialog = instance.web.Widget.extend({ } } if (options) { + if (options.buttons) { + this.params_buttons = true; + } _.extend(this.dialog_options, options); } }, @@ -123,7 +126,13 @@ instance.web.Dialog = instance.web.Widget.extend({ if (! this.dialog_inited) this.init_dialog(); var o = this.get_options(options); + if (! this.no_erase_buttons) { + this.$buttons.appendTo($("body")); + } instance.web.dialog(this.$el, o).dialog('open'); + if (! this.no_erase_buttons) { + this.$buttons.appendTo(this.$el.dialog("widget")); + } if (o.height === 'auto' && o.max_height) { this.$el.css({ 'max-height': o.max_height, 'overflow-y': 'auto' }); } @@ -133,6 +142,10 @@ instance.web.Dialog = instance.web.Widget.extend({ this.renderElement(); var o = this.get_options(options); instance.web.dialog(this.$el, o); + if (! this.params_buttons) { + this.$buttons = $('
    '); + this.$el.dialog("widget").append(this.$buttons); + } var res = this.start(); this.dialog_inited = true; return res; From d9d3aab5151b1651d6eb36057f121ebee4af76f0 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 18 Sep 2012 16:49:24 +0200 Subject: [PATCH 77/84] [FIX] Problem with popups bzr revid: nicolas.vanhoren@openerp.com-20120918144924-2y72o7tauxspk4la --- addons/web/static/src/js/chrome.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index d5b45a87bf5..9fdfb50307f 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -126,11 +126,11 @@ instance.web.Dialog = instance.web.Widget.extend({ if (! this.dialog_inited) this.init_dialog(); var o = this.get_options(options); - if (! this.no_erase_buttons) { + if (! this.params_buttons) { this.$buttons.appendTo($("body")); } instance.web.dialog(this.$el, o).dialog('open'); - if (! this.no_erase_buttons) { + if (! this.params_buttons) { this.$buttons.appendTo(this.$el.dialog("widget")); } if (o.height === 'auto' && o.max_height) { From 74410c8985a78d87d10341174d95d853415e5e52 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 18 Sep 2012 16:59:25 +0200 Subject: [PATCH 78/84] [IMP] replaced tipsy in m2o by a dialog bzr revid: nicolas.vanhoren@openerp.com-20120918145925-avk5z92hqesqdqq9 --- addons/web/static/src/js/view_form.js | 45 ++++++++++++++++++--------- addons/web/static/src/xml/base.xml | 10 ++++++ 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d5eaf21c5e2..c188abc853e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2616,6 +2616,7 @@ instance.web.form.CompletionFieldMixin = { var dataset = new instance.web.DataSet(this, this.field.relation, self.build_context()); var blacklist = this.get_search_blacklist(); + this.last_query = search_val; return this.orderer.add(dataset.name_search( search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]), @@ -2723,6 +2724,32 @@ instance.web.form.CompletionFieldMixin = { }, }; +instance.web.form.M2ODialog = instance.web.Dialog.extend({ + template: "M2ODialog", + init: function(parent) { + this._super(parent, { + title: _.str.sprintf(_t("Add %s"), parent.string), + width: 312, + }); + }, + start: function() { + var self = this; + this.$buttons.html(QWeb.render("M2ODialog.buttons")); + this.$("input").val(this.getParent().last_query); + this.$buttons.find(".oe_form_m2o_qc_button").click(function(){ + self.getParent()._quick_create(self.$("input").val()); + self.destroy(); + }); + this.$buttons.find(".oe_form_m2o_sc_button").click(function(){ + self.getParent()._search_create_popup("form", undefined, self.getParent()._create_context(self.$("input").val())); + self.destroy(); + }); + this.$buttons.find(".oe_form_m2o_cancel_button").click(function(){ + self.destroy(); + }); + }, +}); + instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instance.web.form.CompletionFieldMixin, instance.web.form.ReinitializeFieldMixin, { template: "FieldMany2One", init: function(field_manager, node) { @@ -2754,25 +2781,13 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc this.render_value(); }, init_error_displayer: function() { - this.$input.tipsy({ - title: function() { - return QWeb.render('Tipsy.alert', { - message: "No element was selected, you should create or select one from the dropdown list." - }); - }, - trigger:'manual', - fade: true, - gravity: 's', - html: true, - opacity: 1, - offset: 4, - }); + // nothing }, hide_error_displayer: function() { - this.$input.tipsy("hide"); + // doesn't work }, show_error_displayer: function() { - this.$input.tipsy("show"); + new instance.web.form.M2ODialog(this).open(); }, render_editable: function() { var self = this; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index aafac1019fd..4cc2629822d 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1700,4 +1700,14 @@
    + +
    + Name: +
    +
    + + + + + From 2ae49751eb9e97b4ec9820a07258f5d07a527d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 18 Sep 2012 17:05:17 +0200 Subject: [PATCH 79/84] [TEST] mail: added tests for the vote feature. bzr revid: tde@openerp.com-20120918150517-c08jw61c9fpasisc --- addons/mail/tests/test_mail.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/addons/mail/tests/test_mail.py b/addons/mail/tests/test_mail.py index 1fab5dd1732..57a59e2595f 100644 --- a/addons/mail/tests/test_mail.py +++ b/addons/mail/tests/test_mail.py @@ -647,3 +647,33 @@ class test_mail(TestMailMockups): msg1.refresh() self.assertEqual(5, len(group_pigs.message_ids), 'group should contain 5 messages') self.assertEqual(2, len(msg1.child_ids), 'msg1 should have 2 children now') + + def test_60_vote(self): + """ Test designed for the vote/unvote feature. """ + cr, uid = self.cr, self.uid + group_pigs = self.mail_group.browse(cr, uid, self.group_pigs_id) + user_admin = self.res_users.browse(cr, uid, uid) + msg1 = group_pigs.message_post(body='My Body', subject='1') + msg1 = self.mail_message.browse(cr, uid, msg1) + + # Create user Bert Tartopoils + user_bert_id = self.res_users.create(cr, uid, {'name': 'Bert', 'login': 'bert'}) + user_bert = self.res_users.browse(cr, uid, user_bert_id) + + # Test: msg1 and msg2 have void vote_user_ids + self.assertFalse(msg1.vote_user_ids, 'newly created message msg1 has not void vote_user_ids') + # Do: Admin vote for msg1 + self.mail_message.vote_toggle(cr, uid, [msg1.id]) + msg1.refresh() + # Test: msg1 has Admin as voter + self.assertEqual(set(msg1.vote_user_ids), set([user_admin]), 'after voting, Admin is not the voter') + # Do: Bert vote for msg1 + self.mail_message.vote_toggle(cr, uid, [msg1.id], [user_bert_id]) + msg1.refresh() + # Test: msg1 has Admin and Bert as voters + self.assertEqual(set(msg1.vote_user_ids), set([user_admin, user_bert]), 'after voting, Admin and Bert are not the voters') + # Do: Admin unvote for msg1 + self.mail_message.vote_toggle(cr, uid, [msg1.id]) + msg1.refresh() + # Test: msg1 has Bert as voter + self.assertEqual(set(msg1.vote_user_ids), set([user_bert]), 'after unvoting for Admin, Bert is not the voter') From 21833581643ac28af36e778f479c0bdbcc461285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 18 Sep 2012 17:05:44 +0200 Subject: [PATCH 80/84] [CLEAN] mail: vote: cleaned before merging. bzr revid: tde@openerp.com-20120918150544-2pgwh1mhi5yyqi22 --- addons/mail/mail_message.py | 19 ++++++++----------- addons/mail/mail_vote.py | 8 ++++---- addons/mail/static/src/img/vote.gif | Bin 892 -> 0 bytes addons/mail/static/src/js/mail.js | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) delete mode 100644 addons/mail/static/src/img/vote.gif diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 4b7c0c645e3..1d5d85e36e0 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -130,7 +130,8 @@ class mail_message(osv.Model): 'unread': fields.function(_get_unread, fnct_search=_search_unread, type='boolean', string='Unread', help='Functional field to search for unread messages linked to uid'), - 'vote_user_ids': fields.many2many('res.users', 'mail_vote', 'message_id', 'user_id', 'Votes'), + 'vote_user_ids': fields.many2many('res.users', 'mail_vote', 'message_id', 'user_id', string='Votes', + help='Users that voted for this message'), } def _needaction_domain_get(self, cr, uid, context=None): @@ -153,19 +154,16 @@ class mail_message(osv.Model): #------------------------------------------------------ def vote_toggle(self, cr, uid, ids, user_ids=None, context=None): - ''' - Toggles when Comment is liked or unlike. - create vote entries if current user like comment.. - ''' + ''' Toggles voting ''' if not user_ids: user_ids = [uid] for message in self.read(cr, uid, ids, ['vote_user_ids'], context=context): for user_id in user_ids: - has_voted = user_id in message['vote_user_ids'] + has_voted = user_id in message.get('vote_user_ids') if not has_voted: - self.write(cr, uid, ids, {'vote_user_ids': [(4, user_id)]}, context=context) + self.write(cr, uid, message.get('id'), {'vote_user_ids': [(4, user_id)]}, context=context) else: - self.write(cr, uid, ids, {'vote_user_ids': [(3, user_id)]}, context=context) + self.write(cr, uid, message.get('id'), {'vote_user_ids': [(3, user_id)]}, context=context) return True #------------------------------------------------------ @@ -174,11 +172,10 @@ class mail_message(osv.Model): def _message_dict_get(self, cr, uid, msg, context=None): """ Return a dict representation of the message browse record. """ - vote_pool = self.pool.get('mail.vote') has_voted = False vote_ids = self.pool.get('res.users').name_get(cr, uid, [user.id for user in msg.vote_user_ids], context=context) - for user_id in msg.vote_user_ids: - if (user_id.id == uid): + for vote in vote_ids: + if vote[0] == uid: has_voted = True break attachment_ids = [{'id': attach[0], 'name': attach[1]} for attach in self.pool.get('ir.attachment').name_get(cr, uid, [x.id for x in msg.attachment_ids], context=context)] diff --git a/addons/mail/mail_vote.py b/addons/mail/mail_vote.py index 3d69734f198..1e439fe0aeb 100644 --- a/addons/mail/mail_vote.py +++ b/addons/mail/mail_vote.py @@ -30,10 +30,10 @@ class mail_vote(osv.Model): _name = 'mail.vote' _description = 'Mail Vote' _columns = { - 'message_id': fields.many2one('mail.message', 'Message', required=True, - select=1), - 'user_id': fields.many2one('res.users', 'User', required=True, - select=1), + 'message_id': fields.many2one('mail.message', 'Message', select=1, + ondelete='cascade', required=True), + 'user_id': fields.many2one('res.users', 'User', select=1, + ondelete='cascade', required=True), } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mail/static/src/img/vote.gif b/addons/mail/static/src/img/vote.gif deleted file mode 100644 index 0e6b874770e1122b3f08f01d26bae9f08b94cfe6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 892 zcmZ?wbhEHb_7cRVe_wN7y z|G^4JiO~=kZXuxflZBCi;Xi{8$YY>9!N3v8@Sju0!k~eniGy7zp};`#5CadBg-XW) zha;V=k}f;~2O1ohWSp~PDnG_IFtaO6lF_`F(#WJ0K8@#t(X&(2OcGCB>Da7xoQcbW V?}tRu!6p_1OTLJPi-`^l)&OE6GJpU8 diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 2f5f95fbb62..57c777441e7 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -529,7 +529,7 @@ openerp.mail = function(session) { record.vote_user_ids.splice(idx, 1); } else { - record.vote_user_ids.push([this.session.uid, 'Current user']); + record.vote_user_ids.push([this.session.uid, 'You']); } record.has_voted = ! record.has_voted; var vote_element = session.web.qweb.render('mail.thread.message.vote', {'record': record}); From b08efa691824370130be1f009472ba7f59096127 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 18 Sep 2012 17:17:48 +0200 Subject: [PATCH 81/84] [FIX] Apply inputs maxlength according to field's size bzr revid: fme@openerp.com-20120918151748-gfzmmk61ih5g79yb --- addons/web/static/src/xml/base.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 4cc2629822d..232d4b618d7 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -919,6 +919,7 @@ t-att-tabindex="widget.node.attrs.tabindex" t-att-autofocus="widget.node.attrs.autofocus" t-att-placeholder="widget.node.attrs.placeholder" + t-att-maxlength="widget.field.size" /> @@ -933,6 +934,7 @@ t-att-tabindex="widget.node.attrs.tabindex" t-att-autofocus="widget.node.attrs.autofocus" t-att-placeholder="widget.node.attrs.placeholder" + t-att-maxlength="widget.field.size" /> @@ -951,6 +953,7 @@ t-att-tabindex="widget.node.attrs.tabindex" t-att-autofocus="widget.node.attrs.autofocus" t-att-placeholder="! widget.get('effective_readonly') ? widget.node.attrs.placeholder : ''" + t-att-maxlength="widget.field.size" > Date: Tue, 18 Sep 2012 18:17:51 +0200 Subject: [PATCH 82/84] [FIX] css fixes for editable list bzr revid: fva@openerp.com-20120918161751-fz73pig39zxm7hso --- addons/web/static/src/css/base.css | 22 +++++++++++++------- addons/web/static/src/css/base.sass | 18 +++++++++++++++- addons/web_kanban/static/src/css/kanban.css | 4 ++-- addons/web_kanban/static/src/css/kanban.sass | 4 ++-- 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 16861a7853f..dab079aba7a 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -25,7 +25,6 @@ display: none !important; } } - .openerp.openerp_webclient_container { height: 100%; position: relative; @@ -41,7 +40,7 @@ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); /* http://www.quirksmode.org/dom/inputfile.html * http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image - */ */ + */ } .openerp :-moz-placeholder { color: #afafb6 !important; @@ -1154,7 +1153,7 @@ color: white; padding: 2px 4px; margin: 1px 6px 0 0; - border: 1px solid lightGray; + border: 1px solid lightgrey; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -moz-border-radius: 4px; -webkit-border-radius: 4px; @@ -1179,7 +1178,7 @@ transform: scale(1.1); } .openerp .oe_secondary_submenu .oe_active { - border-top: 1px solid lightGray; + border-top: 1px solid lightgrey; border-bottom: 1px solid #dedede; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2); @@ -1521,6 +1520,7 @@ font-size: 1px; letter-spacing: -1px; color: transparent; + font-weight: normal; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; @@ -2001,6 +2001,8 @@ .openerp .oe_form .oe_subtotal_footer .oe_subtotal_footer_separator { width: 108px; border-top: 1px solid #cacaca; + margin-top: 4px; + padding-top: 4px; font-weight: bold; font-size: 18px; } @@ -2043,7 +2045,7 @@ } .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span { font-size: 80%; - color: darkGreen; + color: darkgreen; vertical-align: top; position: relative; top: -4px; @@ -2638,20 +2640,24 @@ } .openerp .oe_list_content td.oe_list_field_handle { width: 1em; + padding: 0 !important; cursor: ns-resize; } .openerp .oe_list_content td.oe_list_field_handle .oe_list_handle { font-size: 1px; letter-spacing: -1px; color: transparent; + font-weight: normal; + margin-right: 7px; } .openerp .oe_list_content td.oe_list_field_handle .oe_list_handle:before { - font: 21px "mnmliconsRegular"; - content: "ö"; - color: #404040; + font: 18px "entypoRegular"; + content: "}"; + color: #e0e0e0; } .openerp .oe_list_cannot_edit .oe_list_header_handle, .openerp .oe_list_cannot_edit .oe_list_field_handle { display: none !important; + padding: 0 !important; } .openerp .oe_list_cannot_delete .oe_list_record_delete { display: none !important; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index e3cb661d580..9d121457234 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -119,11 +119,22 @@ $sheet-max-width: 860px font-size: 1px letter-spacing: -1px color: transparent + font-weight: normal &:before font: 21px "mnmliconsRegular" content: $icon-name color: $color +@mixin text-to-entypo-icon($icon-name, $color: #404040, $size: 21px) + font-size: 1px + letter-spacing: -1px + color: transparent + font-weight: normal + &:before + font: $size "entypoRegular" + content: $icon-name + color: $color + // }}} @media print @@ -1574,6 +1585,8 @@ $sheet-max-width: 860px .oe_subtotal_footer_separator width: 108px border-top: 1px solid #cacaca + margin-top: 4px + padding-top: 4px font-weight: bold font-size: 18px label:after @@ -2068,13 +2081,16 @@ $sheet-max-width: 860px text-indent: -9001px td.oe_list_field_handle width: 1em + padding: 0 !important cursor: ns-resize .oe_list_handle - @include text-to-icon("ö") + @include text-to-entypo-icon("}",#E0E0E0,18px) + margin-right: 7px .oe_list_cannot_edit .oe_list_header_handle, .oe_list_field_handle display: none !important + padding: 0 !important .oe_list_cannot_delete .oe_list_record_delete display: none !important diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index 48cf725ead3..6218d028576 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -346,8 +346,8 @@ position: relative; display: block; background: white; - border: 1px solid #d8d8d8; - border-bottom-color: #b9b9b9; + border: 1px solid rgba(0, 0, 0, 0.16); + border-bottom-color: rgba(0, 0, 0, 0.3); padding: 8px; display: block; -moz-border-radius: 4px; diff --git a/addons/web_kanban/static/src/css/kanban.sass b/addons/web_kanban/static/src/css/kanban.sass index 95a63dbd1a2..a45515efdd0 100644 --- a/addons/web_kanban/static/src/css/kanban.sass +++ b/addons/web_kanban/static/src/css/kanban.sass @@ -311,8 +311,8 @@ position: relative display: block background: white - border: 1px solid #d8d8d8 - border-bottom-color: #b9b9b9 + border: 1px solid rgba(0,0,0,0.16) + border-bottom-color: rgba(0,0,0,0.3) padding: 8px display: block @include radius(4px) From c730c3cb784868ad5515e0e707939919d1af7e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Tue, 18 Sep 2012 18:25:32 +0200 Subject: [PATCH 83/84] [FIX] css header alignment bzr revid: fva@openerp.com-20120918162532-xte92rwm6jemy09f --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/css/base.sass | 2 ++ 2 files changed, 5 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index dab079aba7a..10ee9dea2de 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1957,6 +1957,9 @@ background-image: -o-linear-gradient(top, #fcfcfc, #dedede); background-image: linear-gradient(to bottom, #fcfcfc, #dedede); } +.openerp .oe_form header > span { + margin-left: 4px; +} .openerp .oe_form header ul { display: inline-block; float: right; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 9d121457234..1aa4726725c 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1551,6 +1551,8 @@ $sheet-max-width: 860px border-bottom: 1px solid #cacaca padding-left: 2px @include vertical-gradient(#fcfcfc, #dedede) + > span + margin-left: 4px ul display: inline-block float: right From bd1dc47bbec6f980f3bee1d960bff8b15d8612fd Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of openerp <> Date: Wed, 19 Sep 2012 04:37:39 +0000 Subject: [PATCH 84/84] Launchpad automatic translations update. bzr revid: launchpad_translations_on_behalf_of_openerp-20120919043739-2a9fz9y3pe1xv0ba --- addons/fetchmail/i18n/mk.po | 333 ++++++++++++++++++++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 addons/fetchmail/i18n/mk.po diff --git a/addons/fetchmail/i18n/mk.po b/addons/fetchmail/i18n/mk.po new file mode 100644 index 00000000000..741b3547812 --- /dev/null +++ b/addons/fetchmail/i18n/mk.po @@ -0,0 +1,333 @@ +# Macedonian translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 00:36+0000\n" +"PO-Revision-Date: 2012-09-18 16:07+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Macedonian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-09-19 04:37+0000\n" +"X-Generator: Launchpad (build 15966)\n" + +#. module: fetchmail +#: selection:fetchmail.server,state:0 +msgid "Confirmed" +msgstr "Потврдено" + +#. module: fetchmail +#: field:fetchmail.server,server:0 +msgid "Server Name" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,script:0 +msgid "Script" +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,priority:0 +msgid "Defines the order of processing, lower values mean higher priority" +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,is_ssl:0 +msgid "" +"Connections are encrypted with SSL/TLS through a dedicated port (default: " +"IMAPS=993, POP3S=995)" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,attach:0 +msgid "Keep Attachments" +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,original:0 +msgid "" +"Whether a full original copy of each email should be kept for referenceand " +"attached to each processed message. This will usually double the size of " +"your message database." +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,priority:0 +msgid "Server Priority" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,state:0 +msgid "State" +msgstr "Состојба" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "POP" +msgstr "POP" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Fetch Now" +msgstr "" + +#. module: fetchmail +#: model:ir.actions.act_window,name:fetchmail.action_email_server_tree +#: model:ir.ui.menu,name:fetchmail.menu_action_fetchmail_server_tree +msgid "Incoming Mail Servers" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,port:0 +msgid "Port" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "POP/IMAP Servers" +msgstr "POP/IMAP сервери" + +#. module: fetchmail +#: selection:fetchmail.server,type:0 +msgid "Local Server" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,user:0 +msgid "Username" +msgstr "" + +#. module: fetchmail +#: model:ir.model,name:fetchmail.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Reset Confirmation" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "SSL" +msgstr "" + +#. module: fetchmail +#: model:ir.model,name:fetchmail.model_mail_message +msgid "Email Message" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,date:0 +msgid "Last Fetch Date" +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,action_id:0 +msgid "" +"Optional custom server action to trigger for each incoming mail, on the " +"record that was created or updated by this mail" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "# of emails" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,original:0 +msgid "Keep Original" +msgstr "" + +#. module: fetchmail +#: code:addons/fetchmail/fetchmail.py:155 +#, python-format +msgid "" +"Here is what we got instead:\n" +" %s" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +#: field:fetchmail.server,configuration:0 +msgid "Configuration" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Incoming Mail Server" +msgstr "" + +#. module: fetchmail +#: code:addons/fetchmail/fetchmail.py:155 +#, python-format +msgid "Connection test failed!" +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,server:0 +msgid "Hostname or IP of the mail server" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Server type IMAP." +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,name:0 +msgid "Name" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,is_ssl:0 +msgid "SSL/TLS" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Test & Confirm" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,action_id:0 +msgid "Server Action" +msgstr "" + +#. module: fetchmail +#: field:mail.message,fetchmail_server_id:0 +msgid "Inbound Mail Server" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,message_ids:0 +#: model:ir.actions.act_window,name:fetchmail.act_server_history +msgid "Messages" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Search Incoming Mail Servers" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,active:0 +msgid "Active" +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,attach:0 +msgid "" +"Whether attachments should be downloaded. If not enabled, incoming emails " +"will be stripped of any attachments before being processed" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Advanced Options" +msgstr "" + +#. module: fetchmail +#: selection:fetchmail.server,type:0 +msgid "IMAP Server" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "IMAP" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Server type POP." +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,password:0 +msgid "Password" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Actions to Perform on Incoming Mails" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,type:0 +msgid "Server Type" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Login Information" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Server Information" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "If SSL required." +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Advanced" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:0 +msgid "Server & Login" +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,object_id:0 +msgid "" +"Process each incoming mail as part of a conversation corresponding to this " +"document type. This will create new documents for new conversations, or " +"attach follow-up emails to the existing conversations (documents)." +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,object_id:0 +msgid "Create a New Record" +msgstr "" + +#. module: fetchmail +#: selection:fetchmail.server,state:0 +msgid "Not Confirmed" +msgstr "Непотврдено" + +#. module: fetchmail +#: selection:fetchmail.server,type:0 +msgid "POP Server" +msgstr "" + +#. module: fetchmail +#: view:mail.message:0 +msgid "Mail Server" +msgstr "" + +#~ msgid "Confirm" +#~ msgstr "Потврди" + +#~ msgid "Group By..." +#~ msgstr "Групирај по..." + +#~ msgid "Type" +#~ msgstr "Вид" + +#~ msgid "" +#~ "Warning! Record for selected Model can not be created\n" +#~ "Please choose valid Model" +#~ msgstr "" +#~ "Предупредување! Записот за избраниот Модел не може да се креира\n" +#~ "Изберете валиден Модел"