From cb3e415a7cbaa169deb46711858d16a90ca1c89e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 21 Dec 2016 11:57:04 +0100 Subject: [PATCH 1/5] [FIX] mail: Allow modifying followers in multi company/with private channel It's a backport for https://github.com/odoo/odoo/commit/b795d69ce8aca2e88182c6d6d6b7af54d536f9dd It also backports this fix https://github.com/odoo/odoo/commit/c49265afa1b0610d52fd356df26491546f1905bf It also fixes #13578 --- addons/mail/controllers/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index d9e55765df1..2a632d09f9a 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -112,7 +112,14 @@ class MailController(http.Controller): def read_followers(self, follower_ids): result = [] is_editable = request.env.user.has_group('base.group_no_one') - for follower in request.env['mail.followers'].browse(follower_ids): + follower_recs = request.env['mail.followers'].sudo().browse(follower_ids) + if follower_recs: + mapped_data = {} + for follower_rec in follower_recs: + mapped_data.setdefault(follower_rec.res_model, set()).add(follower_rec.res_id) + for res_model, res_ids in mapped_data.iteritems(): + request.env[res_model].browse(list(res_ids)).check_access_rule("read") + for follower in follower_recs: result.append({ 'id': follower.id, 'name': follower.partner_id.name or follower.channel_id.name, From 58e85bdec08f6f07afe7b8cdfaea6f7cef2776d1 Mon Sep 17 00:00:00 2001 From: mehdi-ghezal Date: Sun, 12 Nov 2017 10:37:08 +0100 Subject: [PATCH 2/5] [FIX] sale_stock: qty calculation in procurement creation When updating the qty on a confirmed sale order line, we want the system to add new procurement qty for the cancelled procurements. That way you can leave the cancelled procurements for what they are. --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 62b1598db66..f238511deb1 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -594,7 +594,7 @@ class SaleOrderLine(models.Model): if line.state != 'sale' or not line.product_id._need_procurement(): continue qty = 0.0 - for proc in line.procurement_ids: + for proc in line.procurement_ids.filtered(lambda r: r.state != 'cancel'): qty += proc.product_qty if float_compare(qty, line.product_uom_qty, precision_digits=precision) >= 0: continue From 3fc6624631eb06f65bf487265f9bdcf0f7121ab5 Mon Sep 17 00:00:00 2001 From: Subodh Dahal Date: Fri, 9 Feb 2018 18:51:49 +0100 Subject: [PATCH 3/5] [CLA] SubodhDahal signs Odoo's CLA Done at #22971 --- doc/cla/individual/subodhdahal.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/subodhdahal.md diff --git a/doc/cla/individual/subodhdahal.md b/doc/cla/individual/subodhdahal.md new file mode 100644 index 00000000000..4e4c389bc99 --- /dev/null +++ b/doc/cla/individual/subodhdahal.md @@ -0,0 +1,11 @@ +Nepal, 2018-02-09 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Subodh Dahal contact.subodhdahal@gmail.com https://github.com/SubodhDahal From c2f20f12b9b426942b8adee06fbe5668a13b2a6b Mon Sep 17 00:00:00 2001 From: Subodh Dahal Date: Fri, 9 Feb 2018 18:36:05 +0100 Subject: [PATCH 4/5] [FIX] doc: recommand to xpath on snippet_structure Fixed the xpath expression for inserting snippet into Structure tab Closes #22971 --- doc/howtos/themes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/howtos/themes.rst b/doc/howtos/themes.rst index a66068a7b00..b6b9849c885 100644 --- a/doc/howtos/themes.rst +++ b/doc/howtos/themes.rst @@ -614,7 +614,7 @@ The previous code will create the snippet’s content, but we still need to plac .. code-block:: xml