From 7b445112bcab9288077fe1497d0dbce3f6f78ccb Mon Sep 17 00:00:00 2001 From: Yoshi Tashiro Date: Mon, 15 Feb 2016 20:59:57 +0800 Subject: [PATCH 01/40] [CLA] add contributor to roomsfor CLA Adding @manamirfhk Closes #10932 --- doc/cla/corporate/roomsfor.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/cla/corporate/roomsfor.md b/doc/cla/corporate/roomsfor.md index f2aa1d0c2ce..522ffffe78a 100644 --- a/doc/cla/corporate/roomsfor.md +++ b/doc/cla/corporate/roomsfor.md @@ -11,3 +11,4 @@ Yoshi Tashiro tashiro@roomsfor.hk https://github.com/yostashiro List of contributors: Yoshi Tashiro tashiro@roomsfor.hk https://github.com/yostashiro +Manami Hashi manami@roomsfor.hk https://github.com/manamirfhk From 851992cdd6d44611da69ff0ab51b98775b00fb9b Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 15 Feb 2016 16:31:17 +0100 Subject: [PATCH 02/40] [FIX] product_visible_discount: lst_price In a SO line, the price unit is taken from function "_product_price" set on the product(model: "product.product"), this is why the variable new_list_price has to be taken on the product too. In this way, the right discount can be computed. Before the fix, new_list_price was equal to the price set on the product template(list_price) then if the product template had several variants with several sale price, the discount was wrongly computed. opw:668636 --- addons/product_visible_discount/product_visible_discount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product_visible_discount/product_visible_discount.py b/addons/product_visible_discount/product_visible_discount.py index 5d77144e4cf..98363e6ff42 100644 --- a/addons/product_visible_discount/product_visible_discount.py +++ b/addons/product_visible_discount/product_visible_discount.py @@ -20,7 +20,7 @@ class sale_order_line(osv.osv): """Retrieve the price before applying the pricelist""" item_obj = self.pool['product.pricelist.item'] product_obj = self.pool['product.product'] - field_name = 'list_price' + field_name = 'lst_price' currency_id = None if res_dict.get(pricelist): rule_id = res_dict[pricelist][1] From b87b6cc6135087d6900c1a6b3a6251a2c09af867 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 16 Feb 2016 09:36:56 +0100 Subject: [PATCH 03/40] [FIX] mail: allow to extend make_message() and make_channel() to load and display more fields of the corresponding model. --- addons/mail/static/src/js/chat_manager.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index 0dc41db8f0d..eb0e282e45f 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -148,7 +148,7 @@ function add_message (data, options) { var msg = _.findWhere(messages, { id: data.id }); if (!msg) { - msg = make_message(data); + msg = chat_manager.make_message(data); // Keep the array ordered by id when inserting the new message messages.splice(_.sortedIndex(messages, msg, 'id'), 0, msg); _.each(msg.channel_ids, function (channel_id) { @@ -298,7 +298,7 @@ function add_channel (data, options) { chat_manager.bus.trigger("channel_toggle_fold", channel); } } else { - channel = make_channel(data, options); + channel = chat_manager.make_channel(data, options); channels.push(channel); channels = _.sortBy(channels, function (channel) { return channel.name.toLowerCase(); }); if (!options.silent) { @@ -677,6 +677,10 @@ function on_presence_notification (data) { // Public interface //---------------------------------------------------------------------------------- var chat_manager = { + // these two functions are exposed for extensibility purposes and shouldn't be called by other modules + make_message: make_message, + make_channel: make_channel, + post_message: function (data, options) { options = options || {}; var msg = { From 36e681cbe545d0dc5d9489471861e2f361346e26 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Tue, 16 Feb 2016 09:34:45 +0100 Subject: [PATCH 04/40] [FIX] website_quote: sales order do not use workflow any longer + old message_post call with wrong kwargs. --- addons/website_quote/models/order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_quote/models/order.py b/addons/website_quote/models/order.py index 05a58e375ae..0d118fb272e 100644 --- a/addons/website_quote/models/order.py +++ b/addons/website_quote/models/order.py @@ -294,9 +294,9 @@ class sale_order(osv.osv): # create draft invoice if transaction is ok if tx and tx.state == 'done': if order.state in ['draft', 'sent']: - self.signal_workflow(cr, SUPERUSER_ID, [order.id], 'manual_invoice', context=context) + self.action_confirm(cr, SUPERUSER_ID, order.id, context=context) message = _('Order payed by %s. Transaction: %s. Amount: %s.') % (tx.partner_id.name, tx.acquirer_reference, tx.amount) - self.message_post(cr, uid, order_id, body=message, type='comment', subtype='mt_comment', context=context) + self.message_post(cr, uid, order_id, body=message, context=context) return True return False From a5e8f227015f229356edb5630507eb6b3ce22d89 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Tue, 16 Feb 2016 09:32:28 +0100 Subject: [PATCH 05/40] [FIX] payment_ogone: s2s response should generate payment method Ogone responses comes from direct s2s calls or form feedback; not necessarily in that order. The behaviour of the system should be the same in both cases. This commit add payment_methode creation when a s2s response contains the necessary information, juste like the form feedback methods. Ideally these methods should be merged to share the same code, this will be done in master (v10). --- addons/payment_ogone/models/ogone.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/payment_ogone/models/ogone.py b/addons/payment_ogone/models/ogone.py index 0a07315467f..53db91d5e34 100644 --- a/addons/payment_ogone/models/ogone.py +++ b/addons/payment_ogone/models/ogone.py @@ -264,7 +264,7 @@ class PaymentTxOgone(osv.Model): 'acquirer_id': tx.acquirer_id.id, 'acquirer_ref': alias }) - tx.partner_reference = alias + tx.write({'payment_method_id': ref}) return tx @@ -294,7 +294,7 @@ class PaymentTxOgone(osv.Model): 'date_validate': datetime.datetime.strptime(data['TRXDATE'], '%m/%d/%y').strftime(DEFAULT_SERVER_DATE_FORMAT), 'acquirer_reference': data['PAYID'], } - if data.get('ALIAS') and tx.partner_id and tx.type == 'form_save': + if data.get('ALIAS') and tx.partner_id and tx.type == 'form_save' and not tx.payment_method_id: pm_id = self.pool['payment.method'].create(cr, uid, { 'partner_id': tx.partner_id.id, 'acquirer_id': tx.acquirer_id.id, @@ -399,6 +399,14 @@ class PaymentTxOgone(osv.Model): 'date_validate': datetime.date.today().strftime(DEFAULT_SERVER_DATE_FORMAT), 'acquirer_reference': tree.get('PAYID'), }) + if tree.get('ALIAS') and tx.partner_id and tx.type == 'form_save' and not tx.payment_method_id: + pm = tx.env['payment.method'].create({ + 'partner_id': tx.partner_id.id, + 'acquirer_id': tx.acquirer_id.id, + 'acquirer_ref': tree.get('ALIAS'), + 'name': tree.get('CARDNO'), + }) + tx.write({'payment_method_id': pm.id}) if tx.callback_eval: safe_eval(tx.callback_eval, {'self': tx}) return True From 8e78f0e841a476373a98c7102e569c68479fbfd0 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 16 Feb 2016 13:03:43 +0100 Subject: [PATCH 06/40] [FIX] purchase: PO without picking When an order is created without any picking, the button "RECEIVE PRODUCTS" can be hidden. opw:669081 --- addons/purchase/purchase_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 30300881455..9008a08af00 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -146,7 +146,7 @@